最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

c# - Multi target class library gives build error on team foundation 2017 on premise - Stack Overflow

programmeradmin3浏览0评论

I have a class library targetting both net481 and net8.0 I installed visual studio 2022 on the agent server in order to build the net 8.0 version of the project.

Now i get following error(s):

CSC : error CS0006: Metadata file '..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll' could not be found [c:\TF-Agents\Agent2017-002\_work\1\s\System\Core\Core.csproj::TargetFramework=net481]
2025-02-19T10:54:22.1816296Z   CSC : error CS0006: Metadata file '..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll' could not be found [c:\TF-Agents\Agent2017-002\_work\1\s\System\Core\Core.csproj::TargetFramework=net481]

2025-02-19T10:54:22.1816296Z   CSC : error CS0006: Metadata file '..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll' could not be found [c:\TF-Agents\Agent2017-002\_work\1\s\System\Core\Core.csproj::TargetFramework=net8.0]
2025-02-19T10:54:22.1816296Z   CSC : error CS0006: Metadata file '..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll' could not be found [c:\TF-Agents\Agent2017-002\_work\1\s\System\Core\Core.csproj::TargetFramework=net8.0]

Any suggestions on what might be posing the problem? I already upgraded nuget codedom package to the latest version

I have a class library targetting both net481 and net8.0 I installed visual studio 2022 on the agent server in order to build the net 8.0 version of the project.

Now i get following error(s):

CSC : error CS0006: Metadata file '..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll' could not be found [c:\TF-Agents\Agent2017-002\_work\1\s\System\Core\Core.csproj::TargetFramework=net481]
2025-02-19T10:54:22.1816296Z   CSC : error CS0006: Metadata file '..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll' could not be found [c:\TF-Agents\Agent2017-002\_work\1\s\System\Core\Core.csproj::TargetFramework=net481]

2025-02-19T10:54:22.1816296Z   CSC : error CS0006: Metadata file '..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll' could not be found [c:\TF-Agents\Agent2017-002\_work\1\s\System\Core\Core.csproj::TargetFramework=net8.0]
2025-02-19T10:54:22.1816296Z   CSC : error CS0006: Metadata file '..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll' could not be found [c:\TF-Agents\Agent2017-002\_work\1\s\System\Core\Core.csproj::TargetFramework=net8.0]

Any suggestions on what might be posing the problem? I already upgraded nuget codedom package to the latest version

Share Improve this question asked 14 hours ago Thierry VerhaegenThierry Verhaegen 1852 silver badges12 bronze badges 1
  • did you try restoring NuGet: dotnet restore dotnet clean dotnet build – Emad Kerhily Commented 13 hours ago
Add a comment  | 

2 Answers 2

Reset to default 0

Check the .csproj File: Make sure that the paths to the NuGet packages are correct and that they are included for both target frameworks. You might need to add conditional references if the paths differ between frameworks.

I ended up just deleting the lines where it wanted to import the analyzers in the csproj

发布评论

评论列表(0)

  1. 暂无评论