Visual Studio不断将IIS Express重新添加到我的launchsettings.json中

编程入门 行业动态 更新时间:2024-10-28 18:36:50
本文介绍了Visual Studio不断将IIS Express重新添加到我的launchsettings.json中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我试图从.NET Core启动设置中删除IIS Express配置文件,但是每次我提出该解决方案时,Visual Studio都将其重新添加回去。例如,在一个新项目中,我的启动设置如下:

I am trying to remove the IIS Express profile from my .NET Core launch settings but every time i repoen the solution, Visual Studio adds it back in again. For example, in a new project my launch settings looks like this

{ "iisSettings": { "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { "applicationUrl": "localhost:55735/", "sslPort": 0 } }, "profiles": { "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } }, "MyProject": { "commandName": "Project", "launchUrl": "localhost:5010", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } } } }

我删除了IIS部分

{ "profiles": { "MyProject": { "commandName": "Project", "launchUrl": "localhost:5010", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } } } }

该解决方案运行良好。但是,一旦我关闭并重新打开解决方案,IIS部分就会重新出现。

The solution runs fine. But as soon as I close and reopen the solution the IIS sections reappear.

有什么想法吗?

推荐答案

更新:

该问题应通过Visual Studio 2017(版本)的最新版本(更新)解决。 15.3.0)。

The issue should be fixed with the latest release (update) of Visual Studio 2017 (version 15.3.0).

初始答案:

这不是解决方案,但这是一个丑陋的解决方法。我认为,如果我只是拒绝更改 launchsettings.json 文件的权限,这将防止Visual Studio每次覆盖它。由于此文件变化不大,因此对我来说还是一个令人满意的解决方案。

This is not a solution, but an ugly workaround. I figured that if I would just deny permissions to change the launchsettings.json file this will prevent Visual Studio from overwriting it every time. Since this file doesn't change much, it is more or less a satisfying solution for me.

所以:

  • 最后一次更新您的 launchsettings.json 。
  • 关闭Visual Studio。
  • 打开安全设置(在资源管理器->属性->安全性中右键单击launchsettings.json)
  • 单击高级->更改权限
  • 从权限条目列表中选择授权用户(或在您的计算机上运行Visual Studio的其他用户组),然后单击编辑->
  • 检查拒绝创建文件/写入数据权限。
  • 在所有打开的对话框和警告中单击确定以保存更改。
  • 重新打开Visual Studio并查看
  • Update your launchsettings.json for the last time.
  • Close Visual Studio.
  • Open security settings (right-click on launchsettings.json in Explorer -> Properties -> Security)
  • Click Advanced -> Change Permissions
  • Select "Authenticated Users" (or other user group under which Visual Studio is running on your machine) from the "Permissions entries" list and click Edit ->
  • Check Deny for "Create files / write data" permission.
  • Click OK in all open dialogs and warnings to save changes.
  • Reopen Visual Studio and see it fail to do it's update.
  • 希望它会有所帮助。

    更多推荐

    Visual Studio不断将IIS Express重新添加到我的launchsettings.json中

    本文发布于:2023-11-09 09:05:21,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1571978.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:IIS   Studio   Visual   json   launchsettings

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!