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

IIS Express的配置文件称为applicationhost.config,通常位于'我的文档>IIS Express>config'目录下。在Visual Studio不同版本中,路径可能有所不同,如VS2019在解决方案根目录下,而VS2015-2017则在特定路径。可以通过.sln文件的设置影响VS2015+的applicationhost.config。另外,可通过IIS Express系统托盘图标访问配置文件路径。
摘要由CSDN通过智能技术生成

本文翻译自: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系统托盘图标(运行应用程序时),然后选择“显示所有应用程序”:

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

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

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值