本文翻译自:Where is the IIS Express configuration / metabase file found?
哪里可以找到IIS Express配置/配置数据库文件?
#1楼
参考:https://stackoom.com/question/sJy8/找到IIS-Express配置-配置数据库文件在哪里
#2楼
The configuration file is called applicationhost.config . 配置文件名为applicationhost.config 。 It's stored here: 它存储在这里:
My Documents > IIS Express > config 我的文档> IIS Express>配置
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 VS2019的更新
If you're using Visual Studio 2019+ check this path: 如果您使用的是Visual Studio 2019+,请检查以下路径:
$(solutionDir)\.vs\{projectName}\config\applicationhost.config
Update for VS2015 (credit: @Talon) VS2015更新(来源:@Talon)
If you're using Visual Studio 2015-2017 check this path: 如果您使用的是Visual Studio 2015-2017,请检查以下路径:
$(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). 在Visual Studio 2015+中,您还可以通过更改项目文件中的<UseGlobalApplicationHostFile>true|false</UseGlobalApplicationHostFile>
设置来配置使用哪个applicationhost.config文件(例如:MyProject.csproj)。 (source: MSDN forum ) (来源: MSDN论坛 )
#3楼
Since the introduction of Visual Studio 2015, this location has changed and is added into your solution root under the following location: 自Visual Studio 2015推出以来,此位置已更改,并已添加到以下位置的解决方案根目录中:
C:\<Path\To\Solution>\.vs\config\applicationhost.config
I hope this saves you some time! 我希望这能节省你一些时间!
#4楼
To come full circle and include all versions of Visual Studio, @Myster originally stated that; 为了完整循环并包含所有版本的Visual Studio, @ Myter最初表示;
Pre Visual Studio 2015 the paths to applicationhost.config were: 在Visual Studio 2015之前 ,applicationhost.config的路径是:
%userprofile%\documents\iisexpress\config\applicationhost.config
%userprofile%\my documents\iisexpress\config\applicationhost.config
Visual Studio 2015/2017 path can be found at: ( credit: @Talon ) Visual Studio 2015/2017路径可在以下位置找到:( credit:@Talon )
$(solutionDir)\.vs\config\applicationhost.config
Visual Studio 2019 path can be found at: ( credit: @Talon ) 可以在以下位置找到Visual Studio 2019路径:( 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+ . 但是可能会让某些人获得的部分是.sln文件中的项目设置可以重新填充Visual Studio 2015+的applicationhost.config 。 ( credit: @Lex Li ) ( 信用:@Lex Li )
So, if you make a change in the applicationhost.config you also have to make sure your changes match here: 因此,如果您在applicationhost.config中进行更改,则还必须确保您的更改符合以下条件:
$(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. 这里重要的是,如果您计划进行更改,.sln中的两个设置必须分别与applicationhost.config文件中的name和bindingInformation匹配。 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. 可能有更多地方链接这两个文件,我会更新,因为我通过评论或更多经验找到更多链接。
#5楼
For VS 2015 & VS 2017 : Right-click the IIS Express system tray icon (when running the application), and select "Show all applications": 对于VS 2015和VS 2017 :右键单击IIS Express系统托盘图标(运行应用程序时),然后选择“显示所有应用程序”:
Then, select the relevant application and click the applicationhost.config file path: 然后,选择相关的应用程序并单击applicationhost.config文件路径: