Could not load file or assembly 'Microsoft.VisualStudio.Shell, Version=2.0.0.0 - .net-assembly

I recently updated a website from VS2008 to VS2010. Publish with Web Deploy tool but I get the following error
Server Error in '/' Application. Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: Reference.svcmap: Could not load file or assembly 'Microsoft.VisualStudio.Shell, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Source Error: [No relevant source lines] Source File: /App_WebReferences/websConsultarCOVE/ Line: 1 Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.VisualStudio.Shell, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' could not be loaded. WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18010
The error is in reference to a third party webservices
OS: Windows Server 2012
Thank you very much in advance

Related

Error while try to test app on physical device

When I run the App in a simulator it works perfect, but when I try to deploy the App on my physical device it shows the following error:
(Can't resolve the reference
'System.Void MaterialComponents.Card::SetShadowElevation(System.Double,UIKit.UIControlState)',
referenced from the method 'System.Void Xamarin.Forms.Platform.iOS.Material.MaterialFrameRenderer::SetupLayer()' in
'MaterialComponents, Version=1.0.6836.23950, Culture=neutral, PublicKeyToken=null'. (MT2101) (Yucaz.Mobile.iOS))

Web service giving "could not load file or assembly error"

I just moved a website and related web service from IIS6 to 8.
The website works fine, but the webservice is giving the following error:
Server Error in '/CreditCardService' Application.
Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
The web service config file do not have any related lines in it.
Only the website web.config has any related lines in it, see below.
<add assembly="System.Web.Mvc, Version=3.0.0.1, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Any ideas how to resolve this?

assemblies not being included when deploying Azure webjobs

I have 3 files
MyWebJob.exe
MyClassLibraryProject.dll
3rdPartyLib.dll (vc++)
I zipped them and uploded it to web job, but I got error below.
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'MyClassLibraryProject.dll' or one of its dependencies. The specified module could not be found.
How to fix it , thanks!

Azure Diagnostics is looking for StorageClient 1.7.0.0, but I'm using StorageClient 1.7.1.0

I'm using the Microsoft.WindowsAzure.StorageClient version 1.7.1.0 available at: https://github.com/WindowsAzure/azure-sdk-for-net/tree/sdk_1.7.1. My project compiles just fine, but when I run it I get the following error:
Could not create Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
with an inner exception of:
Could not load file or assembly 'Microsoft.WindowsAzure.StorageClient, 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)":"Microsoft.WindowsAzure.StorageClient, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
I looks like there is a dependency in Microsoft.WindowsAzure.Diagnostics on version 1.7.0.0 of Microsoft.WindowsAzure.StorageClient. However I am using version 1.7.1.0, and as far as I know I can't have both 1.7.0 and 1.7.1 in the same project. Any ideas how to make Microsoft.WindowsAzure.Diagnostics dependent on 1.7.1 if this is indeed the problem?
Thanks, Kurt
Update
As per recommendation below I added s startup task to load the version 1.7.0 using gacutil (this was useful http://blogs.infosupport.com/adding-assemblies-to-the-gac-in-windows-azure/). I have 2 WorkerRoles and 2 WebRoles. The problem I have now is that when I compile and run, VS2012 copies the 1.7.0 into the WebRoles' respective ...\csx\Debug\roles[WebRoleName]\approot folder, despite there being no direct reference to version 1.7.0 in the project. The following compile output shows the error this introduces when Azure attempts to load verison 1.7.1 (which it now can't find):
System.TypeLoadException: Unable to load the role entry point due to the following exceptions:
-- System.IO.FileLoadException: Could not load file or assembly 'Microsoft.WindowsAzure.StorageClient, Version=1.7.1.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)
File name: 'Microsoft.WindowsAzure.StorageClient, Version=1.7.1.0, Culture=neutral, PublicKeyToken=null'
=== Pre-bind state information ===
LOG: User = BERTIES_MAIN\kurt_000
LOG: DisplayName = Microsoft.WindowsAzure.StorageClient, Version=1.7.1.0, Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///H:/Everything/Current_Work/Web_Apps/Azure/InSysCloud/InSysCloud/InSysCloud/csx/Debug/roles/InSysWatcher/approot
LOG: Initial PrivatePath = H:\Everything\Current_Work\Web_Apps\Azure\InSysCloud\InSysCloud\InSysCloud\csx\Debug\roles\InSysWatcher\approot
Calling assembly : InSysWatcher, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: H:\Everything\Current_Work\Web_Apps\Azure\InSysCloud\InSysCloud\InSysCloud\csx\Debug\roles\InSysWatcher\approot\InSysWatcher.dll.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///H:/Everything/Current_Work/Web_Apps/Azure/InSysCloud/InSysCloud/InSysCloud/csx/Debug/roles/InSysWatcher/approot/Microsoft.WindowsAzure.StorageClient.DLL.
WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
Why would VS2012 be adding the DLL for version 1.7.0, when 1.7.1 is referenced in the project itself, and version 1.7.0 is only included as content, and loaded into the GAC at app startup?
Well, in such cases you would use a binding redirect in the web.config/app.config. But the problem is the PublicKeyToken. The 'official' assembly 1.7.0.0 has the following PublicKeyToken: 31bf3856ad364e35.
Now, since you're building the 1.7.1.0 version yourself you'll end up with a different PublicKeyToken and in that case the binding redirect does not work.
But the GAC was built for this, to support multiple versions of an assembly. What I would suggest is the following:
Include the 1.7.0.0 assembly in your package, but add it as content (not as reference).
Create a startup task that deploys the assembly to the GAC (using gacutil), since the task will run before starting your role.
Keep using 1.7.1.0 with a normal assembly reference.
Your app should use 1.7.1.0 for your code, and the diagnostics assembly should be able to use version 1.7.0.0 from the GAC
I didn't have a chance to test this yet so I'm looking forword to your feedback.
It appears I can add the following reference into my web.config to work-around this problem:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.StorageClient"
publicKeyToken="31bf3856ad364e35"
culture="neutral" />
<bindingRedirect oldVersion="1.1.0.0"
newVersion="1.7.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.StorageClient"
publicKeyToken="31bf3856ad364e35"
culture="neutral" />
<publisherPolicy apply="no" />
</dependentAssembly>
</assemblyBinding>
</runtime>
This essentially allows the references to v1.1 of the dll to be re-mapped to 1.7.

Moving to new server = error

I have a pretty standard Sitecore site (no extra assemblies etc., just some layouts and xslt files). The site is working fine on my own server (old w2003 w/iis6). The site now needs to be moved to a new server (w2008 w/iis7). But the site fails to lad, giving this error;
Could not load file or assembly 'System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
In the following line in the web.config
Line 3176: <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Any ideas as to what could be wrong? I dont have access to the server myself, but have just been sent a link to the site, where i can see the above error.
It seems that you have MVC dependencies you also have to deploy to a new server. This thread might be helpful.

Resources