Using .NET Standard from .NET Framework web application fails with "Could not load file or assembly..."


I am trying to use .NET Standard libraries in .NET Framework ASP.NET web applications, and I frequently encounter errors relating to type loading. I have reproduced the problem as follows:

I have built a bare-bones .NET Standard 2.0 library with a single class:

namespace VTLib
    public class VTMaker
        public (int, string) GetVT()
            return (3, "value");

I have referenced this library as a project reference in a console application and a ASP.NET MVC application, both .NET Framework v4.6.2. Both projects instantiate the class and call GetVT().

The console application works fine.

The web application does not, and I receive the following error:

Could not load file or assembly 'System.ValueTuple, Version=, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Checking my the web application/bin folder, I find that the following .dlls:

/bin/System.ValueTuple.dll (, msil, .Net Framework v4.0) /bin/roslyn/System.ValueTuple.dll (, msil, .Net Framework v.4.6.2)

Using JetBrains dotPeek, I examine my web application .dll and my library .dll and glean the following:

  • The web application .dll references System.ValueTuple (, though the .csproj file includes no such reference.
  • The library .dll references netstandard ( as its single reference.

I find that I can "resolve" the issue by manually adding an assembly redirect instruction in the Web.config file:

    <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" />
    <bindingRedirect oldVersion="" newVersion="" />
asked on Stack Overflow Nov 2, 2018 by Sigurd Garshol • edited Nov 2, 2018 by Paul Karam

1 Answer


You need to add the reference to your ASP.NET web project as well. Transitive references are not supported in this kind of project as described in this answer.

Make sure that all dependencies from referenced packages are also added as reference to your ASP.NET MVC application, including System.ValueTuple

answered on Stack Overflow Nov 4, 2019 by MikeLimaSierra

User contributions licensed under CC BY-SA 3.0