Doesn't seem to be an easy task to upload the docker images. any other options?
It didn't work. At this point I'm not sure what I can do. I've given you the code to reproduce the issue and not sure why the docker deploy is not working for you. At this point I've now wasted a week of development time of something that should be so trivial (display fontawesome icons).
Hi,
Assuming you have docker desktop installed/running it's just a matter of going to the root folder of the source code provided and typing the command: docker compose -f docker/docker-compose.yml up -d
As stated previously when I use the .MapAbpStaticAssets vs UseStaticFiles I get the below error and the blazor app does not run. Previously I indicated we are running in containers which is the correct testing context for this.
Is your build configuration set to Development or Production? I see in the MapAbpStaticAssets code that abp does different logic depending on which build configuration is being used.
The other aspect here why we cannot use MapAbpStaticAssets is that upon startup we need to dynamically create an appsettings.json file dependent on variable values set by docker-compose.yml. Calling MapAbpStaticAssets seems to cause the issue mentioned above regarding the Blazor.Web.js file.
That being said we just need to prefix the _content part of the the url for fa-solid-900.woff2 and bootstrap-icons.woff2 with /Blazor/_content and then I'll be all set. How can this be done as I see these files are in the global.css that gets produced somewhere within the abp framework.
My concern here is that there is a bug in abp’s source where the mapabpstaticassets method does not work as intended in a containerized (docker) environment and if you ran it in a non containerized environment it’s not a true test
What was your testing environment? This solution is currently you configured to run in docker containers. How did you run it?
So given all the screenshots and messages I provided you have no suggestions on what to try? I’ve spent all weekend trying to get this to work with no success!
As you can see from my previous screenshot the _content folder in the url is not being prefixed with the /Blazor literal. Can you commit your code to the repo so I can take a look. That makes no sense why it would work for you and not me. You’re using the feature/CurrentCompanyMiddleware branch correct?
When I use .MapAbpStaticAssets() instead of UseStaticFiles I get this error when I launch the blazor app and the last request that happens is appsettings.json
[22:47:40 INF] Request starting HTTP/1.1 GET http://localhost.structurecloud.com/Blazor/bootstrap.min.css.map - null null [22:47:40 INF] Request starting HTTP/1.1 GET http://localhost.structurecloud.com/Blazor/bootstrap.bundle.min.js.map; - null null [22:47:40 INF] Request starting HTTP/1.1 GET http://localhost.structurecloud.com/Blazor/_framework/dotnet.js - null null [22:47:40 ERR] Connection id "0HNEDBUBJDLME", Request id "0HNEDBUBJDLME:00000002": An unhandled exception was thrown by the application. System.InvalidOperationException: The request reached the end of the pipeline without executing the endpoint: ''. Please register the EndpointMiddleware using 'IApplicationBuilder.UseEndpoints(...)' if using routing. at Microsoft.AspNetCore.Builder.ApplicationBuilder.<>c.<Build>b__25_0(HttpContext context) at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Components.WebAssembly.Server.ContentEncodingNegotiator.InvokeAsync(HttpContext context) at Microsoft.AspNetCore.Builder.ComponentsWebAssemblyApplicationBuilderExtensions.<>c__DisplayClass3_0.<<UseBlazorFrameworkFiles>b__2>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Builder.Extensions.UsePathBaseMiddleware.InvokeCore(HttpContext context, PathString matchedPath, PathString remainingPath) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application) [22:47:40 INF] Request finished HTTP/1.1 GET http://localhost.structurecloud.com/Blazor/_framework/dotnet.js - 500 0 null 3.4968ms ****** Request Path: /bootstrap.min.css.map ****** Request Path: /bootstrap.bundle.min.js.map; [22:47:41 INF] Request finished HTTP/1.1 GET http://localhost.structurecloud.com/Blazor/bootstrap.min.css.map - 404 0 null 356.8818ms [22:47:41 INF] Request finished HTTP/1.1 GET http://localhost.structurecloud.com/Blazor/bootstrap.bundle.min.js.map; - 404 0 null 334.6612ms [22:47:41 INF] Request reached the end of the middleware pipeline without being handled by application code. Request path: GET http://localhost.structurecloud.com/Blazor/bootstrap.bundle.min.js.map;, Response status code: 404 [22:47:41 INF] Request reached the end of the middleware pipeline without being handled by application code. Request path: GET http://localhost.structurecloud.com/Blazor/bootstrap.min.css.map, Response status code: 404
Any update?
When I comment out the .UseStatic files and use .MapAppStaticAssets as you suggested, I get an error in the browser and the blazor wasm app does not run.
app.UseHttpsRedirection();
app.UsePathBase("/Blazor");
//app.UseStaticFiles();
app.UseRouting();
app.MapAbpStaticAssets();
app.UseAntiforgery();
app.UseAbpSecurityHeaders();
I've forked a repository on git and send you an invite to colloborate. The branch you want to use is feature/CurrentCompanyMiddleware
[maliming] said: hi
What is your abp packages version? As mentioned in the ticket parameters we are using 9.1.0
app.UsePathBase("/Blazor");
What is the reason you use this? We are using this because we will be hosting multiple blazor wasm apps on the same domain so we want to seperate them out with a subdomain if you will (structurecloud.com/Blazor, strucutrecloud/Maintenance, etc)
We have used
MapAbpStaticAssets
to replaceUseStaticFiles
app.UsePathBase("/Blazor"); app.UseStaticFiles(); app.UseRouting();
I have tried this and now the pipeline just ends
[11:54:00 INF] Executing endpoint 'Microsoft.AspNetCore.Routing.RouteEndpoint' [11:54:00 INF] The file CFData.Structure.Blazor.Client.styles.css was not modified [11:54:00 INF] Executed endpoint 'Microsoft.AspNetCore.Routing.RouteEndpoint' [11:54:00 INF] Request finished HTTP/1.1 GET http://localhost.structurecloud.com/Blazor/CFData.Structure.Blazor.Client.styles.css - 304 null text/css 0.6089ms [11:54:00 INF] Request starting HTTP/1.1 GET http://localhost.structurecloud.com/Blazor/_framework/dotnet.runtime.js.map - null null [11:54:00 INF] Request starting HTTP/1.1 GET http://localhost.structurecloud.com/Blazor/_framework/dotnet.js.map - null null [11:54:00 INF] Request starting HTTP/1.1 GET http://localhost.structurecloud.com/Blazor/bootstrap.bundle.min.js.map; - null null [11:54:00 INF] Request starting HTTP/1.1 GET http://localhost.structurecloud.com/Blazor/bootstrap.min.css.map - null null [11:54:00 INF] Request finished HTTP/1.1 GET http://localhost.structurecloud.com/Blazor/bootstrap.bundle.min.js.map; - 404 0 null 348.2756ms [11:54:00 INF] Request finished HTTP/1.1 GET http://localhost.structurecloud.com/Blazor/_framework/dotnet.runtime.js.map - 404 0 null 348.4521ms [11:54:00 INF] Request finished HTTP/1.1 GET http://localhost.structurecloud.com/Blazor/_framework/dotnet.js.map - 404 0 null 348.4732ms [11:54:00 INF] Request finished HTTP/1.1 GET http://localhost.structurecloud.com/Blazor/bootstrap.min.css.map - 404 0 null 286.0777ms [11:54:00 INF] Request reached the end of the middleware pipeline without being handled by application code. Request path: GET http://localhost.structurecloud.com/Blazor/bootstrap.min.css.map, Response status code: 404 [11:54:00 INF] Request reached the end of the middleware pipeline without being handled by application code. Request path: GET http://localhost.structurecloud.com/Blazor/bootstrap.bundle.min.js.map;, Response status code: 404 [11:54:00 INF] Request reached the end of the middleware pipeline without being handled by application code. Request path: GET http://localhost.structurecloud.com/Blazor/_framework/dotnet.runtime.js.map, Response status code: 404 [11:54:00 INF] Request reached the end of the middleware pipeline without being handled by application code. Request path: GET http://localhost.structurecloud.com/Blazor/_framework/dotnet.js.map, Response status code: 404
Can you share a project I can download and check it?
liming.ma@volosoft.com Thanks