Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 601
Col Avatar asked Dec 20 '10 15:12

Col


People also ask

Can a 32-bit program run on 64-bit?

Can I run 32-bit programs on a 64-bit computer? Most programs made for the 32-bit version of Windows will work on the 64-bit version of Windows except for most Antivirus programs. Device drivers that are made for the 32-bit version of Windows will not work correctly on a computer running a 64-bit version of Windows.

How do you change the solution platform?

On the Build menu, click Configuration Manager. In the Active solution platform box, select the platform you want your solution to target, or select <New> to create a new platform.


2 Answers

You can use the following command. Actually, in this case you are using ASPNetCompiler x86 edition to build your own project

call "C:\Program Files\Microsoft Visual Studio 2008\VC\vcvarsall.bat" x86
MSBuild MySolutiuon.sln 

You can also use x86_amd64 for any cpu. Note that instead of using MSBuild you can load your confiiguration like

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 <Target Name="PrecompileWeb">
     <AspNetCompiler
         VirtualPath="/MyWebSite"
         PhysicalPath="c:\inetpub\wwwroot\MyWebSite\"
         TargetPath="c:\precompiledweb\MyWebSite\"
         Force="true"
         Debug="true"
         FixedNames="True"
     />
 </Target>
</Project> 

to use above confiuguration you have to use

MSBuild your.xml /p:Configuration=Release
like image 135
Nasser Hadjloo Avatar answered Oct 07 '22 22:10

Nasser Hadjloo


@Vilx, Check the dependency walker to find out how far it gets. My guess is it would probably stop at vjsnativ.dll. If that's as far as it gets, try this workaround.

Otherwise you'll have to chase down each DLL that the program can't find, and copy them into your program (or its bin) directory.

like image 44
musaul Avatar answered Oct 07 '22 22:10

musaul