I have this solution (Project1) and that has 2x web app projects and 3x dependent library projects. The primary web app project builds and deploys using publish profiles just fine, however, the second web app project is an API (noted below) with publish profiles named the same as the main project, but of course, are going to different locations. Unfortunately, the project will build and deploy using the publish profiles just fine in VS2019, however, when using the MSBuild command (TeamCity server):
MSBuild.exe /m /p:DeployOnBuild=True /p:PublishProfile=Test /t:Rebuild
I get the following error:
CopyAllFilesToSingleFolderForAspNetCompileMerge:
Creating directory "obj\Debug\AspnetCompileMerge\Source".
Copying all files to temporary location below for package/publish:
obj\Debug\AspnetCompileMerge\Source.
Copying bin\KuderCore.API.dll to obj\Debug\AspnetCompileMerge\Source\bin\Project1.API.dll.
Copying bin\KuderCore.API.pdb to obj\Debug\AspnetCompileMerge\Source\bin\Project1.API.pdb.
Copying Areas\HelpPage\HelpPage.css to obj\Debug\AspnetCompileMerge\Source\Areas\HelpPage\HelpPage.css.
Copying Content\bootstrap-theme.css to obj\Debug\AspnetCompileMerge\Source\Content\bootstrap-theme.css.
Copying Content\bootstrap-theme.min.css to obj\Debug\AspnetCompileMerge\Source\Content\bootstrap-theme.min.css.
Copying Content\bootstrap.css to obj\Debug\AspnetCompileMerge\Source\Content\bootstrap.css.
Copying Content\bootstrap.min.css to obj\Debug\AspnetCompileMerge\Source\Content\bootstrap.min.css.
Copying favicon.ico to obj\Debug\AspnetCompileMerge\Source\favicon.ico.
Copying fonts\glyphicons-halflings-regular.svg to obj\Debug\AspnetCompileMerge\Source\fonts\glyphicons-halflings-regular.svg.
Copying Global.asax to obj\Debug\AspnetCompileMerge\Source\Global.asax.
Copying Properties\PublishProfiles\Test.pubxml.user to obj\Debug\AspnetCompileMerge\Source\Properties\PublishProfiles\Test.pubxml.user.
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VisualStudio\v16.0\Web\Transform\
Microsoft.Web.Publishing.AspNetCompileMerge.targets(615,5): error : Copying file Properties\PublishProfiles\
Test.pubxml.user to obj\Debug\AspnetCompileMerge\Source\Properties\PublishProfiles\
Test.pubxml.user failed. Could not find file 'Properties\PublishProfiles\Test.pubxml.user'
Done Building Project "Project1\Project1.API\Project1.API.csproj" (Rebuild target(s)) -- FAILED.
Build FAILED.
For some reason, MSBuild isn't generating a .user file and it is bombing instead. Any idea what is going on?