我有这个解决方案(Project1),它有 2 个 Web 应用程序项目和 3 个依赖库项目。主要的 Web 应用程序项目使用发布配置文件构建和部署就好了,但是,第二个 Web 应用程序项目是一个 API(如下所述),其发布配置文件的名称与主项目相同,但当然,它们会转到不同的位置。不幸的是,该项目将在 VS2019 中使用发布配置文件进行构建和部署,但是,当使用 MSBuild 命令(TeamCity 服务器)时:
MSBuild.exe /m /p:DeployOnBuild=True /p:PublishProfile=Test /t:Rebuild
我收到以下错误:
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.
出于某种原因,MSBuild 没有生成 .user 文件,而是在轰炸。知道发生了什么吗?