Visual Studio 不断将 IIS Express 添加回我的 launchsettings.json [英] Visual Studio keeps adding IIS Express back into my 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": "http://localhost:55735/",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"MyProject": {
"commandName": "Project",
"launchUrl": "http://localhost:5010",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
我删除了 IIS 部分
I remove the IIS sections
{
"profiles": {
"MyProject": {
"commandName": "Project",
"launchUrl": "http://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,发现更新失败.
希望有帮助.
这篇关于Visual Studio 不断将 IIS Express 添加回我的 launchsettings.json的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!