MVC 4 Web Api Build in x64 mode giving error while executing "Could not load file or assembly 'xxx' or one of its dependencies - asp.net-mvc-4

My MVC4 Web Api application is working fine when it is build in Any Cpu mode.In this mode it is creating 32 bit dll. However when I build the application in x64 mode then while executing it is giving following error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Could not load file or assembly 'CoreService' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.BadImageFormatException: Could not load file or assembly 'CoreService' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'CoreService' could not be loaded.
=== Pre-bind state information ===
LOG: User = xxx
LOG: DisplayName = CoreService
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: CoreService | Domain ID: 3
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///D:/StartFromScratch/src/CoreService/
LOG: Initial PrivatePath = D:\StartFromScratch\src\CoreService\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\StartFromScratch\src\CoreService\web.config
LOG: Using host configuration file: C:\Users\310138409\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\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:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/a4e7fe2c/87c2ced5/CoreService.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/a4e7fe2c/87c2ced5/CoreService/CoreService.DLL.
LOG: Attempting download of new URL file:///D:/StartFromScratch/src/CoreService/bin/CoreService.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.
Stack Trace:
[BadImageFormatException: Could not load file or assembly 'CoreService' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +34
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +16
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38
[ConfigurationErrorsException: Could not load file or assembly 'CoreService' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +752
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +218
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170
System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +91
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath) +258
System.Web.Compilation.BuildManager.ExecutePreAppStart() +135
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +516
[HttpException (0x80004005): Could not load file or assembly 'CoreService' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9874840
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18055
I am not getting any concrete solution for the same. Moreover we cannot continue in 32 bit mode as It is making call to 64 bit unmanaged code. Thanks in advance.

Actually problem is because of IISExpress. It is 32bit of IISExpress is running whenever we are executing from VS2012 IDE so it is giving incorrect format error. So once I installed the IISexpress 8.0 and done the registry entry to make sure that IISExpress 64 bit get executed from VS2012; my problem got resolved.

You should properly configure your solution configurations for x64 build. Right click on your solution in VS, select Configuration Manager select x64 under Active solution platforms drop down list and check whether all of your projects has built with x64 platform.

Related

Unable to start program C:\...\****.dll VB.net application Visual Studio 2015

I have been working on a VB.net web application for some time now, and I accidentally switched the "Application Type" setting from a Class Library to a Windows Form Application. I tried to build, this failed, but when I switched back, the program would no longer execute, displaying the error:
Unable to start program 'C:\Users\User\...\bin\Project.dll'
'C:\Users\User\...\bin\Project.dll' is not a valid Win32 application.
Prior to this the application would build fine.
Furthermore, in the properties page for the project, the "Web" section displays the error:
An error occurred trying to load the page.
Value does not fall within the expected range.
The build output offers no clues as to the unexpected behavior, it builds fine, it just won't run. The code is also fully functional.
I have tried restarting multiple times, deleting the /bin directory and allowing it to rebuild from scratch (then restoring the old contents when this failed), setting the startup project, changing the target CPU and debug/release mode. I have tried both ReSharper build, and Visual Studio build.
I also tried making a build configuration that targeted 'C:\Users\User...\bin\Project.vshost.exe', but this would execute then close immediately.
I have no option to set a "Startup Object" in the application page of the project settings, but this has never been an issue. I have never needed to target an EXE to run my application before. If I try other application types, it states "Sub Main was not found in project".
I cannot recreate the project due to it's size so would love it if anyone could offer some insight, next time I will be mindful not to play around with the IDE settings.
======= UPDATED =======
So I fixed the "not running issue" by changing the WebProjectProperties to:
<UseIIS>True</UseIIS>
<UseCustomServer>False</UseCustomServer>
<servers defaultServer="">
But now when I run the program, the following error is displayed:
Could not load file or assembly
'Microsoft.VisualStudio.QualityTools.UnitTestFramework (2)' or one of
its dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)
System.IO.FileLoadException: Could not load file or assembly
'Microsoft.VisualStudio.QualityTools.UnitTestFramework (2)' or one of
its dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)
Stack trace and details:
=== Pre-bind state information ===
LOG: DisplayName = Microsoft.VisualStudio.QualityTools.UnitTestFramework (2)
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: Microsoft.VisualStudio.QualityTools.UnitTestFramework (2) | Domain ID: 2
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Users/User/Source/Repos/Findem/IfitConsulting/
LOG: Initial PrivatePath = C:\Users\User\Source\Repos\Findem\IfitConsulting\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\User\Source\Repos\Findem\IfitConsulting\web.config
LOG: Using host configuration file: C:\Users\User\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\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:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/vs/0ef61219/b7128029/Microsoft.VisualStudio.QualityTools.UnitTestFramework (2).DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/vs/0ef61219/b7128029/Microsoft.VisualStudio.QualityTools.UnitTestFramework (2)/Microsoft.VisualStudio.QualityTools.UnitTestFramework (2).DLL.
LOG: Attempting download of new URL file:///C:/Users/User/Source/Repos/Findem/IfitConsulting/bin/Microsoft.VisualStudio.QualityTools.UnitTestFramework (2).DLL.
WRN: Comparing the assembly name resulted in the mismatch: NAME
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
Stack trace
[FileLoadException: Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.UnitTestFramework (2)' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +36
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +21
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38
[ConfigurationErrorsException: Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.UnitTestFramework (2)' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +738
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +217
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170
System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +92
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +290
System.Web.Compilation.BuildManager.ExecutePreAppStart() +157
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +531
[HttpException (0x80004005): Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.UnitTestFramework (2)' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9947380
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +261
Ok so finally figured out how to fix it, hopefully this can help some other poor soul who ends up in the same situation!
The first step is to edit your project.vbproj file and change:
<WebProjectProperties>
<UseIIS>False</UseIIS>
<UseCustomServer>True</UseCustomServer>
<servers defaultServer="SelfHostServer">
...
</servers>
</WebProjectProperties>
To
<WebProjectProperties>
<UseIIS>True</UseIIS>
<UseCustomServer>False</UseCustomServer>
<servers defaultServer="">
...
</servers>
</WebProjectProperties>
Then, you want to go to your /bin directory and delete the following files (Project is your projects name):
Project.dll
Project.dll.CodeAnalysisLog.xml
Project.dll.config
Project.dll.CodeAnalysisLog
Project.pdb
Project.xml
And re-build and it all works fine!

NServiceBus 3.3.5 "Could not load file or assembly" in subfolder

We use NServiceBus.Host.exe to host our service and the assembly for our endpoint is located in the same folder with NServiceBus.Host.exe. Under the main folder we have a subfolder containing assemblies that are needed for our processes handling the messages. The problem we have is that when NServiceBus.Host.exe loads it finds the assemblies from the subfolder but can't load them and crashes with an error:
Unhandled Exception: Magnum.StateMachine.StateMachineException: Exception occurred in Topshelf.Internal.ServiceController1[
[NServiceBus.Hosting.Windows.WindowsHost, NServiceBus.Host, Version=3.0.0.0, Culture=neutral, PublicKeyToken=9fc386479f8a226c]] during state Initial while handling OnStart ---> Microsoft.Practices.ServiceLocation.ActivationException: Activation error occured while trying to get instance of type WindowsHost, key "MyPoint.BusMessageEndPoint, MyPoint, Version=4.3.0.0, Culture=neutral, PublicKeyToken=null" ---> System.IO.FileNotFoundException: Could not load file or assembly 'MyAssembly, Version=4.3.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext()
at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at NServiceBus.Hosting.GenericHost..ctor(IConfigureThisEndpoint specifier, String[] args, IEnumerable1 defaultProfiles,String endpointName, IEnumerable1 scannableAssembliesFullName) in c:\NServiceBus-NServiceBus-3.3.5-0\src\hosting\NServiceBus.Hosting\GenericHost.cs:line 145 at NServiceBus.Hosting.Windows.WindowsHost..ctor(Type endpointType, String[] args, String endpointName, Boolean runOtherInstallers, Boolean runInfrastructureInstallers, IEnumerable1 scannableAssembliesFullName) in c:\NServiceBus-NServiceBus-3.3.5-0\src\hosting\NServiceBus.Hosting.Windows\WindowsHost.cs:line 31
at NServiceBus.Hosting.Windows.HostServiceLocator.DoGetInstance(Type serviceType, String key) in c:\NServiceBus-NServiceBus-3.3.5-0\src\hosting\NServiceBus.Hosting.Windows\HostServiceLocator.cs:line 41
at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key) in :line 0
It seems that the host finds the assemblies in some way but can't load them. I haven't found any way to tell the host not to look inside the subfolder. Everything works fine if I move the assemblies from the subfolder to the mainfolder (in the same folder where the NServiceBus.Host.exe is) but that makes our structure very untidy and this subfolder way worked just fine with NServiceBus 2.6 - now after upgrading to 3.3.5 we have a problem.
Is there some way to block subfolders from the hosts load - or if the host finds the assemblies in the subfolder why can't it load them? That would solve our problem too.
Many thanks if someone can help me with this.
I'll add my comments to the answers here, if I can clarify our case a bit. Thanks for the answers!
The assemblies in the subfolder are not needed to be loaded by NSericeBus.Host.exe - they are loaded from our message endpoint assembly (which is loaded by NServiceBus.Host) by using MEF.
In NServiceBus 2.6 the assemblies in the subfolder either were not loaded by NServiceBus.Host or it could handle them and now is not able to do so. The load crashes before I can affect what it loads. In debug the crash happens before the Configure.With() happens so I can't tell NServiceBus to dismiss the subfolder.
If you enable custom initialization via the IWantCustomInitialization interface, the .With() method has options to provide a specific directory or a list of assemblies or types.
You can't have those necessary assemblies in a subfolder. I wasn't aware that this worked in 2.6 but if so it was probably unintended. I do know that somewhere in there the method used to load assemblies was changed so that we could use Configure.With() in all instances and not have to decide between .With() and .WithWeb when self-hosting. Perhaps this is a side-effect of that change.
In any case, why does it matter if the main deployment directory is "untidy"? I would think this would just complicate deployment scenarios to try to make it look prettier and certainly wouldn't add any business value.

Create assembly in SQL Server

I keep getting the following error:
Msg 10314, Level 16, State 11, Line 1
An error occurred in the Microsoft .NET Framework while trying to load assembly id 66079. The server may be running out of resources, or the assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or UNSAFE. Run the query again, or check documentation to see how to solve the assembly trust issues. For more information about this error:
System.IO.FileLoadException: Could not load file or assembly 'ncestablegenerator, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
System.IO.FileLoadException:
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
This is the creation of my assembly:
CREATE ASSEMBLY [NCESTableGenerator]
AUTHORIZATION [dbo]
from 'C:\SqlDlls\NCESTableGenerator.dll'
WITH PERMISSION_SET = UNSAFE
GO
Any ideas? There is plenty of space on the server.
You need to set database trustworthy ON before you run that statement .

What would cause a 'could not load file or assembly' error concerning 'Microsoft.WindowsAzure.Configuration'?

I have a multi-tier Azure application I've been working on. It uses web and worker roles behind an MVC front end, as well as Azure SQL and Table storage. It has been working well for a while, both in the emulator and the cloud.
I've just started adding some Service Bus functionality to it, adding the Service Bus package from NuGet, and now I find that although everything still compiles, I am getting the following runtime error:
Server Error in '/' Application.
Could not load file or assembly 'Microsoft.WindowsAzure.Configuration' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.WindowsAzure.Configuration' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.WindowsAzure.Configuration' could not be loaded.
=== Pre-bind state information ===
LOG: User = JCFXLAPTOP\User
LOG: DisplayName = Microsoft.WindowsAzure.Configuration
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: Microsoft.WindowsAzure.Configuration | Domain ID: 2
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///D:/Work/CLIENTS/PageEngine/Solutions/PageEngine/Web.PageEngine/
LOG: Initial PrivatePath = D:\Work\CLIENTS\PageEngine\Solutions\PageEngine\Web.PageEngine\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\Work\CLIENTS\PageEngine\Solutions\PageEngine\Web.PageEngine\web.config
LOG: Using host configuration file: C:\Program Files\IIS Express\config\templates\PersonalWebServer\aspnet.config
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:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/4904ccbc/14659c77/Microsoft.WindowsAzure.Configuration.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/4904ccbc/14659c77/Microsoft.WindowsAzure.Configuration/Microsoft.WindowsAzure.Configuration.DLL.
LOG: Attempting download of new URL file:///D:/Work/CLIENTS/PageEngine/Solutions/PageEngine/Web.PageEngine/bin/Microsoft.WindowsAzure.Configuration.DLL.
LOG: Using application configuration file: D:\Work\CLIENTS\PageEngine\Solutions\PageEngine\Web.PageEngine\web.config
LOG: Using host configuration file: C:\Program Files\IIS Express\config\templates\PersonalWebServer\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.WindowsAzure.Configuration, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
ERR: Failed to complete setup of assembly (hr = 0x80131045). Probing terminated.
Stack Trace:
[FileLoadException: Could not load file or assembly 'Microsoft.WindowsAzure.Configuration' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)]
[FileLoadException: Could not load file or assembly 'Microsoft.WindowsAzure.Configuration, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +210
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +242
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +17
System.Reflection.Assembly.Load(String assemblyString) +35
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +122
[ConfigurationErrorsException: Could not load file or assembly 'Microsoft.WindowsAzure.Configuration, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +12731430
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +503
System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +142
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +334
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath) +203
System.Web.Compilation.BuildManager.ExecutePreAppStart() +152
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1151
[HttpException (0x80004005): Could not load file or assembly 'Microsoft.WindowsAzure.Configuration, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12847312
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12675965
I noticed that the ServiceBus NuGet package references a newer version of the Microsoft.WindowsAzure.Configuration dll (1.7.0.2), and wondered if that might be the cause. I've tried overriding this and changing all references to either 1.7.0.0 or 1.7.0.2 - neither change helped. I've also tried removing all Azure references from the solution and re-adding references by installing NuGet packages and referencing the latest SDK. This hasn't helped either.
I should add that at all times the Microsoft.WindowsAzure.Configuration dll has been in the bin folder of the MVC application, and that it has always had CopyLocal set to true.
I note that the Azure Configuration NuGet package was updated very recently (Friday 27th July), and I wonder if that might have something to do with it.
Does anybody know what the issue could be?
EDIT
Just to confirm that removing the service bus nuget package fixes the problem. Reinstating it causes the problem to recur. I don't know if this matters but the Microsoft.WindowsAzure.Configuration dll added as part of the NuGet package seems to have an inconsistent version number. While the path suggests the version should be 1.7.0.2:
D:\Work\CLIENTS\PageEngine\Solutions\PageEngine\packages\Microsoft.WindowsAzure.ConfigurationManager.1.7.0.2\lib\net35-full\Microsoft.WindowsAzure.Configuration.dll
... the version number in the properties inspector is still 1.7.0.0
This was an issue with the Microsoft.WindowsAzure.Configuration assembly, version 1.7.0.2
Temporarily fixed by rolling back to either 1.7.0.1 or 1.7.0.0 and then permanently fixed in 1.7.0.3
Had same problem. I reverted Microsoft.WindowsAzure.ConfigurationManager back to NuGet version 1.7.0.1. Now it is working OK.

Reporting Services 2005 configuration

I need help with configuring Reporting Services.
I have the ReportServer and Report Manager running successfully under a virtual website and under their own virtual directories (Reports and ReportServer) on port 80.
I then tried to set up another virtual website running on port 1001 with the same virtual directory names I am able to access the Report Server fine under port 1001 but when I try and access the Report Manager I get a Server error. I have used Reporting Services Configuration to create the virtual directories for ReportServer and Report Manager and all looks fine within it. The error I get when accessing Report Manager is as below:
Server Error in '/Reports' Application.
--------------------------------------------------------------------------------
Could not load file or assembly 'ReportingServicesWebServer' or one of its dependencies. The system cannot find the file specified.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'ReportingServicesWebServer' or one of its dependencies. The system cannot find the file specified.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'ReportingServicesWebServer' 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].
Stack Trace:
[FileNotFoundException: Could not load file or assembly 'ReportingServicesWebServer' or one of its dependencies. The system cannot find the file specified.]
System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +127
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +142
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46
[ConfigurationErrorsException: Could not load file or assembly 'ReportingServicesWebServer' or one of its dependencies. The system cannot find the file specified.]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +613
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +57
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +54
System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) +227
System.Web.Compilation.BuildManager.CompileGlobalAsax() +52
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +337
[HttpException (0x80004005): Could not load file or assembly 'ReportingServicesWebServer' or one of its dependencies. The system cannot find the file specified.]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +58
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +512
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +729
[HttpException (0x80004005): Could not load file or assembly 'ReportingServicesWebServer' or one of its dependencies. The system cannot find the file specified.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8890735
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +259
Does anyone know why this could be happening? Thanks a lot.
see this http://technet.microsoft.com/en-us/sqlserver/dd391734.aspx