Urgent: invalid format of a class library [Resolved]

Posted by Supernova122 under VB.NET on 11/11/2013 | Points: 10 | Views : 1228 | Status : [Member] | Replies : 4
I am using VB.net 2008 and .net 2.0 framework. After I modified a class library in development environment, I build a particular class library in visual studio 2008 and dll file get generated in the bin directory.

I copied this dll file to the bin directory in production environment. But I got the following error. The .net framework in production is running ver 2.0. Please help. Thanks a lot.



"Server Error in '/alp/m' Application. "
________________________________________
The format of the file 'Classlibrary' is invalid.
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: The format of the file 'Classlibrary' is invalid.

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 'Classlibrary' could not be loaded.

=== Pre-bind state information ===
LOG: DisplayName = Classlibrary, Version=1.0.3069.18998, Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///c:/webapp/alp/m
LOG: Initial PrivatePath = bin
Calling assembly : EM.main, Version=1.0.3069.19003, Culture=neutral, PublicKeyToken=null.
===

LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Post-policy reference: Classlibrary, Version=1.0.3069.18998, Culture=neutral, PublicKeyToken=null
LOG: Attempting download of new URL file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/alp_mchd/69165f10/4d09ca79/Classlibrary.DLL.
LOG: Attempting download of new URL file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/alp_mchd/69165f10/4d09ca79/Classlibrary/Classlibrary.DLL.
LOG: Attempting download of new URL file:///c:/webapp/alp/m/bin/Classlibrary.DLL.

Stack Trace:

[BadImageFormatException: The format of the file 'Classlibrary' is invalid.]
EM.main.Web.Common.WebPageBaseClass.Page_Load(Object sender, EventArgs e) +0
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750




Responses

Posted by: Bandi on: 11/11/2013 [Member] [MVP] Platinum | Points: 50

Up
0
Down

Resolved
Refer
http://msdn.microsoft.com/en-us/library/k7137bfe(v=vs.90).aspx
http://stackoverflow.com/questions/8996653/troubleshooting-badimageformatexception

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Supernova122, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Supernova122 on: 11/12/2013 [Member] Starter | Points: 25

Up
0
Down
Thanks for the advice. I read all documents in both links and tried to change the target CPU to "x86". But I still got the same error. Any more input? Thanks.

Supernova122, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 11/13/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
>> Attempting download of new URL file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/alp_mchd/69165f10/4d09ca79/Classlibrary.DLL.

There was version conflict . You are building app using V2.0 but your dll is of version v1.1.4322


As per the following troubleshooting tip you make sure that you have same version
Make sure that you are not using a component that was created with a different version of the .NET Framework --- by http://msdn.microsoft.com/en-us/library/k7137bfe(v=vs.90).aspx


Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Supernova122, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: WPF_G on: 11/18/2013 [Member] Starter | Points: 25

Up
0
Down
If you want to know more about Visual Studio you can download here a FREE eBook : http://www.tekkiebooks.com/campaign/freebook/dotnetfunda_08
LEARN step by step how to install Visual Studio 2012 on Windows 8. Use it as a quick reference or a standard how to document for your development team. Simplify your work and gain time!

Good luck in creating amazing applications!

Supernova122, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response