Where is the IIS Express configuration / metabase file found?
Asked Answered
A

8

385

Where can the IIS Express configuration / metabase file be found?

Antilebanon answered 18/10, 2012 at 3:8 Comment(0)
K
131

For VS 2015 & VS 2017: Right-click the IIS Express system tray icon (when running the application), and select "Show all applications":

Context menu for IIS Express system tray icon showing the alternative "Show all applications" highlighted

Then, select the relevant application and click the applicationhost.config file path:

Dialog showing arbritrary website with accompanying applicationhost.config file path

Kalimantan answered 9/1, 2017 at 17:47 Comment(6)
Because this is the answer that will definitively get you to the right path every single time, this should be the accepted answer. – Efflorescent
@cos-callis Regarding your edit is the IIS Express system tray behavior really dependent on Visual Studio? – Kalimantan
@BjörnAliGöransson Not having a VS 2013 system up and running I can't readily go back and check but I 'know' that this works on VS 2015/17 and I 'know' that in pre-2015 the location of the config data was different. As much as anything I am frequently frustrated by questions and answers that pop up on a search where the 'accepted' answer is ancient and obsolete, therefore I felt it worth adding that 'as of today' your answer is 'valid on 2015/17' ... no promises for whether or not it will be true in VS 2019+++ :) – Closed
I get your point πŸ‘ but I think that IIS express was released with/same time as VS 2012, before that there was only Cassini - IIRC??? – Kalimantan
Check this piece of history out, from 2011: abhijitjana.net/2011/08/05/… "Visual Studio 2010 SP1 provides complete integration with IIS Express" – Kalimantan
I've made this the accepted answer, I think it's a better answer than mine (despite my answer being my main rep earner ;-) and this answer still works in 2022 – Antilebanon
A
628

The configuration file is called applicationhost.config. It's stored here:

My Documents > IIS Express > config

usually, but not always, one of these paths will work

%userprofile%\documents\iisexpress\config\applicationhost.config
%userprofile%\my documents\iisexpress\config\applicationhost.config

Update for VS2019
If you're using Visual Studio 2019+ check this path:

$(solutionDir)\.vs\{projectName}\config\applicationhost.config

Update for VS2015 (credit: @Talon)
If you're using Visual Studio 2015-2017 check this path:

$(solutionDir)\.vs\config\applicationhost.config

In Visual Studio 2015+ you can also configure which applicationhost.config file is used by altering the <UseGlobalApplicationHostFile>true|false</UseGlobalApplicationHostFile> setting in the project file (eg: MyProject.csproj). (source: MSDN forum)

Antilebanon answered 18/10, 2012 at 3:8 Comment(5)
VS2015 projects can also use global config file. There is a project setting controlling it, which you might add. – Oneirocritic
You save my day. I introduced some ASP.NET 5 (vNext) to sln, then ASP.NET 4.5 web project won't run but complain about process not run. After removing the .vs folder along with the $(solutionDir)\.vs\config\applicationhost.config, things work again. :) – Palais
For the reference, the command to start IIS Express, as per documentation): > iisexpress /config:config-file /site:site-name, where config-file is a full path to applicationhost.config. See also answer by @CosCallis about the easiest way to get this path. site-name should match one of the names in <sites> section of applicationhost.config. – Unlay
If you'd like to disable logs during development find the node and set/add enabled to false <siteDefaults> <logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" enabled="false"/> <traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="false" maxLogFileSizeKB="1024" /> </siteDefaults> – Tito
Thanks for pointing the update to VS2019 out. Was migrating and wondered why my config file didn't change the behaviour of IIS Express. – Christ
K
131

For VS 2015 & VS 2017: Right-click the IIS Express system tray icon (when running the application), and select "Show all applications":

Context menu for IIS Express system tray icon showing the alternative "Show all applications" highlighted

Then, select the relevant application and click the applicationhost.config file path:

Dialog showing arbritrary website with accompanying applicationhost.config file path

