Can't get IIS Express 8 beta to run website as 64-bit process
Asked Answered
V

11

55

on x64 Windows 7 I am trying to get hello world MVC 3 website running as 64-bit process (so Environment.Is64BitProcess returns true on a page) using IIS Express 8 latest beta.

IIS Express 7.5 is 32 bit but IIS Express 8 does support 64 bit (http://learn.iis.net/page.aspx/1266/iis-80-express-beta-readme/).

Can't get any 64-bit love.

Building AnyCpu returns Is64BitProcess false, building x64 gives "An attempt was made to load a program with an incorrect format. " as if it was trying to run as 32-bit process.

Experiments w/ renaming folders etc. suggest that "C:\Program Files (x86)\IIS Express" is only thing that is getting used, and "C:\Program Files\IIS Express" is being ignored by VS.

How can I get VS to use the x64 IIS Express host?

Vicechairman answered 18/4, 2012 at 2:38 Comment(2)
Did you get this working? Did you use one of the answers below? Mark one as your accepted answer. Cheers.Borak
Strange that VS isn't smart enough to use the proper version of IIS Express, depending on the configuration of the project being debugged!Circumcise
P
85

This option is now part of Vs 2013 / 2015 / 2017:

Tools | Options | Projects and Solutions | Web Projects | Use the 64 bit version of IIS Express

Prosecutor answered 30/4, 2014 at 13:21 Comment(0)
B
32

From a Microsoft response to forum post on http://visualstudio.uservoice.com -

This is working for me even though it is not endorsed or supported officially by Microsoft.

Mike Harder (Microsoft) commented · January 31, 2013 5:26 p.m.

You can configure Visual Studio 2012 to use IIS Express 64-bit by setting the following registry key:

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

However, this feature is not supported and has not been fully tested by Microsoft. Improved support for IIS Express 64-bit is under consideration for the next release of Visual Studio.

Allow for IIS Express 64 bit to run from Visual Studio 2012

Borak answered 19/3, 2013 at 4:13 Comment(3)
Also works and is necessary in VS2013 - other workarounds are possible, but out of the box an x64-only component or Assembly will not work in VS2013 - not fixed despite Microsoft's assertions on MSDN.Grau
@ChrisMoschini For VS2013, there is an easier way than the registry setting. See Eric Bole-Feysot's more recent answer to this question.Machiavelli
@ChrisW.Rea Thanks! Notably this checkbox appears to just toggle that Reg entry.Grau
C
6

Late to the party but VS2013 has this in the Options.

Tools -> Options -> Projects and Solutions -> Web Projects -> Use the 64 bit version of IIS Express…

Contracture answered 15/5, 2014 at 2:57 Comment(2)
I took a look and VS 2012 Ultimate does not have this option. Might be time for me to upgrade.Sublunar
This is an exact duplicate of @Eric Bole-Feysot's answer.Borak
K
4

You have to launch iisexpress from command line in this case,

http://learn.iis.net/page.aspx/870/running-iis-express-from-the-command-line/

As I am not sure when will Microsoft updates the VS integration part to allow you to choose x64 IIS Express. The current integration obviously is x86 only.

Kandacekandahar answered 18/4, 2012 at 7:44 Comment(2)
Got it, thanks for confirm. For anyone similarly looking for a VS-based solution, I found you can use straight IIS w/ x64 application pool - put breakpoint in your global.asax, hit run, add whitespace to web.config and save it, that will trigger the breakpoint, almost as good as IIS Express.Vicechairman
To simplify the task of running it in the command line you can run the x86 version from VS, use ProcessExplorer to copy the command line and just replace "Program Files (x86)" with "Program Files" in the command.Twinberry
F
3

In the registry, go to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\IISExpress\8.0\InstallPath and change the path to the 64-bit iisexpress.exe location.

Fiberboard answered 28/1, 2013 at 15:40 Comment(0)
D
3

Do the following to run VS2012 project in x64 project in IIS8 Express on x64. I am running x64 WCF service. See below,

  • Install x64 version of IIS Express 8.

  • Set the project to run x64 bit.

enter image description here

  • Add a custom web server url. Because you don't want to start the service when the project run (F5).

enter image description here - Write a bat file and add the following. Put the correct unc location of the applicationhost.config and the correct project name. Save the bat file.

cd "Program Files"/IIS Express 
iisexpress.exe  /config:"\\companyname.com\root\User-Profiles\testusername\Documents\IISExpress\config\applicationhost.config" /site:"YourProjectName.WcfHost" /apppool:"Clr4IntegratedAppPool"
  • Run (F5) the project.
  • Double click the bat file to start IIS Express 8 for x64. See Windows Task Manager and IIS Express system tray. enter image description here

enter image description here

Deaden answered 9/7, 2013 at 3:24 Comment(2)
Maybe command like this: iisexpress.exe /config:"C:\Users\{your user here}\Documents\IISExpress\config\applicationhost.config" /site:"WcfService.x64" /apppool:"Clr4IntegratedAppPool"Flournoy
I have Windows 8.1 64 bits. I think, I have iisexpress_8_0_RTM_x64_en-US.msi because if I try install iisexpress_8_0_RTM_x64_en-US.msi appears Repair option and not appears for Install, but I have IISExpress 8.0 in %ProgramFiles(x86)%/IISExpress path (x86?). And in Task Manager appears IIS Express Worker Process (32 bits)Flournoy
M
2

You can run IIS Express in 64 bit mode from the command line, and then use VS "attach to process" to debug.
See this question.
Have fun.

Mopboard answered 12/9, 2012 at 4:3 Comment(1)
How can I run IIS Express in 64 bit mode ? I have Windows 8.1 64 bits. I think, I have iisexpress_8_0_RTM_x64_en-US.msi because if I try install iisexpress_8_0_RTM_x64_en-US.msi appears Repair option and not appears for Install, but I have IISExpress 8.0 in %ProgramFiles(x86)%/IISExpress path (x86?).Flournoy
H
2

It seems that creating EXE that does nothing else but start 64-bit IIS and putting it in place of 32-bit iisexpress.exe does the job.

This is C# code I used to create the EXE:

using System.Diagnostics;

namespace IISExpress64
{
    class Program
    {
        static void Main( string[] args )
        {
            Process.Start( @"C:\Program Files\IIS Express\iisexpress.exe", string.Join( " ", args ) );
        }
    }
}
Heuer answered 23/1, 2013 at 16:47 Comment(0)
L
1

Simple possibility is just to set IIS x64 as starting program for the WEB project :

Project Properties -> Web -> Start Action - > Start Program : c:\Program Files\IIS Express\iisexpress.exe command arguments: /path:{yourProjectPath} /port:{yourPort}

Lakendra answered 5/4, 2013 at 20:47 Comment(1)
I tried this but it didn't work for me. VS still launched the version in the (x86) directory.Dekeles
A
0

I am using VS2022, change Bitness from 86 to 64 works for me.

enter image description here

Antiknock answered 16/8, 2022 at 16:56 Comment(0)
L
-2

In order to solve this on my system, I cheated -- I copied the 64-bit executables (in \Program Files\IIS Express\) over the 32-bit executables (in \Program Files (x86)\IIS Express\). Visual Studio doesn't seem to care whether it's one or the other.

I guess we will have to wait and see if the final release of VS 2012 will allow for choosing between the 32-bit and 64-bit IIS Express.

Longitude answered 1/7, 2012 at 0:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.