【问题标题】:VSTS - build definition error in solution fileVSTS - 解决方案文件中的构建定义错误
【发布时间】:2018-01-23 10:51:28
【问题描述】:

这可能是我做错的简单事情,因为我是 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

【问题讨论】:

  • 解决方案文件中有对特定于您的环境的本地路径的硬编码引用。找出来,用相对路径替换(如果不需要,则删除),你应该没问题。

标签: azure-devops


【解决方案1】:

在 VS 构建任务中,您应该为您的网站项目在 VS 构建任务的解决方案选项中指定 publishproj 文件而不是 sln

您可以指定publishproj 文件的详细相对路径或使用通配符来匹配您要构建的网站项目,如下例所示:

【讨论】:

  • 为什么?这解决了我的问题,但我真的很想知道为什么他们默认项目来构建 .sln,如果它真的应该指向 publishproj
猜你喜欢
  • 2017-11-18
  • 1970-01-01
  • 1970-01-01
  • 2014-05-15
  • 2016-01-18
  • 1970-01-01
  • 2018-02-19
  • 1970-01-01
  • 2011-12-24
相关资源
最近更新 更多