Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.net6中报错 #278

Open
billsking opened this issue Dec 9, 2021 · 1 comment
Open

.net6中报错 #278

billsking opened this issue Dec 9, 2021 · 1 comment

Comments

@billsking
Copy link

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

@pygzfei
Copy link
Contributor

pygzfei commented May 9, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants