简体   繁体   中英

FileNotFoundException - Could not load file or assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

I'm starting to work with the Windows Phone 8.1 SDK. I want to use it in conjunction with an external C# library (mtgdb.info). I installed mtgdb.info to my solution using the package manager and added appropriate using statements when I called methods from the library.

The solution builds without errors or warnings, but when I try to debug the code I get the error listed in the title on the first line that calls a method in the external library. Installing the mtgdb.info nuget package is the first change I've made to the solution after creating it.

The mtgdb.info.dll is referenced in every project of my solution as well as its dependent dll (newtonsoft.json)

Any thoughts on why the solution wouldn't be able to find the assembly at runtime? Are there any good resources on how assemblies are located for Windows Phone applications?

most of the time, this problem appears on x64 machines.

Go to Properties in your project, then go on "Build". I Guess "platform target' is set on "Any CPU"

try to put x86 and see if you still have the problem.

Reason is that, when you let "any CPU" on a x64 machine, Runtime will try to find the x64 release of the dll

But if the dll has been compiled for x86 only, Runtime don't find it.

EDIT : my bad, i didn't saw first that it was regarding System assembly. Did you install Framework 4.5 ? if not do it, or In : project => properties => Application => Target Framework : change to a lower value. Anyway i'm surprise you get that error !

PS : With "System" assembly, you can keep "ANY CPU", Microsoft compiled it for 64 & 86 machines of course ;)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

Related Question Could not load file or assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies Could not load file or assembly 'System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies Could not load file or assembly 'System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies How to resolve Could not load type 'System.ValueTuple`3' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'? Could not load file or assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' Could not load file or assembly 'EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' 'System.Security.Principal.WindowsImpersonationContext' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' Module 'System.Data.Linq' Version=4.0.0.0, Culture=neutral, Publickeytoken=b77a5c561934e089' should be referenced 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed Type 'System.Data.DataRow' in Assembly 'System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM