Alex Rivera | Logout

Building a website project as 32-bit on a 64-bit build server

Asked 2010-12-20T15:23:28.990
19

I have a VS 2010 solution that contains a website that has a web service within it. The web service references a COM dll that is causing problems when the solution is built on our 64-bit build server. I get the typical 32/64-bit error:

ASPNETCOMPILER : error ASPCONFIG: Could not load file or assembly 'xxx' or one of its dependencies. An attempt was made to load a program with an incorrect format

When I build the site using the 32-bit aspnet_compiler it builds okay. So, how do I specify that a website should be built as 32-bit? The Configuration Manager within VS will only let me choose Any CPU, so I cannot change it to x86 for this website...

Thanks.

Edit
Report

2 Answers

0

Its not the compilation problem but the environment problem. The ASP.NET Website will always be built as Any CPU.

However, if you load it on 64 bit machine, by default 64 bit version of IIS is running which is unable to load COM DLL and it fails.

You need to configure IIS to run 32 bit applications on 64 bit Windows: http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/iis/405f5bb5-87a3-43d2-8138-54b75db73aa1.mspx

answered 2010-12-20T17:21:33.933
0

Although this is an old question, I was faced with the same problem and I had some troubles finding an answer.

Visual studio offers two options for developing web applications: web sites and web applications. We applications generate assemblies per page, which are dynamically updated if the source changes. On the other hand web application projects are compiled in visual studio to one assembly. This assembly is not automatically rebuilt after changes to the source code. The differences are explained in detail in this document: http://msdn.microsoft.com/en-us/library/aa730880(VS.80).aspx#wapp_topic5

Another difference, which is relevant here is that web application projects allow you to actually choose an architecture contrary to web site projects. Converting a web site to a web application is not very hard, but not too straightforward (the option convert to web application is only available after creating a ... web application). Steps you can take:

  1. Create a new web empty web application
  2. Browse to the directory of new web application and copy all files from your website (overwriting anything in the directory)
  3. Add all files to the project
  4. Right click the project and choose “Convert to web application”.
  5. It may be needed to solve a few namespace issues.
answered 2011-12-15T15:01:57.400

Your Answer