找到IIS Express配置/配置数据库文件在哪里?

本文翻译自:Where is the IIS Express configuration / metabase file found?sql

哪里能够找到IIS Express配置/配置数据库文件? 数据库


#1楼

参考:https://stackoom.com/question/sJy8/找到IIS-Express配置-配置数据库文件在哪里express


#2楼

The configuration file is called applicationhost.config . 配置文件名为applicationhost.config It's stored here: 它存储在这里: app

My Documents > IIS Express > config 个人文档> IIS Express>配置 sqlserver

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+,请检查如下路径: ui

$(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,请检查如下路径: this

$(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论坛 .net


#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系统托盘图标(运行应用程序时),而后选择“显示全部应用程序”:

IIS Express系统托盘图标的上下文菜单,突出显示备选“显示全部应用程序”

Then, select the relevant application and click the applicationhost.config file path: 而后,选择相关的应用程序并单击applicationhost.config文件路径:

对话框显示arbritrary网站,附带applicationhost.config文件路径