We have an ASP.NET app with N number of projects. Two projects both reference a third party library - DocumentFormat.OpenXml.dll. One project - project A - references version 2.0.5022.0 of the library. Another project - project B - references version 2.5.5631.0 of the library. We get a build warning when the solution is built about the conflict between the two versions of the same DLL. Version 2.5.5631.0 is the version that ends up in the \bin directory.
At runtime, when I test the functionality provided by assembly A (built from project A) on an internal QA server, the functionality works. However, that's not what I expected. I expected to get a System.IO.FileLoadException error:
System.IO.FileLoadException: Could not load file or assembly 'DocumentFormat.OpenXml, Version=2.0.5022.0...
Note that there are no bindingRedirects for this DLL in the web.config file of the app.
The reason why this issue came to my attention is that we are in fact getting the System.IO.FileLoadException error message on a customer's server. I can't understand why we're not getting the same error on our QA server. Any ideas?
Related
Current Situation:
I have an ASP.NET web project. (Framework Version: .NET Framework 4.5.2)
One developer here is able to compile it and run it fine in Visual Studio 2017.
I cannot, I get the "could not load file or assembly" error for a reference that is in my list of references.
Screenshots:
Error:
Bin Folder:
Web.config Potential Relevant Sections:
DevExpress Licenses File:
DevExpress Library File's Details:
Things I've Tried:
Clean Solution & Rebuild Solution
Deleted solution locally and clean get of solution from source control
Clearing out my temp directory
Opening the project in Visual Studio 2015
Having the developer zip up his local copy of the solution / project and sending it to me (When I ran his copy locally I continued to get the same error.)
Re-adding the existing library it's complaining about
Manually deleting and re-adding all the libraries in my BIN folder
Messing with the license file, web.config, and assembly references in code (including adjusting the version numbers because for some reason the version number is 17.2.5.0 anywhere it's referenced in the project, but the file's Details actually says it's 17.2.9.0?)
Smashing my face into my keyboard...
...Always the same error.
Additional Information
Other developers run into the same exact error under the same conditions as me, only my one developer who's been working in this project can build it fine
I just noticed that on a new copy of the work project, my references window is showing 2 of the same reference to the DevExpress.Data library (one in the GAC and one in the BIN) but when I try re-adding the reference to my project, the one in the BIN disappears from my references window:
I have an Asp.Net website project that builds fine locally with VS2010 and from the command line with msbuild. The problem is its failing on our build server (CruiseControl.net) with this circular file reference issue
/tms/_master/help.master(1): error ASPPARSE: Circular file references are not allowed. [C:\ccnet\working\master\Tms.Rms.Website\tms.metaproj]
/tms/_master/reporting-detail.master(2): error ASPPARSE: Circular file references are not allowed. [C:\ccnet\working\master\Tms.Rms.Website\tms.metaproj]
/tms/_master/mvc.master(1): error ASPPARSE: Circular file references are not allowed. [C:\ccnet\working\master\Tms.Rms.Website\tms.metaproj]
I don't see anything obvious about the way pages/folders/or controls are laid out as suggested in other questions related to this error, and I have zero feedback from VS2010 locally as it doesn't have the problem at all. (it builds ok)
Anyone know how I can track this issue down locally, or what may be the cause of different build results between machines?
Local build environment: vs2010, msbuild 4.0, building as myself
Build server environment: msbuild 4.0, building as ccnet service account (no vs2010 installed or available)
I also have the same version of ccnet setup locally with he same configuration building successfully.
It's worth noting that the circular reference errors above seem to occur on "nested" master pages with the MasterPageFile attribute. e.g.
<%# Master MasterPageFile="~/_master/base.master" CodeFile="help.master.cs" Inherits="_master_help" %>
I am getting a build error when I attempt to build my asp.net application. The error is:
The type 'MediCare.Framework.Authentication.IUserAuthenticate' is defined in an assembly that is not referenced. You must add a reference to assembly 'MediCare.Framework, Version=1.0.1.95, Culture=neutral, PublicKeyToken=1999fa3c42b9'.
I can see the class in the library which is in the references folder. How do I debug this issue?
My intention is to point the references folder to the library source code's bin directory (since the pdb file is lcoated there and any updates to the library will reflect in the application). However, when I point the references folder to the bin directory of the source code, I get the error message above.
Update The application was originally developed in VS 2008 and I am modifying it in 2010. I think I am confused about where the GAC assemblies would be, if I am using VS 2010 (2.0 framework location or 4.0 framework location) ? .NET 4.0 has a new GAC, why?
Update (06-26-2012)
The file in the GAC ("C:\Windows\assembly\") has been deleted. But this error is still occuring.
This could possibly be caused by version inconsistencies. Meaning, in order to fix this, I would do a complete clean build of your assemblies (and also an assemblies that might be nested inside an assembly). Just go out cold and do a new build on all assemblies. That should work.
Go into windows explorer, right click on the DLL file that your project is using that contains this class, and look at the version tab. Make sure version number matches what you see in the error message. My guess is that it won't.
If it does match, then check the GAC and make sure there isn't a different version of the DLL there that it could be picking up. To do that, go to windows explorer, and navigate to c:\windows\assembly. See if that assembly is in there with a different version number. If it is, you may need to delete it from the GAC (use caution though because other apps may depend on it being there).
I have a Silverlight site hosted in an asp page, it has been developed using vs2010 using .net 3.5 framework and silverlight 4. It all works on my dev box. However when I publish the site and get it deployed I get the error:
Could not load file or assembly 'Moe.Tactical.Ttas.Web' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
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 'Moe.Tactical.Ttas.Web' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
I have checked that the ISS asp setting are using 2.0.50727, and that all my references are using that runtime also.
I am not sure what to do to work out what the missing dependencies are at this point (I don't have access to the deployment box, I will have to go and sit with a system admin).
This looks like a case of the GAC, and nothing to do with Silverlight/VS 2010/whatever.
Basically that assembly lives in the GAC of your dev box, but now on your production box, and the DLL is not included in your build.
I was actually exactly the opposite of 'TheGeekYouNeed's suggestion ... the system administrator had not followed my instructions, and had included a couple of extra assemblies in my bin folder, lol.
So interestingly it was complaining about having an extra file! (well actually an extra file that was probably a .net 4 one)
I have an application that loads user controls into .NET web application. When I compile and test the application locally on my dev machine it works on my machine. The project builds successfully using MSBuild on our build server. However when I deploy the dll generated by MSBuild on the build server I get the following error when the application loads the control:
BC30456: 'CreateResourceBasedLiteralControl' is not a member of 'ASP.usercontrols_somecontrol_ascx'.
I took a look and compared the dll generated on my machine and compared it(looked at the file size) with the one created by the build server and noticed
a difference in the file size. This is confusing considering the code being built locally and on the build server is IDENTICAL. I manually compared each file by hand. So my question is: What is causing this error? What would be different between MSBuild's compilation of the code and what is going on in Visual Studio when compiling the code?
You've got a versioning issue. Some assemblies are different on your target machine than on your dev machine. I'm afraid you're going to have to do some digging to hunt it down, since this error message is entirely unhelpful. Really it's pointing you in the wrong direction since the problem isn't in your assembly. It's probably caused by something in your project References. Have you got some 3rd party tool or SDK on your dev machine that hasn't been updated on the server yet?
The last time I saw this was when I had built a DotNetNuke module that was built against a newer DotNetNuke.dll assembly than my server had.
If you compile that as dll.
Try delete App_Code.dll in bin folder.