Kalimantan answered 9/1, 2017 at 17:47 Comment(6)
Because this is the answer that will definitively get you to the right path every single time, this should be the accepted answer. – Efflorescent
@cos-callis Regarding your edit is the IIS Express system tray behavior really dependent on Visual Studio? – Kalimantan
@BjörnAliGöransson Not having a VS 2013 system up and running I can't readily go back and check but I 'know' that this works on VS 2015/17 and I 'know' that in pre-2015 the location of the config data was different. As much as anything I am frequently frustrated by questions and answers that pop up on a search where the 'accepted' answer is ancient and obsolete, therefore I felt it worth adding that 'as of today' your answer is 'valid on 2015/17' ... no promises for whether or not it will be true in VS 2019+++ :) – Closed
I get your point πŸ‘ but I think that IIS express was released with/same time as VS 2012, before that there was only Cassini - IIRC??? – Kalimantan
Check this piece of history out, from 2011: abhijitjana.net/2011/08/05/… "Visual Studio 2010 SP1 provides complete integration with IIS Express" – Kalimantan
I've made this the accepted answer, I think it's a better answer than mine (despite my answer being my main rep earner ;-) and this answer still works in 2022 – Antilebanon
A
98

Since the introduction of Visual Studio 2015, this location has changed and is added into your solution root under the following location:

C:\<Path_To_Solution>\.vs\config\applicationhost.config

I hope this saves you some time!

Awesome answered 11/8, 2015 at 11:43 Comment(1)
After realising this it looks like the config in the My Documents folder is actually used as a template that is used when you setup a new project and run it up in IIS Express. You still need to keep the original one where it lives as far as I can tell, but if you want to modify the logs location for all new projects you can update this file to move them elsewhere – Devotee
M
60

To come full circle and include all versions of Visual Studio, @Myster originally stated that;

Pre Visual Studio 2015 the paths to applicationhost.config were:

%userprofile%\documents\iisexpress\config\applicationhost.config
%userprofile%\my documents\iisexpress\config\applicationhost.config

Visual Studio 2015/2017 path can be found at: (credit: @Talon)

$(solutionDir)\.vs\config\applicationhost.config

Visual Studio 2019 path can be found at: (credit: @Talon)

$(solutionDir)\.vs\config\$(ProjectName)\applicationhost.config

But the part that might get some people is that the project settings in the .sln file can repopulate the applicationhost.config for Visual Studio 2015+. (credit: @Lex Li)

So, if you make a change in the applicationhost.config you also have to make sure your changes match here:

$(solutionDir)\ProjectName.sln

The two important settings should look like:

Project("{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}") = "ProjectName", "ProjectPath\", "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"

and

VWDPort = "Port#"

What is important here is that the two settings in the .sln must match the name and bindingInformation respectively in the applicationhost.config file if you plan on making changes. There may be more places that link these two files and I will update as I find more links either by comments or more experience.

Mabel answered 29/10, 2015 at 18:56 Comment(0)
E
5

I think all the answers here are relevant however if, like me, you are looking for where Visual Studio takes the template from when it creates a new version of the applicationHost.config then you can look here:

C:\Program Files (x86)\IIS Express\config\templates\PersonalWebServer

This happens a lot if you are often working on multiple branches of the same project and pressing 'debug' in a lot of them. Making an edit here will ensure that edit propagates to any new project/solution folders that get created.

Answer indirectly came from this answer

Erek answered 12/3, 2020 at 10:40 Comment(1)
This is great, because we regularly had to modify this config file when new branches were created. Now we can have devs modify this base file and all future branches will be good! THANK YOU! – Trifoliate
A
4

For Visual Studio 2019 (v16.2.4) I was only able to find this file here:

C:\Users\\Documents\IISExpress\config\applicationhost.config applicationhost.config

Hope this helps as I wasn't able to find the .vs folder location as mentioned in the above suggestions.

Allard answered 16/9, 2019 at 18:56 Comment(1)
This is equivalent to the first suggestion of %userprofile%\documents\iisexpress\config\applicationhost.config. Although, if you run via visual studio I would expect it to use the one in the .vs directory. – Antilebanon
G
1

If you're using Rider, the config file used by IIS Express is located under your project directory at .idea/config/applicationhost.config

Gilli answered 14/11, 2022 at 16:4 Comment(0)
P
0

In Visual Studio 2019 and ASP .Net Core 5.0

<YourProjectFolder>/.vs/<YourProjectName>/config/applicationhost.config

Pictogram answered 18/8, 2022 at 22:18 Comment(0)

© 2022 - 2024 β€” McMap. All rights reserved.