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
2 Answers
Reset to default 0Check 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