1
votes

I cloned an application from git repository, the application build without errors and warnings, but when I run the application, I get the following error: Error 500 : System.TypeLoadException Could not load type of field 'Microsoft.Owin.Security.ActiveDirectory.WsFedMetadataRetriever:CS$<>9__CachedAnonymousMethodDelegate5' (1) due to: Could not resolve type with token 01000045 (from typeref, class/assembly System.IdentityModel.Metadata.KeyDescriptor, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) assembly:System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 type:System.IdentityModel.Metadata.KeyDescriptor member:(null) signature:

I attempted to resolve the issue by adding the following to the web.config file:

 <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" />
      </dependentAssembly>
    <dependentAssembly>

...but I still get the error; I'm using Visual Studio Community 2017 for Mac. Could I get some help please?

1
Do you see problems with the dependencies listed in the project? I suspect you are missing a library or have an outdated library.sean

1 Answers

0
votes

I updated all the Nuget Packages, and Installed Microsoft.ApplicationInsights.AspNetCore It worked for me