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!
Related
I'm hosting a website on Azure, and it's been working fine for the past few months. I'm using a devops build/release pipeline for CI, which works great as well.
This morning, my website went down with a 502.5 error - Process Failure without any recent changes or commits to the solution.
I've tried restarting it, I've tried debugging it through Azure.
I ended up trying to use dotnet .[app name here] in the console in Azure, which gave the following error:
Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.AspNetCore.Server.IISIntegration, Version=2.1.7.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at Microsoft.AspNetCore.WebHost.CreateDefaultBuilder(String[] args)
at InventoryManagementGalten.Program.CreateWebHostBuilder(String[] args) in D:\a\1\s\InventoryManagementGalten\Program.cs:line 14
at InventoryManagementGalten.Program.Main(String[] args) in D:\a\1\s\InventoryManagementGalten\Program.cs:line 10
which sounds like a version mismatch - although I'm not sure where or how to fix it.
Any ideas are much appreciated!
Update: When I go into application logs, this is the first error that randomly appeared in the middle of the night:
Application: dotnet.exe
CoreCLR Version: 4.6.27129.4
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.AspNetCore.Server.IISIntegration, Version=2.1.7.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at Microsoft.AspNetCore.WebHost.CreateDefaultBuilder(String[] args)
at InventoryManagementGalten.Program.CreateWebHostBuilder(String[] args) in D:\a\1\s\InventoryManagementGalten\Program.cs:line 14
at InventoryManagementGalten.Program.Main(String[] args) in D:\a\1\s\InventoryManagementGalten\Program.cs:line 10
Edit:
Solved, read comment below.
The nuget package Microsoft.AspNetCore.Server.IISIntegration was listed with Version 2.1.7, but I was using 2.2 in my project.
I changed the project to use 2.1.7 for now, but I'll have to look into how I upgrade it in the future.
I've got a project which has a Portable Class Library as "back-end" and a Universal Windows app for "front-end". Here is my repo at GitHub: huming2207/Rmiter
My target settings for the PCL library is "portable46-net451+win81", also the screenshot shows below:
When running the app it stuck at the beginning, showing a System.IO.FileLoadException from the backend PCL library, as below:
System.IO.FileLoadException: 'Could not load file or assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)'
...and here is the screenshot (in case if someone misunderstand my words):
But meanwhile I can see there was a "System.Runtime.dll" loaded when the app starts. But why it still throw exceptions later on?
I've searched and checked for quite a lot of similar issues and workarounds. But it seems that neither of them help at all.
I am getting an error while running a .Net application.
The main problem which I feel is due to the Oracle.Data.Access.I made the project build to 32 bit as it had some problem of oracle exception
"Could not load file or assembly 'Oracle.DataAccess,
Version=2.111.7.20, Culture=neutral, PublicKeyToken=89b483f429c47342'
or one of its dependencies. The system cannot find the file specified"
Making my project to 32 bit actually solved this Oracle problem, but then the following error is thrown:
((System.IO.FileNotFoundException)(the specified module could not be
found. (Exception from HRESULT: 0x8007007E)
I am actually trying to write to a file in the function from where the exception is being thrown.The file location is defined in app.config
Is this error due to 32 or 64 bit as my Windows 7 version is 64 bit and the project is built using 32 bit or something else
Please suggest a possible outcome of this error
The first error suggests the assembly (dll) Oracle.DataAccess is not found in your /BIN folder. If it is there please check the version, your application is expecting version: 2.111.7.20, you might be using another version.
Could not load file or assembly 'Oracle.DataAccess, Version=2.111.7.20, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified
The second error might be thrown because the Oracle.DataAcces it is 64-bit and your application is now running in 32-bit.
I have a website written in VS2010 that uses a web reference to a service that uses EnterpriseLibrary 5.0.414.0.
When i worked with VS2010 everything was ok, but once i opened it with VS2012 RTM i started getting the following error (i get the same error when i open the project in VS2010 too)
Reference.svcmap: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.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)
Please advice.
This can happen if you are missing the other enterprise library blocks needed by the mentioned assembly (and copy local true as well), which are:
Microsoft.Practices.EnterpriseLibrary.Common.dll
Microsoft.Practices.ServiceLocation.dll
Microsoft.Practices.Unity.Configuration.dll
Microsoft.Practices.Unity.dll
Microsoft.Practices.Unity.Interception.Configuration.dll
Microsoft.Practices.Unity.Interception.dll
Occasionally I have problems with applications which rely on unmanaged .dll's throwing exceptions which look like:
System.IO.FileLoadException: Could not load file or assembly 'AssemblyXXXX, Version=1.0.4099.27218, Culture=neutral, PublicKeyToken=null' or one of its dependencies. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)
File name: 'AssemblyXXXX, Version=1.0.4099.27218, Culture=neutral, PublicKeyToken=null' ---> System.Runtime.InteropServices.COMException (0x800736B1): This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)
The main problem is, that it does not say which dll could not be loaded, or which COM object is not registered.
Are there any tools that help track down this problem?
Fuslogvw shows you details of assembly loading errors. However, I'm guess that it's a COM
problem.
Try loading each of the COM dependencies dynamically (maybe in a different program, and maybe using their progid) using Type.GetTypeFromProgID and Activator.CreateInstance, and catching each error individually.
In the past, I've seen this error when there are different (older) versions of Office installed on user's machines.