这可能是一些简单的事情,因为我是 VSTS 的新手,所以我做错了。
我已将现有的 .NET 网站项目上传到 VSTS,当我在 VSTS 中运行生成定义时,解决方案文件中出现错误。
我可以看到问题是什么......解决方案文件中包含我的 PC 上的项目路径......它存储在我的 PC 上的 inetpub/wwwroot/VSProjects 中。
我是否缺少一些简单的东西来避免这种情况?可能应该通过某种方式将 .net 网站上传到 vsts 以避免出现此路径错误?
感谢您的帮助...
这是构建解决方案日志错误 -
2018-01-19T16:34:14.3619604Z C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v /PropertyRegister -p ..\..\..\..\..\..\inetpub\wwwroot\VSProjects\PropertyRegister\ -u -f PrecompiledWeb\PropertyRegister\
2018-01-19T16:34:16.1411730Z ##[error]ASPNETCOMPILER(0,0): Error 1003: The directory 'd:\inetpub\wwwroot\VSProjects\PropertyRegister\' doesn't exist.
2018-01-19T16:34:16.1419278Z ASPNETCOMPILER : error 1003: The directory 'd:\inetpub\wwwroot\VSProjects\PropertyRegister\' doesn't exist. [d:\a\3\s\PropertyRegister\PropertyRegister.metaproj]
2018-01-19T16:34:16.1806460Z Done Building Project "d:\a\3\s\PropertyRegister\PropertyRegister.metaproj" (default targets) -- FAILED.
2018-01-19T16:34:16.1818301Z Done Building Project "d:\a\3\s\PropertyRegister\PropertyRegister.sln" (default targets) -- FAILED.
2018-01-19T16:34:16.1837158Z
2018-01-19T16:34:16.1837587Z Build FAILED.
2018-01-19T16:34:16.1873374Z
2018-01-19T16:34:16.1882800Z "d:\a\3\s\PropertyRegister\PropertyRegister.sln" (default target) (1) ->
2018-01-19T16:34:16.1884216Z (ValidateProjects target) ->
2018-01-19T16:34:16.1885795Z d:\a\3\s\PropertyRegister\PropertyRegister.sln.metaproj : warning MSB4121: The project configuration for project "PropertyRegister" was not specified in the solution file for the solution configuration "Release|Any CPU". [d:\a\3\s\PropertyRegister\PropertyRegister.sln]
2018-01-19T16:34:16.1886267Z
最佳答案
在 VS Build 任务中,您应该在 VS Build 任务的解决方案选项中为您的网站项目指定 publishproj
文件,而不是 sln
文件 .
您可以指定 publishproj
文件的详细相对路径或使用通配符来匹配您要构建的网站项目,如下例所示:
关于azure-devops - VSTS - 解决方案文件中的构建定义错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48379708/