I have a ASP.Net application which references an assembly with some re-usable code (common utils, data access, etc.). The assembly references IBM.Data.DB2.dll. However, I am not using DB2 in my application, the IBM.Data.DB2.dll is simply a dependency (in case an app needs to connect to DB2). Recently, i've run into the following error:
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.ReportingServices.Interfaces, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.ReportingServices.Interfaces, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at Unity.AutoRegistration.AutoRegistration.<ApplyAutoRegistration>b__5(Assembly a)
at System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at Unity.AutoRegistration.AutoRegistration.ApplyAutoRegistration()
The only file in the entire application that contains Microsoft.ReportingServices.Interfaces is the IBM.Data.DB2.dll file. I do not have any need of SQL Server or the overhead of a SQL Server installation locally much less on the server when the app is deployed. Bear in mind I am required to use the assembly which has the dependency on IBM.Data.DB2.dll and this error has not happened in the past, it seems to be recent.
I have tried binding redirects, installed Microsoft.ReportingServices.Interfaces via Nuget all to no avail.
Would anyone know why this error is occurring and more importantly....how to resolve it?
If IBM.Data.DB2.dll references Microsoft.ReportingServices.Interfaces, you will probably have to manually copy Microsoft.ReportingServices.Interfaces.dll into your bin folder. Here is a post that can help you with that:
Microsoft.ReportingServices.Interfaces.dll missing for SSRS 2005
Related
i developed my application using visual studio 2013, then deployed to a window server, current the server has been upgraded to windows server 2022 and my application is breaking and get getting this error:
"Could not load file or assembly 'System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified."
I know its a compatibility issue but hat is the fastest remedy to this.
try putting copy local= true in each DDL's properties that say "Could not load file or assembly"
when I upload the website on the host below error accrue I don't have any problem in localhost but when I upload it on a host this error accrues:
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.SqlServer.SqlEnum, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
Source Error:
[No relevant source lines]
Source File: /App_WebReferences/XMLForSMSServiceReference1/ Line: 1
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.SqlServer.SqlEnum, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' could not be loaded.
what should I do?
Best Regards
Neda
Possible duplicate of : C# SMO and SqlEnum references error
Short answer is the binaries you are deploying on to target server are missing referenced binaries (I am guessing the Sql server SMO library).
When you deploy a project to the destination you have to ensure the destination has the shared components (such as SQL SMO) already installed there, if not you have to include such shared binaries through your msi/deployment.
In your case there are two possible workarounds depending upon how you want to achieve it.
Create the msi and include all binaries (including the once those go in global cache - strongly signed libraries) - this is the more sensible way of handling standard deployment scenarios.
Only deploy your project binaries but ensure the referenced packages are already installed on destination.
I have an MVC app that pulls data from hosted TFS, and when I deploy it I get this error
Could not load type 'Microsoft.TeamFoundation.Client.BasicAuthCredential' from assembly 'Microsoft.TeamFoundation.Client, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
However, I have Microsoft.TeamFoundation.Client referenced in the project and the dll is on the server.
Why would it not be able to load Client.BasicAuthCredential from the dll and how would I go about fixing it?
We've had similar issues and after we installed TFS object model this issue was resolved.
http://visualstudiogallery.msdn.microsoft.com/a37e19fb-3052-4fc9-bef7-4a4682069a75
I have an ASP.NET MVC 4 project that I need to update to use Lucene 3.0. I needed to manually set the framework to use .NET Framework 4.5 because I'm using the latest Windows Azure libraries which require this version. Everything is working, except when I add a new data model with the Entity Framework. I can successfully add a new data model with the Entity Framework. However, when I attempt to execute a basic stored procedure (it only executes a query), I get a runtime exception. The exception is:
System.Reflection.ReflectionTypeLoadException
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
When I look at the LoaderExceptions property, I see the following:
[0] {"Could not load file or assembly 'Lucene.Net, Version=2.9.4.1, Culture=neutral, PublicKeyToken=85089178b9ac3181' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"Lucene.Net, Version=2.9.4.1, Culture=neutral, PublicKeyToken=85089178b9ac3181"} System.Exception {System.IO.FileLoadException}
[1] {"Could not load file or assembly 'Lucene.Net, Version=2.9.4.1, Culture=neutral, PublicKeyToken=85089178b9ac3181' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"Lucene.Net, Version=2.9.4.1, Culture=neutral, PublicKeyToken=85089178b9ac3181"} System.Exception {System.IO.FileLoadException}
The oddity is, I can't find a single reference to Lucene.Net version 2.9.4.1 anywhere. I do reference the 3.0.3.0 version of Lucene.Net in my app. Can someone tell me where the 2.9.4.1 version of the file would be referenced? I've looked in the following locations:
MyProject.csproj
Web.config
Global.asax.cs
packages.config
How do I fix this? I've been beating my head on this for 2 days. Its so bizarre. Thank you so much for any help that can be provided.
I know not exactly an answer to the question, but if it truely does stump you (and you're lucky enough that the two versions are compatibly) you can redirect any requests for 2.9.4.1 to the version you do have by adding a binding redirect to your config file.
see : http://msdn.microsoft.com/en-us/library/433ysdt1.aspx
I have 3 assemblies, a WP7 app (targeting 7.0), a Web Services project (running 4.0), and a Portable Class Library (built from the template & targeting WP7, SL4 & .NET 4.0) which contains a common type used between the first two.
When run locally (in IIS Express) things work just fine, however when run against a deployed instance of the Web Services assembly (on a remote IIS server I have little control of) fails with the following exception:
System.IO.FileNotFoundException: Could not load file or assembly
'System.Xml.Serialization, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' or one of its dependencies. The
system cannot find the file specified. File name:
'System.Xml.Serialization, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' ---> System.IO.FileNotFoundException:
Could not load file or assembly 'System.Xml.Serialization,
Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35,
Retargetable=Yes' or one of its dependencies. The system cannot find
the file specified. File name: 'System.Xml.Serialization,
Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35,
Retargetable=Yes'
The stacktrace indicates that it is on the first call into the PCL, which would make sense if it's a type load failure like above.
If I remove the reference to the PCL assembly and then add the key class file to both assemblies, things work fine, however I want to avoid this kind of code duplication... so the question is: Why is this happening? How can I configure the PCL to function as written?
EDIT: A little more information... my PCL uses XmlSerializer, something that lives in System.Xml.dll on the desktop, and in System.Xml.Serialization.xml in Silverlight... an assembly that doesn't exist under the full desktop framework... so this failure makes some sense, only in the PCL world, some of these assemblies/classes are broken out on their own
In this case, XmlSerializer actually lives in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable\v4.0\Profile\Profile2\System.Xml.Serialization.dll (which is referenced by the PCL)... as a test I added the same reference to the Web Project... however at runtime of the web project, it fails with yellow screen of death stating that:
Could not load file or assembly 'System.Xml.Serialization' or one of
its dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)
You will need to install KB2468871 on the remote server. It's a GDR that has been pushed to most client machines - however, servers will need to opt into it (they typically don't automatically install updates).