简体   繁体   中英

App crash on windows 10 mobile

This exception occurs when i try to load my app on my device (lumia 950).

An exception of type 'System.IO.FileLoadException' occurred in Template10Library.DLL but was not handled in user code

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

The environment : I'm using Template10 as a git submodule in my project instead of as a nuget package. I also have 2 other 'Class Library' projects and 1 'Windows Runtime Component' projects in my solution that my app depends on.

I'm a bit out of my depth here, I'm pretty new to app development and I have no clear understanding on the particulars of the windows build/deploy/runtime environment so I don't really know where to start.

I know you probably require more information in order to help me, so just ask and I'll try to get back to you.

Edit:

I added the following code in my app so that it ran before I got the exception above.

try
{
    var assm = Assembly.Load(new AssemblyName("System.Threading"));
}
catch(Exception e)
{
    System.Diagnostics.Debugger.Break();
}

By pausing the debugger at var assm ... I got the following information from the loaded assembly:

Fullname: "System.Threading, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

ImageRuntimeVersion: "v4.0.30319"

Location: "C:\\windows\\system32\\SYSTEM.THREADING.NI.DLL"

So what does this mean? That my phone have older versions of system dll's? But why does my app require 4.0.10 when 4.0.0 should suffice?

EDIT 2:

I created a new blank app and a similar problem occured but this time with no library dependencies and this time I tried to use 'System.Net.Http.HttpClient' and I got the following exception:

An exception of type 'System.IO.FileLoadException' occurred in App1.exe but was not handled in user code

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

I'm running OS build 10.0.10586.0 but I'm starting to consider that there is something wrong with my device.

Apparently my visual studio installation was messed up... so I did a complete reinstallation of the entire OS, and now it (and my apps) works properly.

Thank you Alan Yao for your input!

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM