Visual Studio 2010 - unable to create a website that references a 64-bit assembly

How can a web application reference a 64-bit assembly?

I have a solution with a web application and a class library. The class library is set to 64-bit. By default, the web application is Any CPU , but if I build and run, I get the following error:

Failed to load file or assembly "ClassLibrary64, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null" or one of its dependencies. An attempt was made to download a program with the wrong format.

I can’t start the project on 32 bits or on any CPU - I interact with SharePoint 2010, and the site should work on 64 bits or the SharePoint API does not work ...

Any ideas?

+6
visual-studio-2010
source share
2 answers

IIS probably works as 32-bit. Why don't you build a class library like AnyCPU?

0
source share

This will be because your JIT web application is up to 32 bits long, so you cannot load the 64-bit assembly into the workflow.

There are very few reasons why you need to build a web application assembly for a specific bit. Do you need a class library for x64, or can you leave it as AnyCPU?

Also, does IIS work on a 64-bit machine with a 64-bit OS? If either 32 bits, but you cannot load the 64-bit assembly.

0
source share

All Articles