When I create new asp.net core web api I got this error System.InvalidOperationException: 'Configuration value 'information /M' is not supported.'

huangapple go评论55阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年5月17日 14:14:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/76269036.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定