LINQPad 6 - Error CS0012 "You must add a reference to assembly netstandard, Version=2.0.0.0"
I am occasionally getting errors in LINQPad v6 of the following form:
CS0012 The type 'X' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
(Where type X is different depending on the particular query - sometimes 'Object', sometimes 'Action<>', etc.)
The error occurs in both v6.5.5 as well as the beta v6.6.3.
The error occurs in both x86 and x64 builds.
The error does NOT occur in LINQPad 5.
I have the following dotnet SDKs installed:
2.2.402 [C:\Program Files\dotnet\sdk] 3.0.102 [C:\Program Files\dotnet\sdk] 3.1.100 [C:\Program Files\dotnet\sdk]
I have the following dotnet runtimes installed:
Microsoft.AspNetCore.All 2.1.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Is this a known issue, and is there anything I can do to work around it?
Cheers
Comments
What assemblies or packages does your query reference? Can you share the query that causes this error?
In one example, I'm getting the error when doing nothing but attempting to query a SQL Server LocalDb instance.
Here is that particular query: https://downloads.mking.net/Query1.linq
Here is a screenshot of the error: https://downloads.mking.net/Query1.png
In another example, I get the error when referencing System.Security.Cryptography.ProtectedData.
Query: https://downloads.mking.net/Query2.linq
Screenshot: https://downloads.mking.net/Query2.png
I can replicate it with other NuGet packages as well. Either I'm doing something profoundly wrong, or something just seems to have gone wrong with my LINQPad6 install. I've also tried uninstalling and reinstalling LINQPad, but that doesn't help either.
Thanks for your assistance.
I would try:
Deleting your nuget cache:
%userprofile%\.nuget\
Thanks Joe. Clearing my NuGet cache has solved the issue. Much appreciated.