Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Could not load file or assembly 'Mydll' or one of its dependencies
devkianote
#1 Posted : Friday, December 19, 2008 12:48:29 AM(UTC)
Groups: Member
Joined: 12/19/2008(UTC)
Posts: 3
Location: pune

Hello Sir, Madam

I am facing one issue.

I have create a setup for using cassini webserver,

for 32but machine it works perfectly fine,
But for 64 bit it is not working,

In the setup I am using one dll. When I run it on a 64bit machine I get the following error.

"
Could not load file or assembly 'mydll' 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. "



I have complied the dll with target as x86, but the error still persists.

I was not sure wether the error is with the dll or the webserver.

So I also configured the application in the IIS on the 64 bit machine, and it worked just fine.

So Please help on this , I also downloaded the latest version of the webserver and checked it again,
but nothing seems to work.

could you please help me .

Thanks a lot in advance.
Ultidev Team
#2 Posted : Friday, December 19, 2008 6:10:34 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hi there!

We'll try to help you with troubleshooting this issue.

We understand that the failure occurs only on 64-bit systems and works fine on 32, but here are a few points we'd like to confirm:
- You tried to compile the DLL as x86, and also as AnyCPU, and have a problem in both cases.
- Your installer is built for x86 (installers can't be built for AnyCPU because they use native-code Setup.exe and therefore have to be either 32 or 64).
- You have a problem with both the installer when it's running, and with the web application itself when it's hosted under UltiDev Cassini on 64-bit system.
Please let us know if we got it right.

We also have a question: do you use any 3rd-party native-code DLLs in your application, like 32-bit COM objects or 32-bit DLLs called via P/Invoke?
The reason we ask is that UltiDev Cassini runs as a 64-bit process on 64-bit machines, and most applications built with AnyCPU option will load just fine in either 32- or 64-bit process. When you build your application for a specific system - x86 or x64, it may not work if loaded in a process with different characteristics. Trying to load 64-bit ASP.NET app into 32 bit process will blow up, but 32-bit processes sometimes work. We are able to run ASP.NET 1.1 applications built for x86 under UltiDev Cassini for ASP.NET 2.0 on x64 machines. In fact, Cassini Explorer application is ASP.NET 1.1 app running just fine. CassiniExplorer, however, does not call native 32-bit DLLs.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
devkianote
#3 Posted : Sunday, December 21, 2008 6:53:15 PM(UTC)
Groups: Member
Joined: 12/19/2008(UTC)
Posts: 3
Location: pune

Hi...

thank you for your quick response.

Please find the answer to your queries below in blue


- You tried to compile the DLL as x86, and also as AnyCPU, and have a problem in both cases.
Yes, I have a problem in both cases on 64bit machine, (it is a vista machine)

- Your installer is built for x86 (installers can't be built for AnyCPU because they use native-code Setup.exe and therefore have to be either 32 or 64).



- You have a problem with both the installer when it's running, and with the web application itself when it's hosted under UltiDev Cassini on 64-bit system.
The installer doesn't shows any error when installing the setup.
The error comes when I try to open the webapplication
however when I open the same application using IIS it works fine..


Regarding any 32bit dll
=================
I do not have as such any dll included explicitly.
Following are the things that I would like you to know is that:
in 2 or more classes following has been used.

Imports Microsoft.VisualBasic.CompilerServices
Imports System.Runtime.CompilerServices
Imports System.Runtime.InteropServices

So I am not really sure are these causing any issue.

Also I using ASP net 2.0 .

Thanks for your help.


Ultidev Team
#4 Posted : Monday, December 22, 2008 4:49:18 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hi!

It seems you have done everything right. We recommend that you build the application for AnyCPU, and not specifically for x86 or x64.

Now, could you please review this Microsoft KB article: http://support.microsoft.com/kb/928208/en-us? This article talks about incompatibility of MS VB compiler runtime, but we are not sure if that's the same component you are using.

Please let us know if this information was helpful.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
devkianote
#5 Posted : Tuesday, December 23, 2008 1:23:35 AM(UTC)
Groups: Member
Joined: 12/19/2008(UTC)
Posts: 3
Location: pune

hi.,

Regarding:

We recommend that you build the application for AnyCPU, and not specifically for x86 or x64.

If i do the above then , I get the following error,

"Micorsoft oldedb 4.0 is not registered on the local machine"

Hence I had forced it to complile specifically for X86, as per the solutions found on the net.



Regarding URL mentioned by you, I have gone throught it and I will be trying on a 64bit machine to see if it works.
After that I will let you know.



Ultidev Team
#6 Posted : Sunday, February 8, 2009 2:50:05 PM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
For additional information and suggested workaround please see this thread:
http://ultidev.com/Forums/Default.aspx?g=posts&m=1735&#1735

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Rss Feed  Atom Feed
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.