AspectCore-Framework icon indicating copy to clipboard operation
AspectCore-Framework copied to clipboard

.net6中报错

Open billsking opened this issue 4 years ago • 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();`

billsking avatar Dec 09 '21 08:12 billsking

异常信息: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());

pygzfei avatar May 09 '22 11:05 pygzfei