I am trying to automate the deployment of a Web Api 2 project using Visual Studio 2013. I published a publishing profile called Test, shown below
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <WebPublishMethod>FileSystem</WebPublishMethod> <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> <LastUsedPlatform>x86</LastUsedPlatform> <SiteUrlToLaunchAfterPublish /> <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish> <ExcludeApp_Data>False</ExcludeApp_Data> <publishUrl>C:\DbServiceDeploy</publishUrl> <DeleteExistingFiles>True</DeleteExistingFiles> </PropertyGroup> </Project>
Even though it has the line <LastUsedBuildConfiguration> Release </LastUsedBuildConfiguration> it looks like Visual Studio is publishing my debug build. I call msbuild
"C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" C:\somefolder\Myproj.csproj /p: DeployOnBuild=true /p:PublishProfile=Test
source share