2012-08-31 40 views
3

使用的是在命令行中我试图运行发布选项,它的工作原理的Visual Studio 2012脚本不会公布网站为VS2012

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

我的项目里面很大调用下面的MSBuild脚本.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是...

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

有什么W¯¯这些文件会阻止“发布”选项的运行?该脚本运行时没有错误,但是当我查看C:\temp\Deploy directory时,没有文件。

回答

1

我无法让发布运行,但看着Visual Studio的输出我想我已经找到了一个替代解决方案。发现obj \ Release \ AspnetCompileMerge文件夹有一个可部署且干净的项目版本。它包含与最终输出文件夹相同的文件。

我不得不改变我的MSBuild脚本包括DeployOnBuild选项...

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