我有一个包含3个项目的Visual Studio 2013解决方案(称为Twins):
参考
我正在尝试使用msbuild从命令行构建和发布(WebPublishMethod = FileSystem)站点和WCF。
这适用于WCF项目(为清晰起见,分成多行):
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe
.\Twins.sln /t:Wcf
/p:"VisualStudioVersion=12.0;PublishProfile=wcfprofile;DeployOnBuild=true"
Site项目失败:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe
.\Twins.sln /t:Site
/p:"VisualStudioVersion=12.0;PublishProfile=siteprofile;DeployOnBuild=true"
简短的错误消息
The value for PublishProfile is set to 'siteprofile',
expected to find the file at
\Twins\Wcf\Properties\PublishProfiles\siteprofile.pubxml'
but it could not be found.
详细错误消息
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets(4331,5):
error :
The value for PublishProfile is set to 'siteprofile',
expected to find the file at
'C:\Users\USERNAME\code\Twins\Wcf\Properties\PublishProfiles\siteprofile.pubxml'
but it could not be found.
[C:\Users\USERNAME\code\Twins\Wcf\Wcf.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets(4338,4):
error :
PublishProfile(siteprofile) is set.
But the $(WebPublishMethod) does not have a valid value.
Current Value is "".
[C:\Users\USERNAME\code\Twins\Wcf\Wcf.csproj]
在Visual Studio中,我可以右键单击“站点”,选择“发布”,选择站点发布配置文件,仅发布站点。
如何从命令行构建和发布Site项目,就像我在Visual Studio中可以做的那样? (无论是否建立/发布WCF项目都不重要。)