作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
尝试从 Azure DevOps 构建任务生成 DocFX 文档时收到这些警告(在本地工作正常):
Build succeeded with warning.
[19-04-25 03:02:23.747]Warning:[MetadataCommand.ExtractMetadata](d:/a/1/s/src/RailSharp/RailSharp.csproj)Workspace failed with: [Failure] Msbuild failed when processing the file 'd:\a\1\s\src\RailSharp\RailSharp.csproj' with message: The imported project "\15.0\Microsoft.Common.props" was not found. Also, tried to find "\15.0\Microsoft.Common.props" in the fallback search path(s) for $(MSBuildExtensionsPath) - "C:\Program Files (x86)\MSBuild" . These search paths are defined in "C:\Users\VssAdministrator\.nuget\packages\docfx.console\2.42.0\tools\docfx.exe.Config". Confirm that the path in the <Import> declaration is correct, and that the file exists on disk in one of the search paths. C:\Program Files\dotnet\sdk\2.2.105\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.props
[19-04-25 03:02:23.747]Warning:[MetadataCommand.ExtractMetadata]Project 'd:\a\1\s\src\RailSharp\RailSharp.csproj' does not contain any documents.
[19-04-25 03:02:23.747]Warning:[MetadataCommand.ExtractMetadata]No metadata is generated for RailSharp.
该错误来自 dotnet build
命令(DocFX 在调用该命令时生成文档)。
这是我使用的 csproj 文件:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="docfx.console" Version="2.42.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>
我做错了什么还是 DocFX 问题?
如果需要的话,这是我的代码分支:https://github.com/softframe/railsharp/tree/feature/docs
最佳答案
感谢LeoLiu-MSFT为我指明了正确的方向。 在我将 azure-pipelines.yml
中的虚拟机镜像设置为 vs2017-win2016
后,它就起作用了,如下所示:
pool:
vmImage: vs2017-win2016
DocFX 需要 Visual Studio(或至少 VS 构建工具)才能构建文档。因此,因为 VS 是在本地安装的,而不是在我在 Azure DevOps 中使用的 VM 镜像上(即 windows-latest
)这就是它在本地工作但在 Azure DevOps 中不起作用的原因。
关于.net-core - DocFX(在 Azure DevOps 中): The imported project "\15.0\Microsoft.Common.props" was not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55841729/
我是一名优秀的程序员,十分优秀!