17

I have a weird situation where even when the following setting is set in the csproj:

<UseGlobalApplicationHostFile>True</UseGlobalApplicationHostFile>

Visual Studio 2015 still creates sites in the local .vs directory (.vs\config\applicationhost.config) and ignores the flag set in the csproj.

I've gotten this working in another solution where it uses the global version in (Documents\IISExpress\config) after adding the GlobalApplicationHostFile key.

But this specific solution (it's quite old compared to the other solution) just doesn't want to work. I've also compared the raw csproj files and am unable to see any differences.

I've also deleted all *.suo files for good measure.

Is there any other setting apart from the use global application host file that needs to be set?

Thanks for your help! :)

Nathan
  • 633
  • 7
  • 12
  • 3
    I wish you got much more praise for this. I can't tell you how many hours of time your question alone has saved. Aside from your issue with the solution file, we found that as a placeholder element works as a "False", and more odd, removing the element entirely works as a "True". – one.beat.consumer Jan 25 '16 at 23:35

2 Answers2

7

So I ran a search for UseGlobalApplicationHostFile, turns out this solution had "Store settings in Project" disabled, so there was a .csproj.user file that had the global application host file set to false.

Feeling a bit silly - but everything works as expected now!

Nathan
  • 633
  • 7
  • 12
5

Got it to work by:

  • Adding a single
    <UseGlobalApplicationHostFile>True</UseGlobalApplicationHostFile>
    in the csproj file.
  • removing the '.csproj.user' file.
  • In project properties -> Web. Setting 'Apply server settings to all users'
  • Making sure that my global applicationhost.config contains my webapp entry.
Stephane
  • 11,056
  • 9
  • 41
  • 51