4

My task is simple: I need to test my ASP.NET web application in a 64-bit environment on my development machine. (At this point I don't even ask about running it through a debugger. All I need is to run it in a 64-bit process.)

So I created a stock C# Web Application in Visual Studio 2010 and adjusted its properties as such:

enter image description here

I then did Ctrl+F5 (or run without debugging) and IE loaded up and hangs up like so:

enter image description here

What am I doing wrong here?

PS. Running it on Windows 7 Ultimate (64-bit).

c00000fd
  • 20,994
  • 29
  • 177
  • 400
  • you don't need any specific setting to run on 64-bit, maybe there are some other issues, go check event log – fengd Mar 24 '13 at 07:22
  • @MitchWheat: Yes. I do. :) BTW, I also tried setting the project as x64 in Configuration manager. At this point I can't start in in either case using local IIS. – c00000fd Mar 24 '13 at 07:23
  • @Jun1st: The event log is clear. It has some information messages from SQL Server but nothing concerning IIS. – c00000fd Mar 24 '13 at 07:24
  • @c00000fd what would be the output you expected? and do you install iis after installing vs2010? – fengd Mar 24 '13 at 07:27
  • @Jun1st: I'd expect this test web app at least to start. It's a stock project and it starts if I run it from a dev server (but it runs as a 32-bit process.) And yes, I just installed IIS. The VS2010 has been installed several years ago. – c00000fd Mar 24 '13 at 07:31
  • 1
    @c00000fd IIS needs to be installed before you install vs2010. otherwise you'll needs to run aspnet_regiis again. Not sure this is the exact issue. But it's what happened to me when I install vs before iis and got weird issues as you do now. register aspnet again works for me, so worth giving a shot – fengd Mar 24 '13 at 07:39

4 Answers4

15

We had the same problem and when the team jumped to Visual Studio 2012, this registry key was really useful to us :

you can add a registry key to force visual studio to use the 64 bits version of iisexpress.exe ; unfortunately for you, it is a VS2012-only solution.

reg add HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\WebProjects
    /v Use64BitIISExpress /t REG_DWORD /d 1

Then restart Visual Studio and tick [X] Use IIS Express in your settings.

(see also the source).

UPDATE: For reference, in Visual 2013, this option can be found in the interface : Options/Projects and Solutions/Web Projects/Use the 64 bit version of IIS Express for web sites and projects

Bryan Legend
  • 6,790
  • 1
  • 59
  • 60
JB.
  • 1,103
  • 1
  • 20
  • 37
  • 1
    Please comment downvotes. I know the question is VS2010-related, but it would be narrow minded not to give a solution for those who have the same problem on more recent versions of visual studio. – JB. Sep 19 '13 at 07:14
  • 1
    Thank you for your answer. I still didn't fix my problem, but your post got me in the right direction. The downvote was not just. – Alon Catz Dec 31 '13 at 12:45
  • 1
    **CONFIRMED**: I had a web app that I converted from AnyCPU to 64bit. It immediately had trouble loading other converted 64bit libraries (also converted). After making this change in the registry, it immediately began working. **Question**: Is there a setting for this in later versions of Visual Studio? – Aron Boyette May 11 '15 at 23:34
  • I had 64bit dll reference on a web project. It worked for me to check "Options/Projects and Solutions/Web Projects/Use the 64 bit version of IIS Express for web sites and projects" option in VS2017 RC. – Oktay Mar 01 '17 at 11:51
2

In IIS make sure the Application Pool, Advance Settings, Enable 32-Bit Applications = false

If this setting is true then the worker process will run as 32bit WOW64 process.

Chris

Chris Goder
  • 118
  • 1
  • 6
0

No settings required in project or solution level. I am developing WebApp on VS2010 on 32 bit and 64-bit machines simultaneously. Actually We are working on SVN and our few machines have Win7 32-bit and my few mates have Win7-64bit laptops. But there we haven't faced any such issue while compiling the app on two different machines and Even on the live server, it runs butter smooth. Hardly care about the bit and bytes.

To verify a test run. Publish your code and host in your local IIS or Cassini Webserver and access it over LAN.

Also if possible revert back solution and project settings to its original configuration settings. Generally, We do not need to change target until and unless it is strictly required. As, AFAIK, It compiles the assembly under "Any CPU" as target, which is eligible for all i.e. IA, X64 and X86..

Finally, if you are coming across any error, please do post it here. It will help you and us as well.

0

First of all how to do you know if your IIS process is running your website as 32-bit or 64-bit as of now? Open Task manager to check the bitness of w3wp.exe. If your machine is 64-bit then IIS will run 64-bit by default. Your problem seems to be something else. If bitness is the issue then you won't even come this far. Check IIS logs (c:\inetpub\logs{website-ID}{date})... that might give you some pointers. If there is nothing in there, check event viewer. If nothing then check if the virtual directory is actually created in IIS Manager under Default Web Site.

Have you actually tested if IIS (sans ASPX) is functional? http:// localhost ? does that work? if that is working then I would recommend checking if your ASP.NET modules are properly installed within IIS.

Hope this Helps.

Muqeet Khan
  • 2,094
  • 1
  • 18
  • 28