英文:
When I create new asp.net core web api I got this error System.InvalidOperationException: 'Configuration value 'information /M' is not supported.'
问题
在程序文件中,我有以下代码:
var builder = WebApplication.CreateBuilder(args);
// 将服务添加到容器中。
builder.Services.AddControllers();
var app = builder.Build();
// 配置 HTTP 请求管道。
app.UseAuthorization();
app.MapControllers();
app.Run();
第 7 行出现了以下错误:
System.InvalidOperationException: 'Configuration value 'information /M' is not supported.'
以及 appsetting 文件:
{
"Logging": {
"LogLevel": {
"Default": "Debug",
"Microsoft.AspNetCore": "Debug"
}
},
"AllowedHosts": "*"
}
所以我已经修复了 Visual Studio,然后修复了 SDK 版本 6,但没有解决问题。这是链接:https://ibb.co/xq2scZ3,提前感谢。
英文:
in the program file i have the below code
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
var app = builder.Build();
// Configure the HTTP request pipeline.
app.UseAuthorization();
app.MapControllers();
app.Run();
in the line of 7 I got this error.
System.InvalidOperationException: 'Configuration value 'information /M' is not supported.'
and appsetting file.
{
"Logging": {
"LogLevel": {
"Default": "Debug",
"Microsoft.AspNetCore": "Debug"
}
},
"AllowedHosts": "*"
}
so I have repaired the visual stadio and then I have repaired Sdk version 6 but it did not work.
it is the link. https://ibb.co/xq2scZ3
thank you in advance.
答案1
得分: 1
我已更改我在Windows上登录的用户,它起作用了。
英文:
I have changed the user which i have signed in in windows and it worked.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论