How to make Asp.Net site x86 compatible?!


I have win32 dll that cannot be changed/recompiled to 64bit format. So, anyways I have to use this dll in my Asp.Net application. I know that 32bit dlls cannot be used in "AnyCpu" mode of .NET applications. Then I have adjusted project properties and set PlatformTarget=x86 for both for Debug and Release configurations. My Asp.Net application performacly work under debugger.

But(!) after I published my Asp.Net application to the "C:\inetpub\wwwroot\MyApp02\" location,
then converted it to the Application in IIS7.5 console and then trying to run it by specifying "http://localhost/MyApp02" url in a browser I'm getting the error:

System.BadImageFormatException: impossible to load MyApp assembly of one of its dependencies (I'm translating message from local language, so error message may be different than english one).

The only problem I can think of here is that mentioned win32 dll does not match site format. Or what also could be wrong with it?
How can I check/change target platform for the published Asp.Net application?
What also can I check to figureout what wrong and the what to fix to make it working?

Any ideas/hints are welcome.

PS. I'm working in Windows 7 Ultimate 64bit OS, hardware is Core-i7-920/6Gb RAM.
Asp.Net project for my application created in the VisualStudio2008 pro. Published using contect menu in solutuion explorer in VS2008. So

I just create an empty Asp.Net application and only changed PlatformTarget=x86 and then published it. And it does not work! So, I assume it is a problem somewhere on the IIS/.NET integation bound. Can you please help me to make it working?!
Who is Participating?
RameshSConnect With a Mentor Commented:
Assign the 32-bit application to a separate application pool in IIS and turn on the Enable 32-bit Applications switch for that application pool. Check the following links for more details. If you still get the error  copy the msvcr71.dll in c:\windows\system32 and c:\windows\syswow64 folders.
Support Knowledge Base, Article 1213
problems running x86 application on 64-bit windows with IIS7.5
Thread: problems running 32-bit website on 64-bit with IIS7.5
masterpassConnect With a Mentor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.