脚本无法发布VS2012网站

3

使用以下从命令行调用的MSBuild脚本,我正在尝试运行发布选项,在Visual Studio 2012中运行良好。

<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>

Project.pubxml.user is...

<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>

这些文件是否存在问题,导致“发布”选项无法工作?脚本运行没有错误,但是当我查看 C:\temp\Deploy 目录时,没有发现任何文件。

2个回答

2

1

我无法使发布运行,但是通过查看Visual Studio的输出,我认为我已经找到了另一种解决方案。原来obj\Release\AspnetCompileMerge文件夹中有一个可部署和干净的项目版本。它包含与最终输出文件夹完全相同的字节文件。

我确实不得不更改我的msbuild脚本以包括DeployOnBuild选项...

<MSBuild Properties="Configuration=Release;DeployOnBuild=True;" 
         StopOnFirstFailure="true" 
         Projects="$(BuildDirectory)\BigWave.ALL.sln"></MSBuild>

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接