I am trying to create webapplication that consume dynamic proxy , and when I run the app I get this error
System.AggregateException
HResult=0x80131500
Message=Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: Volo.Abp.Http.ProxyScripting.IProxyScriptManager Lifetime: Transient ImplementationType: Volo.Abp.Http.ProxyScripting.ProxyScriptManager': Unable to resolve service for type 'Volo.Abp.Http.Modeling.IApiDescriptionModelProvider' while attempting to activate 'Volo.Abp.Http.ProxyScripting.ProxyScriptManager'.) (Error while validating the service descriptor 'ServiceType: Volo.Abp.Http.ProxyScripting.ProxyScriptManager Lifetime: Transient ImplementationType: Volo.Abp.Http.ProxyScripting.ProxyScriptManager': Unable to resolve service for type 'Volo.Abp.Http.Modeling.IApiDescriptionModelProvider' while attempting to activate 'Volo.Abp.Http.ProxyScripting.ProxyScriptManager'.)
Source=Microsoft.Extensions.DependencyInjection
StackTrace:
at Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(ICollection`1 serviceDescriptors, ServiceProviderOptions options)
at Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(IServiceCollection services, ServiceProviderOptions options)
at Microsoft.Extensions.Hosting.HostApplicationBuilder.Build()
at Microsoft.AspNetCore.Builder.WebApplicationBuilder.Build()
at Program.<<Main>$>d__0.MoveNext() in TestHarness.Api.Host\Program.cs:line 18
This exception was originally thrown at this call stack: [External Code]
Inner Exception 1:
InvalidOperationException: Error while validating the service descriptor 'ServiceType: Volo.Abp.Http.ProxyScripting.IProxyScriptManager Lifetime: Transient ImplementationType: Volo.Abp.Http.ProxyScripting.ProxyScriptManager': Unable to resolve service for type 'Volo.Abp.Http.Modeling.IApiDescriptionModelProvider' while attempting to activate 'Volo.Abp.Http.ProxyScripting.ProxyScriptManager'.
Inner Exception 2:
InvalidOperationException: Unable to resolve service for type 'Volo.Abp.Http.Modeling.IApiDescriptionModelProvider' while attempting to activate 'Volo.Abp.Http.ProxyScripting.ProxyScriptManager'.
program.cs :
using Cao.CatOs.TestHarness.Api.Host.Modules;
using Volo.Abp;
var builder = WebApplication.CreateBuilder(args);
await builder.AddApplicationAsync<CatOsHttpApiClientTestModule>(options =>
{
var configurationBuilder = new ConfigurationBuilder();
configurationBuilder.AddJsonFile("appsettings.json", false);
configurationBuilder.AddJsonFile("appsettings.secrets.json", true);
options.Services.ReplaceConfiguration(configurationBuilder.Build());
options.UseAutofac();
options.ApplicationName = "test";
});
var application = builder.Build();
await application.InitializeAsync();
Console.WriteLine("Press ENTER to stop application...");
Console.ReadLine();
await application.WaitForShutdownAsync();
Module :
public class CatOsHttpApiClientTestModule : AbpModule
{
private readonly string RemoteServiceName = "Default";
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddHttpClientProxies(
typeof(CatOsApplicationContractsModule).Assembly,
RemoteServiceName
);
context.Services.AddAutofac();
context.Services.AddControllers();
context.Services.AddEndpointsApiExplorer();
context.Services.AddHttpContextAccessor();
context.Services.AddScoped<ScenarioManager>();
context.Services.AddSwaggerGen(options =>
{
options.AddSecurityDefinition(
"Bearer",
new Microsoft.OpenApi.Models.OpenApiSecurityScheme
{
Name = "Authorization",
Type = Microsoft.OpenApi.Models.SecuritySchemeType.Http,
Scheme = "Bearer",
BearerFormat = "JWT",
In = Microsoft.OpenApi.Models.ParameterLocation.Header,
Description =
"Enter 'Bearer' [space] and then your token in the text input below.\n\nExample: 'Bearer 12345abcdef'",
}
);
options.AddSecurityRequirement(
new Microsoft.OpenApi.Models.OpenApiSecurityRequirement
{
{
new Microsoft.OpenApi.Models.OpenApiSecurityScheme
{
Reference = new Microsoft.OpenApi.Models.OpenApiReference
{
Type = Microsoft.OpenApi.Models.ReferenceType.SecurityScheme,
Id = "Bearer",
},
},
new string[] { }
},
}
);
});
context.Services.AddHttpClient(
"catos",
(sp, client) =>
{
var scenarioManager = sp.GetRequiredService<ScenarioManager>();
var configuration = sp.GetRequiredService<IConfiguration>();
client.BaseAddress = new Uri(
configuration.GetValue<string>("RemoteServices:Default:BaseUrl")
);
var jwtToken = scenarioManager.GetOrCreate().StringData[
ScenarioContext.AccessToken
];
client.DefaultRequestHeaders.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", jwtToken);
}
);
}
Can you please share your hardware configuration that the Redis server was running on ? (CPU/RAM)
Application was sent to your email , please let me know if you have any finding.
**Our team is now fully blocked, and we need either a fix or an efficient work around **
We have upgraded to v 9.1.1 and we have found the enum is not generating right although in this bug it is marked as resolved, but we have exact same problem , all enum types are just generated as enum instead of their strong type.
https://github.com/abpframework/abp/issues/21995
please advise , this is urgent
I have to get approval to share the project , can you confirm you got the log file ? also would you be able to point me where in the source code this method use cache in ABP source code ? I want to have a look.
I shared the log where redis is run locally Please check your email
Sound like v 9.1.1 is dependent on v 1.8.17 , please check the image, also if I update to 1.8.18 I get version conflict because v 9.1.1 want Hangfire v 1.8.17. please let me know if I missed something
As for reverting to our original version 1.8.14 , that not possible because v9.1.1 require 1.8.17 version as we stated above. Please advise. thanks
We run it on multiple machine even on azure instance, the Redis is not busy and there is no explanation why request takes all this time, and when we disable the Redis the request get served faster
Hi , there is the log with verbose level , during this log, I have requested the API mentioned mentioned above . https://condominiumauthorityontario.sharepoint.com/:t:/s/ITDeptExternalSharingSite/EcT_lo1I5-NPtNPXN_MbWXsBnZgrf-tgWJMMkktq7U1-iA?e=dC0tNc