首页 文章

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

提问于
浏览
289

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

4 回答

  • 89

    配置文件名为 applicationhost.config . 它存储在这里:

    我的文档> IIS Express>配置

    通常,但并非总是如此,这些路径之一将起作用

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

    Update for VS2015 (credit: @Talon)
    如果您使用的是Visual Studio 2015,请检查以下路径:

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

    在Visual Studio 2015中,您还可以通过更改项目文件中的 <UseGlobalApplicationHostFile>true|false</UseGlobalApplicationHostFile> 设置来配置使用哪个 applicationhost.config 文件(例如:MyProject.csproj) . (来源:MSDN forum

  • 41

    自Visual Studio 2015推出以来,此位置已更改,并已添加到以下位置的解决方案根目录中:

    C:\<Path\To\Solution>\.vs\config\applicationhost.config
    

    我希望这能节省你一些时间!

  • 63

    For VS 2015 & VS 2017 :右键单击IIS Express系统托盘图标(运行应用程序时),然后选择"Show all applications":

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

    然后,选择相关的应用程序并单击applicationhost.config文件路径:

    Dialog showing arbritrary website with accompanying applicationhost.config file path

  • 503

    为了完整循环并包含所有版本的Visual Studio, @Myster 最初表示;

    Pre Visual Studio 2015 applicationhost.config的路径是:

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

    Visual Studio 2015+ 路径可在以下位置找到:( credit: @Talon

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

    但是可能会让某些人获得的部分是.sln文件中的项目设置可以重新填充 Visual Studio 2015+ 的applicationhost.config . ( credit: @Lex Li

    因此,如果您在applicationhost.config中进行更改,则还必须确保您的更改符合以下条件:

    $(solutionDir)\ProjectName.sln
    

    两个重要设置应如下所示:

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

    VWDPort = "Port#"
    

    这里重要的是,如果您计划进行更改,.sln中的两个设置必须分别与applicationhost.config文件中的name和bindingInformation匹配 . 可能有更多地方链接这两个文件,我会更新,因为我通过评论或更多经验找到更多链接 .

相关问题