Why I can't build x64 ASP.NET application from VS 2008
I have web application; it runs under IIS 7.5, ASP.NET 2.0. At moment I
use VS 2008 to develop it. Some time ago I start struggling with x64
version of application. Application contains many assemblies and some of
those came from another team. I never used x64 (only MSIL) before to
develop my app, so this question was created. As I said x64 version
contain assemblies from another team built for x64, thus those assemblies
located at GAC_64 (*c:\Windows\assembly\GAC_64*). And when I started build
application in VS I got famous and widely known error:
Could not load file or assembly XXX, Version=YYYY, Culture=neutral,
PublicKeyToken=ZZZZ' or one of its dependencies. An attempt was made to
load a program with an incorrect format.
Mentioned assembly located at GAC_64, but it can't be loaded because VS
start build project as non x64. I see at the Output window "…
Configuration: Debug Any CPU ------". So my question how to build ASP.NET
project under x64 from VS 2008? I noticed that when I go to
Build->Configuration Manager I couldn't create x64 configuration, because
it contain only Any CPU and .NET configuration I don't see x64
configuration:
You can wonder why my team building x64 version of assemblies instaed of
building MSIL (Any CPU). Yes we built it, but for some reason we have x64
bit version as well. I can work with MSIL version without any problem, but
I want to know why I can't debug ASP.NET project under x64.
However I found very awkward workaround how to deal with it. I can compile
project with aspnet_compiler.exe from
c:\Windows\Microsoft.NET\Framework64\v2.0.50727\ with command
aspnet_compiler.exe –v /{MY_APPLICATION_NAME}
where {MY_APPLICATION_NAME} – already installed x64 bit application at my
dev PC After run IE I can attach debugger of the VS 2008 and successfully
debug my app. It works for me because I have to fix small bug and it
affect only one file so I can use it; however this approach is not good.
Next time I'm going to use MSIL version of DLLs but still wondering how to
deal with this kind of situation ? Should I fix something at web.config ?
No comments:
Post a Comment