I have mixed web and windows projects in VS 2013. I have a solution to build all the projects. For testing purposes I would like to automatically deploy some of the web projects into a local folder. I can do that manually, right click menu and select publish...
I have created publish profile which looks like
<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>False</ExcludeApp_Data>
<publishUrl>$(MSBuildThisFileDirectory)..\..\bin\PublishFolder\</publishUrl>
<DeleteExistingFiles>True</DeleteExistingFiles>
</PropertyGroup>
</Project>
I can publish from the command line using msbuild as
msbuild C:\work\Source\AppManager\SereverManager.csproj /p:DeployOnBuild=true /p:PublishProfile=Local
That gives me the designed outcome as well.
What I would like to do is combine project build and publish. Which means I would like to deploy automatically every time I build the project.
I tried setting a batch file and calling msbuild from post-build event, but that causes VS to freeze, not even sure if that is the right approach. Is it possible to modify my csproj file to publish every time I build the project?