.net6中报错
billsking opened this issue · 1 comments
异常信息:IL 变量在当前本机 IP 上不可用。 (异常来自 HRESULT:0x80131304). The error code is CORDBG_E_IL_VAR_NOT_AVAILABLE, or0x80131304.
`using AspectCore.Configuration;
using AspectCore.Extensions.DependencyInjection;
using WebApplication1;
var builder = WebApplication
.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
//仅增加了一行代码。
builder.Services.BuildDynamicProxyProvider();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();
app.Run();`
异常信息:IL 变量在当前本机 IP 上不可用。 (异常来自 HRESULT:0x80131304). The error code is CORDBG_E_IL_VAR_NOT_AVAILABLE, or0x80131304.
`using AspectCore.Configuration; using AspectCore.Extensions.DependencyInjection; using WebApplication1;
var builder = WebApplication .CreateBuilder(args);
// Add services to the container. builder.Services.AddControllers(); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); //仅增加了一行代码。 builder.Services.BuildDynamicProxyProvider(); var app = builder.Build();
// Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { app.UseSwagger(); app.UseSwaggerUI(); }
app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();
app.Run();`
builder.Host.UseServiceProviderFactory(new DynamicProxyServiceProviderFactory());