realvizu/NsDepCop

Error with System.Runtime version 4.2.2.0

artbase opened this issue · 3 comments

When I created new empty project in .NET Core and I added newest version of NsDepCop 2.0.1 I got the message

1>CSC : warning CS8032: An instance of analyzer Codartis.NsDepCop.RoslynAnalyzer.NsDepCopAnalyzer cannot be created from C:\Users\[user]\.nuget\packages\nsdepcop\2.0.1\analyzers\dotnet\cs\NsDepCop.Analyzer.dll : Could not load file or assembly 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified..

Additionally I have chosen target to => netcoreapp3.1
What should I change or download?

I tried to reproduce the problem but couldn't.
Can you give me info about your environment and any extra steps that you took and might be relevant?

My environment:

  • Visual Studio 2022 Community 17.1.2

My csproj file:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="NsDepCop" Version="2.0.1">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
  </ItemGroup>
</Project>

I googled it a bit. Can this answer be relevant? https://stackoverflow.com/a/68820893/38186

Closing as no repro. Feel free to reopen if you have more info.