Visual studio 2019 VisualStudio代码分析器发出无意义的警告
在解决方案资源管理器的“依赖项”>“分析器”下,我列出了Microsoft.AspNetCore.Anayzers和三个问题Visual studio 2019 VisualStudio代码分析器发出无意义的警告,visual-studio-2019,Visual Studio 2019,在解决方案资源管理器的“依赖项”>“分析器”下,我列出了Microsoft.AspNetCore.Anayzers和三个问题 ASP0000:不要在“ConfigureServices”中调用“IServiceCollection.BuildServiceProvider” ASP001:授权中间件配置不正确 MVC1005:无法将UseMvc与端点路由一起使用 但是,第一个和最后一个没有任何意义,因为我的Startup.cs中不存在这些问题。这些消息没有指定它们所引用的文件或行号 publ
- ASP0000:不要在“ConfigureServices”中调用“IServiceCollection.BuildServiceProvider”
- ASP001:授权中间件配置不正确
- MVC1005:无法将UseMvc与端点路由一起使用
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
// Deliberately blank to see if the message goes away. It does not.
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(
name: "default",
//pattern: "{controller=Home}/{action=Index}/{id?}");
pattern: "{action=Index}",
defaults: new { controller = "Home" });
});
}
}
我重新启动了Visual Studio,清理了解决方案,完成了代码分析和清理>对解决方案运行代码分析,以管理员身份运行VS,删除了.VS文件夹,删除了obj文件夹。看起来解决方案资源管理器的Analyzer部分完全崩溃了,因为它正在抱怨不存在的代码
是否有办法重置分析仪,或者我是否遗漏了一些明显的内容?