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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.