I've created a web application in C#. It uses version 2.3. of the Azure SDK and when I run the app locally using the Azure Emulator it works okay. When I package and deploy to the Azure cloud I get the following exception when start page is trying to load:
Could not load file or assembly 'Microsoft.WindowsAzure.ServiceRuntime, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I've looked in all my config files but none of them reference Microsoft.WindowsAzure.ServiceRuntime version 2.2.0.0. Is there something else I should be looking out for?
One of your dependent DLLs (ie. something you have referenced in your role entry point DLL) is referencing the 2.2 version of the service runtime. If you aren't able to find the dependent DLL then there are a few different ways to troubleshoot this. Intellitrace is the easiest, and direct debugging on the Azure VM is the most powerful. See http://blogs.msdn.com/b/kwill/archive/2013/10/03/troubleshooting-scenario-7-role-recycling.aspx for a walkthrough of both options.
Related
I have a solution which runs pretty nice on 2 machines, but when I try to deploy same solution on specific machine which runs Windows Server 2012(irrelevant because another two instances also run on Windows Server 2012) it keep me throwing:
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've checked all my dependencies and they seem to be ok, may it be something with ASP.NET on machine?
*All my project use Newtonsoft.Json, Version=9.0.1
Newtonsoft.Json is not part of .Net framework. You need to provide it yourself.
The exception you see means either:
Newtonsoft.json.dll is not part of your deployment and 2 machines where your solution works have this dll somehow installed
You have 2 conflicting versions of this dll and the solution does not know which one to pick.
So first check that this dll is present in your bin folder. If not, put it there.
I've successfully referenced an assembly via Nuget and project.json that is a "Portable" assembly. All my code compiles in the Azure function, but when it's run I get:
Could not load file or assembly 'System.Net, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies. The system cannot find the file specified.
As I understand it this is the portable version of System.Net, and Azure only preinstalls the 4.6 version of System.Net.
How do I work around this?
This is caused by a bug that has been addressed on the current Azure Functions host milestone and will be deployed with the next release (likely towards the end of the week). You can find more information about the issue and the fix here: https://github.com/Azure/azure-webjobs-sdk-script/issues/478
In the meantime, a workaround would be to copy System.Net from the Framework folder into a bin folder, inside of your function's folder. The host will automatically resolve it as a private assembly.
This issue continues to be a problem. I see several similar posts but they are all now a couple of years old.
I have referenced Google Apis via Nuget and now I am, quite frankly, in "Nuget hell". First, a rant, why so many assemblies and references when you use Nuget, what is the purpose of the .NET Framework? For example, why do I see a copy of System.IO DLL in my /bin folder?
I struggled for awhile just to get my website to run any of my code. After I upgraded all of my assemblies to 4.0, and after I ran updates on my local .Net install running on Windows 8.1, I have my local dev website working again.
When I call any page on my site that calls the Google drive assembly code, I get this error:
Could not load file or assembly 'System.Net.Http.Primitives,
Version=1.5.0.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've been round and round with the suggestions to map assemblies from this post: Google Drive SDK System.Net.Http.Primitives Version 1.5.0.0 instead of 2.1.10.0
And either it doesn't work, or I do not have the correct assembly mappings. I'm really at a loss.
I have compiled my Google Drive code and assembly separate of my web application assemblie(s). My Google Drive code is working perfect and I only have an issue when I try to reference this project from my web application.
I can't find any additional tips here or from Google. I am stuck.
The application was recently upgraded from Azure SDK 1.7 to 2.0 along with a bunch of other changes.
It spent a month in testing (hosted on Azure as it is on Live) and was all fine. We then released it Live where it was running for a few weeks with no problems, now out of the blue (no changes were made) I am getting this error when the web role is attempting to do stuff.
Could not load file or assembly 'Microsoft.WindowsAzure.ServiceRuntime, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I can not find a reference to 1.7 anywhere in the project (they all use 2.0, I have even opened each project file in txtpad and double checked the references.), I have tried to add a binding redirect but still get the same error. What really stumps me is how it worked for so long and then started doing this? The testing team are positive that it was working when it went through testing and released. Any hints on what else I could try to resolve the issue greatly appreciated.
EDIT: I remoted in and found this in the event log, The application '/' belonging to site '19369254' has an invalid AppPoolId '14f1780d-4dcb-48b5-88eb-8e59eda5aff8' set. Therefore, the application will be ignored. May have something to do with it?
I built a web application that uses the J# libraries which works fine in my cpu, however, when I deploy it to my shared server. I get an error message: Parser Error Message: Could not load file or assembly 'vjslib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
So basically, the server doesn't have visual j# installed. The problem is they wont install it because it is a shared server.
Is there a way I can deploy the J# assemblies with my project so that it will work on the shared server without it being registered in the GAC?
Thanks for your help!!
Simplest solution: Try to copy the assemblies your application needs into the same folder where your application resides.
The following MSDN article explains How the Runtime Locates Assemblies.
Also, you may find more options (including copying all J# related dlls into a subfolder of the application folder if needed) in the following link when the runtime cannot find the assembly in the GAC: Locating the Assembly through Codebases or Probing
Without knowing anything about J# I can only suggest that you try just distributing the required libraries along with your program (place them in the same directory), I believe if it can't find the library in the GAC it will revert to look in the current directory.