Open Closed

How to Deploy .Net 6.0 web api Application on windows server IIS #3448


User avatar
0
vipulbuoyancy created
  • ABP Framework version: v5.2.2
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

Hello,

I try deploy my .Net 6.0 web API application (ABP Framework) on windows server IIS. when I browse it as http://mywebsite.com or https://mywebsite.com:44388, I get the following errors:

1)

2)

Most likely causes: •The website is under maintenance. •The website has a programming error.

please help for fix this error

Thanks


6 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please refer to the microsoft document https://docs.microsoft.com/en-us/aspnet/core/tutorials/publish-to-iis?view=aspnetcore-6.0&tabs=visual-studio https://docs.microsoft.com/en-us/troubleshoot/developer/webapps/iis/health-diagnostic-performance/http-error-500-19-webpage

  • User Avatar
    0
    vipulbuoyancy created

    hi,

    I faced error

    2022-07-20 02:52:34.184 -07:00 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name UBX_Client_Angular Health Status. System.InvalidOperationException: An invalid request URI was provided. Either the request URI must be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetAsync(Uri requestUri, HttpCompletionOption completionOption) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReportAsync(HealthCheckConfiguration configuration) in /_/src/HealthChecks.UI/Core/HostedService/HealthCheckReportCollector.cs:line 96

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    https://support.abp.io/QA/Questions/3327/

  • User Avatar
    0
    vipulbuoyancy created

    Hi

    I can try this code

    var healthChecksUiBuilder = services.AddHealthChecksUI(settings =>
    {
        settings.AddHealthCheckEndpoint("MyProjectName Health Status", "https://yourwebsite.com/health-status");
    });
    services.MapHealthChecksUiEndpoints(options =>
    {
        options.UIPath = "https://yourwebsite.com/health-ui";
        options.ApiPath = "https://yourwebsite.com/health-api";
    });
    

    error:

    2022-07-20 03:39:56.518 -07:00 [FTL] Application startup exception
    Volo.Abp.AbpInitializationException: An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor phase of the module UBX_Client_Angular.UBX_Client_AngularHttpApiHostModule, UBX_Client_Angular.HttpApi.Host, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: The value for customized path can't be null and need to start with / character. (Parameter 'ApiPath'). See the inner exception for details.
     ---> System.ArgumentException: The value for customized path can't be null and need to start with / character. (Parameter 'ApiPath')
       at Microsoft.AspNetCore.Builder.EndpointRouteBuilderExtensions.<>c.<EnsureValidApiOptions>b__1_0(String path, String argument) in /_/src/HealthChecks.UI/Extensions/EndpointRouteBuilderExtensions.cs:line 63
       at Microsoft.AspNetCore.Builder.EndpointRouteBuilderExtensions.EnsureValidApiOptions(Options options) in /_/src/HealthChecks.UI/Extensions/EndpointRouteBuilderExtensions.cs:line 59
       at Microsoft.AspNetCore.Builder.EndpointRouteBuilderExtensions.MapHealthChecksUI(IEndpointRouteBuilder builder, Action`1 setupOptions) in /_/src/HealthChecks.UI/Extensions/EndpointRouteBuilderExtensions.cs:line 17
       at UBX_Client_Angular.HealthChecks.HealthChecksBuilderExtensions.&lt;&gt;c__DisplayClass2_0.&lt;MapHealthChecksUiEndpoints&gt;b__1(EndpointRouteBuilderContext endpointContext) in D:\Projects\UBX\aspnet-core\src\UBX_Client_Angular.HttpApi.Host\HealthChecks\HealthChecksBuilderExtensions.cs:line 67
       at Microsoft.AspNetCore.Builder.AbpAspNetCoreApplicationBuilderExtensions.&lt;&gt;c__DisplayClass0_0.&lt;UseConfiguredEndpoints&gt;b__0(IEndpointRouteBuilder endpoints)
       at Microsoft.AspNetCore.Builder.EndpointRoutingApplicationBuilderExtensions.UseEndpoints(IApplicationBuilder builder, Action`1 configure)
       at Microsoft.AspNetCore.Builder.AbpAspNetCoreApplicationBuilderExtensions.UseConfiguredEndpoints(IApplicationBuilder app, Action`1 additionalConfigurationAction)
       at UBX_Client_Angular.UBX_Client_AngularHttpApiHostModule.OnApplicationInitialization(ApplicationInitializationContext context) in D:\Projects\UBX\aspnet-core\src\UBX_Client_Angular.HttpApi.Host\UBX_Client_AngularHttpApiHostModule.cs:line 279
       at Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor.Initialize(ApplicationInitializationContext context, IAbpModule module)
       at Volo.Abp.Modularity.ModuleManager.InitializeModules(ApplicationInitializationContext context)
       --- End of inner exception stack trace ---
       at Volo.Abp.Modularity.ModuleManager.InitializeModules(ApplicationInitializationContext context)
       at Volo.Abp.AbpApplicationBase.InitializeModules()
       at Volo.Abp.AbpApplicationWithExternalServiceProvider.Initialize(IServiceProvider serviceProvider)
       at Microsoft.AspNetCore.Builder.AbpApplicationBuilderExtensions.InitializeApplication(IApplicationBuilder app)
       at UBX_Client_Angular.Startup.Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) in D:\Projects\UBX\aspnet-core\src\UBX_Client_Angular.HttpApi.Host\Startup.cs:line 17
       at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
       at Microsoft.AspNetCore.Hosting.ConfigureBuilder.<>c__DisplayClass4_0.<Build>b__0(IApplicationBuilder builder)
       at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass15_0.<UseStartup>b__1(IApplicationBuilder app)
       at Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.<Configure>g__MiddlewareFilterBuilder|0(IApplicationBuilder builder)
       at Microsoft.AspNetCore.Server.IIS.Core.IISServerSetupFilter.<>c__DisplayClass2_0.<Configure>b__0(IApplicationBuilder app)
       at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
       at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
       at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
       at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
       at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
       at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
       at UBX_Client_Angular.Program.Main(String[] args) in D:\Projects\UBX\aspnet-core\src\UBX_Client_Angular.HttpApi.Host\Program.cs:line 32
    

    thanks

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    You can check this: https://support.abp.io/QA/Questions/3327/#answer-51baf847-087a-2aa1-1d76-3a04d9420894

  • User Avatar
    0
    vipulbuoyancy created

    Hi,

    You can check this: https://support.abp.io/QA/Questions/3327/#answer-51baf847-087a-2aa1-1d76-3a04d9420894

    hi

    This code is working for me.

    Thank you

Made with ❤️ on ABP v9.1.0-preview. Updated on December 12, 2024, 07:15