Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 289
Nathan Avatar asked Oct 05 '15 01:10

Nathan


2 Answers

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!

like image 86
Nathan Avatar answered Nov 10 '22 19:11

Nathan


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.
like image 44
Stephane Avatar answered Nov 10 '22 21:11

Stephane