ThinkTecture.IdentityModel "The type 'System.IdentityModel.Tokens.SecurityToken' is defined in an assembly that is not referenced - thinktecture-ident-model

I start using ThinkTecture.IdentityModel in my project and I am facing a serious issue. Please help me on the same.
Error 1 "The type 'System.IdentityModel.Tokens.SecurityToken' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

Try manually adding the System.IdentityModel dll reference from the assemblies. This is what worked for me.
-Right click project, add reference
-Assemblies, Framework, System.IdentityModel v4.0.0.0

Related

Could not load assembly System.Runtime in Xamarin.Forms UWP Project with .NET Standard library

I'm in the process of setting up a Xamarin.Forms app using .NET Standard for the shared library instead of a PCL. I've followed the instructions for doing so laid out here: https://channel9.msdn.com/Shows/XamarinShow/Snack-Pack-15-Upgrading-to-XamarinForms-to-NET-Standard
This is with a brand new Xamarin.Forms app, created using Visual Studio 2017 with a PCL, which was replaced with a .NET Standard library as described in the video.
The UWP app compiles fine, but throws this exception when I try to start it (on the call to Xamarin.Forms.Forms.Init)
System.IO.FileLoadException: 'Could not load file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)'
I've tried specifically adding the nuget package for System.Runtime, version 4.1.0 to the UWP project, but that doesn't seem to help. It runs fine in Android, but keeps giving me this exception running the UWP project. Can anyone tell me what might be causing this and how I can fix it?
edit:
there is a very similar error in the build log:
Could not resolve this reference. Could not locate the assembly "System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
Followed by an extremely long list of places it has checked.
I also found this, which seems like it may be the problem:
2> There was a conflict between "System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
2> "System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was chosen because it was primary and "System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was not.
Does anyone know how I can resolve this conflict?
edit 2:
There's also this in the build logs right after the above, which is even more perplexing, as it seems to indicate the only thing referencing version 4.0.20.0 of System.Runtime is... version 4.3.0 of System.Runtime???
2> References which depend on "System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [C:\Users\Katie.nuget\packages\system.runtime\4.3.0\ref\netcore50\System.Runtime.dll].
2> C:\Users\Katie.nuget\packages\system.runtime\4.3.0\ref\netcore50\System.Runtime.dll
2> Project file item includes which caused reference "C:\Users\Katie.nuget\packages\system.runtime\4.3.0\ref\netcore50\System.Runtime.dll".
2> C:\Users\Katie.nuget\packages\system.runtime\4.3.0\ref\netcore50\System.Runtime.dll

RandomSiteControls, Version=7.1.5200.1, uses Telerik.Sitefinity which has a higher version than referenced assembly Telerik.Sitefinity

I m getting following error while trying to add RandomSiteControls to my project.How to fix below error?
" CS1705: Assembly 'RandomSiteControls, Version=7.1.5200.1, Culture=neutral, PublicKeyToken=null' uses 'Telerik.Sitefinity, Version=7.1.5202.0, Culture=neutral, PublicKeyToken=b28c218413bdf563' which has a higher version than referenced assembly 'Telerik.Sitefinity, Version=7.1.5200.0, Culture=neutral, PublicKeyToken=b28c218413bdf563' "
I am using sitefinity version 7.1.5200.0
To get rid of the errors, you can either add some assembly bindings to your web.config or download a different version of the RamdonSiteControls that was built against those particular Sitefinity dlls.
You can find the version for 7.1.5200 here.

ASP.NET - How to remove Newtonsoft.Json dependency

I added the reference file "Newtonsoft.Json.dll" to my project. After a while, I decided to remove the reference from References section of project. Projects started to give following error :
Exception Details: System.IO.FileLoadException: Could not load file or
assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral,
PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The
located assembly's manifest definition does not match the assembly
reference. (Exception from HRESULT: 0x80131040)
I tried everything. I searched any words with "Newtonsoft" in the project and delete all of them. But nothing changes. I am getting still this error. Can anyone help me? How can I remove this reference forever ?
I found the solution. The project requires "Newtonsoft.Json, Version=4.5.0.0", But I realized that I load the "Newtonsoft.Json, Version=6.0.0.0" version. After I add v6 dll file to project, the problem solved. Thanks for your responses.

Could not load file or assembly 'Autofac, Version=3.0.0.0

I am trying to connect enFinder file manager to my asp.net project with this connector. I added Autofac Version 3. Afterwards I removed the reference and added a reference to Autofac 2.6. Now the following error occurs:
Could not load file or assembly 'Autofac, Version=3.0.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
How can I fix this problem?
Delete all Autofac references in your project and add them again, using the correct Autofac DLL. The mismatch occurs when the reference you've added to your project via the Add Reference menu is not the same version as the actual file. This happens when you exchange the physical DLL file on your disk to which the reference in your project points.

Could not load file or assembly

I am working on a project in asp.net using Telerik Controls.
Everytime when i run my project i am getting the following error:
Could not load file or assembly
'Microsoft.Practices.EnterpriseLibrary.Configuration.Design,
Version=3.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its
dependencies.
The located assembly's manifest definition does not match the
assembly reference. (Exception from HRESULT: 0x80131040)
But when I refresh the page, its working fine. Why I am getting this error?
Thanks
This error occurs when the manifest definition of the assembly file doesn't match the actual reference.
See here for more info:
The located assembly's manifest definition does not match the assembly reference
http://blogs.msdn.com/b/junfeng/archive/2004/03/25/95826.aspx
You could try changing the reference version from Version=3.1.0.0 to Version=3.1.0.1, or another version if you might know it.

Resources