Nathan
Nathan

Reputation: 663

Visual Studio 2015 debugger uses local applicationhost.config instead of Global Configuration

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! :)

Upvotes: 17

Views: 6601

Answers (2)

Steph
Steph

Reputation: 12222

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.

Upvotes: 5

Nathan
Nathan

Reputation: 663

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!

Upvotes: 7

Related Questions