Error: Cannot load file or assembly netstandard, Version=2.1.0.0

I have a AzureFunctions project that I needed to upgrade to .NET standard 2.1 (from 2.0) All of my other projects in the solution load and compile correctly but this AzureFunctions project is throwing this error:

Error System.IO.FileNotFoundException: Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified. File name: 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'

I've verified all the nuget packages are updated, what else could it be?

Thanks!


Some times you receive this error because you have referenced a library/nuget package that target the incompatible .Net standard. example: If you create project that target to .Net Core 2.2 and you try to add the library which target .net standard 2.1 then you will get the same error because .Net Core 2.2 is compatible with .net standard 2.0 or lower so you can add package/library that target to .Net Standard 2.0 or lower version. Please see the links for more details :

.Net Core and .Net Standard

.Net Standard Compatiblity Table

System.IO.FileNotFoundException: 'Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.' unless I add the deprecated NETStandard.Library.NETFramework to the console.


I had the same problem. I eventually discovered that changing the Azure functions project properties to target .NET Core 3.1 still left the Azure function version on V2. The solution was to edit the CSPROJ and set the AzureFunctionsVersion from v2 to v3.

Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.` This doesn't happen on all the endpoints, just one, where I'm using Microsoft.Xrm.Sdk.


I get the same error.

I don't think it's related to Microsoft.NET.Sdk.Functions package as you need that package (specifically 1.0.30-beta2 in order to try the preview of .net core 3).

I think it's got something to do with Microsoft.Extensions.Logging. If you create a new azure functions project you'll see the Azure.WebJobs.Extensions.Storage uses v2.1 of the logging package within it. However if you have a project that itself uses the latest logging, then it'll use v3.0 too. But somewhere along the lines I don't think it really wants to and it fails in azure trying to find v2.1.

If your function takes an ILogger as a parameter it'll fail too more specifically showing it can't find that type. I think this is all because ultimately it's a preview, I can't seem to get it to work just now either.

After updating to Functions v3-preview and upgrading the TargetFramework to netcoreapp3.0 I am getting the following error: Microsoft.NET.Sdk.Functions.Generator.dll "C:\dev\repos\Eruza\CS.Eruza\src\CS.Eruza.Functions.Administrator\bin\D


for me it was the function app configuration on azure that needed to be upgraded. I had to set the runtime to 3 in the settings. See picture.

Currently the highest recommended version is NET Standard 1.3. If you target .NET Standard 2.0 it will be impossible for you to deploy the correct set of framework assemblies to consumers of the analyser as they need different versions depending on whether they are running on .NET Framework 4.6, 4.6.1, 4.7.0 or 4.7.1.


My project file target netcoreapp3.1 with Microsoft.NET.Sdk.Functions 3.0.3 based on a template gave a similar error. Removing azure-functions-core-tools and installing a different version solved it for me.

npm uninstall azure-functions-core-tools
npm install azure-functions-core-tools@3 --unsafe-perm true

could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its assemblies visual studio 2017 version 15.7 windows 10.0 Mamman Abdulbasit reported Aug 18, 2018 at 03:43 AM


var assembly = AppDomain.CurrentDomain.Load(bytes); Switching down to netstandard 1.6 gives me a similar error, this time about System.Runtime (because mono.wasm expects Mono.Runtime I assume). Maybe there's a way to perform LoadAssembly on the assemblies referenced by the netstandard2.0 package, but I wouldn't know how.


9.4.0 DNN_Platform_9.4.0_Install. Haven't installed any extensions other than the install files above


When a T4 compile-time template references a netstandard 2.1 assembly, if the template's code tries to instantiate a class from that assembly it generates an error: Running transformation: System.IO.FileNotFoundException: Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies.