我有用VS2010创建的ac..Net 4.0项目,现在可以通过VS2012访问.
我正在尝试仅将所需文件从此网站发布到目标位置(C:\ builds\MyProject [Files])
我的文件结构: ./ ProjectRoot / MyProject.csproj ./ProjectRoot/Properties/PublishProfiles/FileSystemDebug.pubxml
我通过MSBuild运行以下代码:
C:\ Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe ./ProjectRoot/MyProject.csproj/p:DeployOnBuild = true /p:PublishProfile=./ProjectRoot/Properties/PublishProfiles/FileSystemDebug.pubxml
这是FileSystemDebug.pubxml中的xml
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<ExcludeApp_Data>False</ExcludeApp_Data>
<publishUrl>C:\builds\MyProject\</publishUrl>
<DeleteExistingFiles>True</DeleteExistingFiles>
</PropertyGroup>
</Project>
Run Code Online (Sandbox Code Playgroud)
结果是:
<publishUrl>C:\builds\MyProject\</publishUrl>WTF当我通过visual studio运行此发布配置文件时,会在*C:\ builds\MyProject*中创建一个文件夹,其中包含我想要的确切工件.
如何从msbuild获得这个简单的结果?