gpt4 book ai didi

.net-core - DocFX(在 Azure DevOps 中): The imported project "\15.0\Microsoft.Common.props" was not found

转载 作者:行者123 更新时间:2023-12-02 17:43:34 27 4
gpt4 key购买 nike

尝试从 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/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com