Where can the IIS Express configuration / metabase file be found?
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)
For VS 2015 & VS 2017: Right-click the IIS Express system tray icon (when running the application), and select "Show all applications":
https://i.stack.imgur.com/vRzie.png
Then, select the relevant application and click the applicationhost.config file path:
https://i.stack.imgur.com/9NfDS.png
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!
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.
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
For Visual Studio 2019 (v16.2.4) I was only able to find this file here:
https://i.stack.imgur.com/b4d4H.png
Hope this helps as I wasn't able to find the .vs folder location as mentioned in the above suggestions.
%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.
Success story sharing
> iisexpress /config:config-file /site:site-name
, whereconfig-file
is a full path toapplicationhost.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 ofapplicationhost.config
.<siteDefaults> <logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" enabled="false"/> <traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="false" maxLogFileSizeKB="1024" /> </siteDefaults>