Unhandled Exception with Reporting Services
We have a custom .Net app with a custom security framework that utilizes SSRS 2005. We are in the process of upgrading to SSRS 2008 and are getting the following error when we load our app in a test environment. I've been all over Google, MSDN,
etc. and can't seem to find the solution. It did work at one point but we've not been able to replicate the success.
Could not load file or assembly 'Microsoft.ReportingServices.Diagnostics' 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 'Microsoft.ReportingServices.Diagnostics' 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 'Microsoft.ReportingServices.Diagnostics' could not be loaded.
=== Pre-bind state information ===
LOG: User = NT AUTHORITY\NETWORK SERVICE
LOG: DisplayName = Microsoft.ReportingServices.Diagnostics
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: Microsoft.ReportingServices.Diagnostics | 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:/Websites/XXXXXX/Code/Web/
LOG: Initial PrivatePath = C:\Websites\XXXXXX\Code\Web\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Websites\XXXXXX\Code\Web\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\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/95b99434/cf3889bc/Microsoft.ReportingServices.Diagnostics.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/95b99434/cf3889bc/Microsoft.ReportingServices.Diagnostics/Microsoft.ReportingServices.Diagnostics.DLL.
LOG: Attempting download of new URL file:///C:/Websites/XXXXXX/Code/Web/bin/Microsoft.ReportingServices.Diagnostics.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.
Stack Trace:
[BadImageFormatException: Could not load file or assembly 'Microsoft.ReportingServices.Diagnostics' 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, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +567
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +192
System.Reflection.Assembly.Load(String assemblyString) +35
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +118
[ConfigurationErrorsException: Could not load file or assembly 'Microsoft.ReportingServices.Diagnostics' 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) +11396867
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +484
System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +127
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +334
System.Web.Compilation.BuildManager.CallPreStartInitMethods() +280
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1087
[HttpException (0x80004005): Could not load file or assembly 'Microsoft.ReportingServices.Diagnostics' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11529072
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +11361390
March 12th, 2011 5:07am
Which file paths should I be looking for? For what files?
Free Windows Admin Tool Kit Click here and download it now
March 12th, 2011 5:17am
Hi Bill,
Based on the error information, it seemed that the file path was changed because of the upgrade. So, could you please try to upgrade to 2008 and then reconfigure the custom security on your reporting services? Meanwhile ensure that the program worked well
on 2008 platform.
thanks,
Jerry
March 12th, 2011 6:52am
Hi BillSinc,
Is this issue resolved? I am getting the same error. Can you help or post your solution?
Thanks,
Senthil
Free Windows Admin Tool Kit Click here and download it now
April 27th, 2011 4:51am
Sorry Senthil, I can't find the solution anywhere in my notes. I think it had something to do with updating file path locations in the config files. Have you fixed it yet?
May 2nd, 2011 2:18pm