What's purpose of <Use64BitIISExpress /> element in csproj file

Solution 1:

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.

Solution 2:

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)