我正在尝试从.NET Core启动设置中删除IIS Express配置文件,但每次重新编写解决方案时,Visual Studio都会重新添加它。例如,在新项目中,我的启动设置如下所示
{
"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部分
{
"profiles": {
"MyProject": {
"commandName": "Project",
"launchUrl": "http://localhost:5010",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
解决方案运行良好。但是一旦我关闭并重新打开解决方案,IIS部分就会重新出现。
有什么想法吗?
答案 0 :(得分:7)
<强>更新强>
应该使用Visual Studio 2017(版本15.3.0)的最新版本(更新)修复此问题。
初步回答:
这不是一个解决方案,而是一个丑陋的解决方法。我想如果我只是拒绝更改launchsettings.json
文件的权限,这将阻止Visual Studio每次都覆盖它。由于这个文件没有太大变化,对我来说这或多或少是一个令人满意的解决方案。
所以:
launchsettings.json
。希望它有所帮助。