Base solution for your next web application

Activities of "magicang"

Thanks Maliming!

Another error message in log file "System.InvalidOperationException: A CORS policy named 'localhost' could not be found."

Thanks maliming!

However, there is another error appear after amend as above.

In Angular, the error message showing "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:91/DXXRDV. (Reason: CORS header 'Access-Control-Allow-Origin' missing)", refer to below image:

While Asp.Net Core show error message "Castle.MicroKernel.ComponentNotFoundException: No component for supporting the service FlexiCloud.Web.Host.Controllers.CustomWebDocumentViewerController was found", please refer to attached logs file.

https://www.dropbox.com/s/xngoqde361csrxj/Logs.txt?dl=0

There is an error when replace with options.AddDefaultPolicy(

Please click below dropbox link to download my Demo project. FYI, these 2 projects running in 2 different port:

Demo project source code: ~~delete~~

Asp.net zero: http://localhost:91

Angular: http://localhost:4200

Thank you!

Dear Sir, I'm using asp.net zero for my below projects:

  1. Project have API Controller using .Netcore 2.2 (Backend)
  2. Project have Fontend using Angular 6 to call API in Project 1 (Frontend)

I add in devexpress report into my projects, and call the report from angular to .netcore project. However, there is an error message in .netcore logs file. Below is the error message:

INFO 2019-08-28 11:48:34,030 [34 ] .Mvc.Infrastructure.ObjectResultExecutor - Executing ObjectResult, writing value of type 'Abp.Web.Models.AjaxResponse'. INFO 2019-08-28 11:48:34,048 [34 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action FlexiCloud.Web.Host.Controllers.ReportDesignerController.GetReportDesignerModel (FlexiCloud.Web.Host) in 272.3821ms INFO 2019-08-28 11:48:34,049 [34 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 301.443ms 500 application/json; charset=utf-8 INFO 2019-08-28 11:48:34,049 [34 ] Microsoft.AspNetCore.Server.Kestrel - Connection id "0HLPBD7I7OOVF", Request id "0HLPBD7I7OOVF:00000002": the application completed without reading the entire request body. INFO 2019-08-28 11:48:39,964 [37 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 POST http://localhost:91/DXXRDV application/x-www-form-urlencoded; charset=UTF-8 38 WARN 2019-08-28 11:48:39,964 [37 ] pNetCore.Cors.Infrastructure.CorsService - The CORS protocol does not allow specifying a wildcard (any) origin and credentials at the same time. Configure the policy by listing individual origins if credentials needs to be supported. INFO 2019-08-28 11:48:39,964 [37 ] pNetCore.Cors.Infrastructure.CorsService - CORS policy execution successful. INFO 2019-08-28 11:48:39,969 [37 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {action = "Invoke", controller = "CustomWebDocumentViewer", area = ""}. Executing action FlexiCloud.Web.Host.Controllers.CustomWebDocumentViewerController.Invoke (FlexiCloud.Web.Host) INFO 2019-08-28 11:48:39,969 [37 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action FlexiCloud.Web.Host.Controllers.CustomWebDocumentViewerController.Invoke (FlexiCloud.Web.Host) in 0.1311ms ERROR 2019-08-28 11:48:39,970 [37 ] Microsoft.AspNetCore.Server.Kestrel - Connection id "0HLPBD7I7OOVF", Request id "0HLPBD7I7OOVF:00000003": An unhandled exception was thrown by the application. System.InvalidOperationException: A CORS policy named '' could not be found. at Microsoft.AspNetCore.Mvc.Cors.CorsAuthorizationFilter.OnAuthorizationAsync(AuthorizationFilterContext context) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync() at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context) at DevExpress.AspNetCore.Internal.BinaryStorageMiddleware.Invoke(HttpContext httpContext) at DevExpress.AspNetCore.Internal.ResourceManagerMiddleware.Invoke(HttpContext httpContext) at Abp.AspNetZeroCore.Web.Authentication.JwtBearer.JwtTokenMiddleware.<&gt;c__DisplayClass0_0.&lt;b__0&gt;d.MoveNext()

--- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Abp.AspNetCore.Security.AbpSecurityHeadersMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.InvokeCore(HttpContext context) at Microsoft.AspNetCore.Server.IISIntegration.IISMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application) INFO 2019-08-28 11:48:39,971 [37 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 6.6044ms 500 INFO 2019-08-28 11:48:39,971 [37 ] Microsoft.AspNetCore.Server.Kestrel - Connection id "0HLPBD7I7OOVF", Request id "0HLPBD7I7OOVF:00000003": the application completed without reading the entire request body. INFO 2019-08-28 12:09:18,982 [95 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 POST http://127.0.0.1:3753/iisintegration 0

Please advise. Thank you.

Showing 1 to 5 of 5 entries