https://we.tl/t-iC5P9BVn9Q
If you create a new blazor-server application, publish it, and then run the application on a different computer that does not have abp installed, I think you will encounter the same error.
After publishing the application, although there is a Volo.Abp.AspNetCore.Components.Server file in the publish folder, we receive an error as follows in the environment we published. In addition, the address System.IO.DirectoryNotFoundException in the error message: /Users/celalettinbilgen/.nuget/ is the address of the development computer, there is no such address in the environment we published.
Volo.Abp.AbpInitializationException: An error occurred during ConfigureServicesAsync phase of the module Volo.Abp.AspNetCore.Components.Server.AbpAspNetCoreComponentsServerModule, Volo.Abp.AspNetCore.Components.Server, Version=9.0.2.0, Culture=neutral, PublicKeyToken=null. See the inner exception for details.
---> System.IO.DirectoryNotFoundException: /Users/celalettinbilgen/.nuget/packages/volo.abp.aspnetcore.components.web/9.0.2/staticwebassets/
at Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(String root, ExclusionFilters filters)
at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.<>c.<UseStaticWebAssetsCore>b__1_0(String contentRoot)
at Microsoft.AspNetCore.StaticWebAssets.ManifestStaticWebAssetFileProvider..ctor(StaticWebAssetManifest manifest, Func2 fileProviderFactory) at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.UseStaticWebAssetsCore(IWebHostEnvironment environment, Stream manifest) at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.UseStaticWebAssets(IWebHostEnvironment environment, IConfiguration configuration) at Volo.Abp.AspNetCore.Components.Server.AbpAspNetCoreComponentsServerModule.ConfigureServices(ServiceConfigurationContext context) at Volo.Abp.Modularity.AbpModule.ConfigureServicesAsync(ServiceConfigurationContext context) at Volo.Abp.AbpApplicationBase.ConfigureServicesAsync() --- End of inner exception stack trace --- at Volo.Abp.AbpApplicationBase.ConfigureServicesAsync() at Volo.Abp.AbpApplicationFactory.CreateAsync[TStartupModule](IServiceCollection services, Action
1 optionsAction)
at Microsoft.Extensions.DependencyInjection.ServiceCollectionApplicationExtensions.AddApplicationAsync[TStartupModule](IServiceCollection services, Action1 optionsAction) at Microsoft.Extensions.DependencyInjection.WebApplicationBuilderExtensions.AddApplicationAsync[TStartupModule](WebApplicationBuilder builder, Action
1 optionsAction)
at ChatBotSuite.Blazor.Program.Main(String[] args) in /Users/celalettinbilgen/Documents/Projects/ChatBotSuite/src/ChatBotSuite.Blazor/Program.cs:line 42
Hi,
But I need to publish via tfs.
I need to both build and publish with dockerfile.
I have prepared a dockerfile as below, but I am trying to simplify it further.
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER app
WORKDIR /app
USER root
RUN adduser chatmanagementserverappuser --disabled-password --gecos "" && chown -R chatmanagementserverappuser:chatmanagementserverappuser /app
USER chatmanagementserverappuser
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
ENV DOTNET_NUGET_SIGNATURE_VERIFICATION=false
ENV NUGET_USERNAME=${NUGET_USERNAME}
ENV NUGET_PASSWORD=${NUGET_PASSWORD}
RUN dotnet nuget add source **/nuget.abp.io/index.json
RUN apt update && apt -y install nodejs gnupg yarn npm
COPY ["ChatManagementServer/ChatManagementServer.csproj", "ChatManagementServer/"]
RUN dotnet restore "./ChatManagementServer/ChatManagementServer.csproj"
COPY . .
WORKDIR "/src/ChatManagementServer"
RUN dotnet tool install -g Volo.Abp.Cli --version 8.3.2
ENV PATH="${PATH}:/root/.dotnet/tools"
RUN abp install-libs
RUN abp add-package Volo.Abp.Account.Pro.Admin.Blazor.Server
RUN dotnet build "./ChatManagementServer.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./ChatManagementServer.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
EXPOSE 5000
ENV ASPNETCORE_URLS=http://+:5000
ENTRYPOINT ["dotnet", "ChatManagementServer.dll"]
UI Type: Blazor Server
Database System: EF Core (SQL Server, Oracle, MySQL, PostgreSQL, etc..)
Template: app
Created ABP Studio Version: 0.9.19
Current ABP Studio Version: 0.9.19
Tiered: No
Multi-Tenancy: Yes
UI Framework: blazor-server
Theme: leptonx
Theme Style: system
Run Install Libs: Yes
Database Provider: ef
Database Management System: sqlserver
Separate Tenant Schema: No
Create Initial Migration: Yes
Run Db Migrator: Yes
Mobile Framework: none
Public Website: No
Include Tests: Yes
Kubernetes Configuration: Yes
Distributed Event Bus: none
Use Local References: No
Optional Modules:
GDPR
FileManagement
TextTemplateManagement
LanguageManagement
AuditLogging
OpenIddictAdmin
it worked. Thank you,
Hi,
I want to test publish the application on openshift (kubernetes) via tfs pipeline. Can you share a sample dockerfile?
Hi Liming,
I will try this.
I want to test publish the application on openshift (kubernetes). Can you share a sample dockerfile?
Video link : https://youtu.be/ITmzhxpeAwI
It will take too long to explain, so I made a video. I can't log in to the Saas Module.
It didn't work for blazor hybrid template but it works for other templates. Thanks.