I need to publish a .NET web site project to a local directory. The web site project is part of a solution that also contains a web app. The Publish Web App option in Visual Studio publishes the web site to the directory without issue, however I am unable to publish the site through msbuild.
My msbuild command
msbuild "C:\...\ProjectName\website.publishproj" /p:deployOnBuild=true /p:publishProfile=Dev /p:PrecompileBeforePublish=false /p:VisualStudioVersion=14.0 /p:WebPublishMethod=FileSystem
The dev.pubxml publish profile I am referencing is:
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>True</ExcludeApp_Data>
<publishUrl>C:\FolderLocation</publishUrl>
<DeleteExistingFiles>False</DeleteExistingFiles>
<ExcludeFoldersFromDeployment>.vs</ExcludeFoldersFromDeployment>
</PropertyGroup>
</Project>
Currently the web site is not publishing to C:\FolderLocation
but instead appears to publish to ProjectName\PrecompiledWeb\localhost_51636
. Changing the output directory via /p:OutDir=C:\FolderLocation
publishes the web app to the correct location, however it does not publish the web site. I have also tried both /p:PublishDestination
and /p:DesktopBuildPackageLocation
msbuild arguments however the original issue remains.
I have referenced Publish Artifacts for website goes to PrecompiledWeb and many other resources. My eventual goal is to setup CI through Azure Devops for the entire legacy .NET website project.