51

When I edit Web application project, Visual Studio 2017 (15.3.1) adds <Use64BitIISExpress /> element under Project/PropertyGroup in csproj file. I can't find any documentation, what is the purpose and if it affects something, when presented (as it is, without any attributes).

Only result I was able to find was mention about registry value of the same name.

Does someone know what this element serves for? Was it introduced in some of recent updates of Visual Studio 2017?

Ondrej
  • 1,209
  • 1
  • 11
  • 21
  • 2
    I've noticed this element being added after upgrading to Visual Studio 2017 update 3 (15.3) upon changing NuGet packages. – Bart Verkoeijen Aug 29 '17 at 06:44
  • 1
    "Now you can debug your 64-bit web sites. If you don't do this, you will likely get a message similar to: "Could not load file or assembly or one of its dependencies. An attempt was made to load a program with an incorrect format." https://blogs.msdn.microsoft.com/rob/2013/11/14/debugging-vs2013-websites-using-64-bit-iis-express/ The new tag seems to have simplified the process of using 64-bit IIS. – Triynko Sep 12 '17 at 17:13
  • @Triynko I think your comment should actually be expanded into an answer. And I think [the answer from CodeMonkeyKing to this other question](https://stackoverflow.com/a/15491368/146513) might also be useful to understand why although this feature might be present since VS2013, the setting my have changed in 2017 (Mike Harder talks about improved support for future version). – Mariano Desanze Sep 21 '17 at 16:50

2 Answers2

55

I noticed this entry, not surprisingly, after I made a change to the Properties page of the my Project. Under the Web section of the Properties page, you'll see a section called "Servers". After I changed the "Project URL" to use the correct port number for debugging, this entry appeared (not because I changed that option specifically, but it's when I noticed it appearing).

<Use64BitIISExpress />

In this section you can select either "IIS Express" or "External Host". Next to that dropdownlist, there is another dropdownlist for "Bitness". Mine was currently set to "Default", which displays the entry in the Project file as an empty element. After changing the "Bitness" to "x64", my Project file entry changed to:

<Use64BitIISExpress>true</Use64BitIISExpress>

Changing my "Bitness" to "x86" results in:

<Use64BitIISExpress>false</Use64BitIISExpress>

Returning "Bitness" to "Default" makes it again an empty element:

<Use64BitIISExpress>
</Use64BitIISExpress>

I understand this doesn't address your question of "where is the documentation?". I, too, could not find any relevant MSBuild documentation for this attribute. But, I thought it worth noting where the attribute is coming from and how it acts based on selected options from the Project properties while we anxiously await some formal, official documentation.

halfer
  • 19,824
  • 17
  • 99
  • 186
Urk
  • 880
  • 8
  • 16
  • 2
    It answers my question "what is the purpose" - you answered what setting it reflects - this is what I was about. – Ondrej Sep 07 '17 at 13:33
  • It is probably the same as setting the IIS Application pool to 64bit only.. if you that is what you need to debug in IISExpress - This has been available since VS2013 and was used for software that only released 64bit DLL's – Piotr Kula Oct 04 '17 at 09:24
  • 1
    Now I'd like to know what idiot made this a project level configuration instead of associating it with a particular target platform (x86/x64). – jpmc26 Nov 06 '17 at 20:09
  • So is `` the same as "true" or "false"? – Mark Schultheiss May 15 '18 at 21:22
  • 1
    @MarkSchultheiss appears to be neither true nor false; it's "Default", which leads me to believe it's based on your hosting configuration rather than your solution's Project setting. – Urk Oct 16 '18 at 20:51
  • When appears, it seems Visual Studio has no bitness changing it. – Slothario Aug 26 '19 at 19:32
  • So is including `` any different from omitting it? – Tvde1 Jul 30 '20 at 15:05
9

The purpose of that (pretty obvious) is to start IIS Express in 64bit mode. It is the equivalent of setting 64bit only on the Application pool in IIS.

If your project has a dependency on a DLL that only runs under 64bit mode then this is when you need to set it. This has been available since VS2013

Probably is useful if you prefer to do do F5 debugging instead of process reattaching for your pure 64bit applications

This started showing up in the config files since VS2017 due to all the changes happening with Visual Studio portability. (VSCode, Visual Studio Mac, Xamarin, etc)

Piotr Kula
  • 9,597
  • 8
  • 59
  • 85