Msbuild 脚本赢得';t发布VS2012的网站
使用以下从命令行调用的MSBuild脚本,我尝试运行publish选项,该选项在VisualStudio2012中非常有效Msbuild 脚本赢得';t发布VS2012的网站,msbuild,visual-studio-2012,Msbuild,Visual Studio 2012,使用以下从命令行调用的MSBuild脚本,我尝试运行publish选项,该选项在VisualStudio2012中非常有效 <Target Name="BuildRelease"> <MSBuild Properties="Configuration=Release;DeployOnBuild=True; DeployTarget=Publish;CreatePackageOnPublish=True" StopOnFirstFailu
<Target Name="BuildRelease">
<MSBuild
Properties="Configuration=Release;DeployOnBuild=True;
DeployTarget=Publish;CreatePackageOnPublish=True"
StopOnFirstFailure="true"
Projects="$(BuildDirectory)\BigWave.ALL.sln"></MSBuild>
</Target>
我的Project.pubxml是
<Project ToolsVersion="4.0"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<SiteUrlToLaunchAfterPublish />
<publishUrl>c:\temp\Deploy</publishUrl>
<DeleteExistingFiles>False</DeleteExistingFiles>
</PropertyGroup>
</Project>
文件系统
c:\temp\Deploy
假的
Project.pubxml.user是
<Project ToolsVersion="4.0"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<TimeStampOfAssociatedLegacyPublishXmlFile />
</PropertyGroup>
...snipped ItemGroup which has all my files and last timestamp of publish
</Project>
释放
任何CPU
…剪切了包含所有我的文件和发布的最后时间戳的ItemGroup
这些文件是否存在妨碍发布选项工作的问题?脚本运行时没有错误,但是当我查看
C:\temp\Deploy目录时,没有文件。我无法运行发布,但是查看Visual Studio的输出,我认为我找到了另一种解决方案。结果表明,obj\Release\aspnetcompiler文件夹具有可部署且干净的项目版本。它包含与最终输出文件夹相同的字节文件
我必须更改msbuild脚本以包含DeployOnBuild选项
<MSBuild Properties="Configuration=Release;DeployOnBuild=True;"
StopOnFirstFailure="true"
Projects="$(BuildDirectory)\BigWave.ALL.sln"></MSBuild>
根据这一点,当您为相同的解决方案同时使用VS2010和VS2012时,您必须指定正在使用的VS版本。我只是简单地添加了这个版本,现在它可以工作了
我希望这对你有帮助
致意