Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

505
Vistas
Deploy Blazor Client(WebAssembly) on Docker that time facing issue

When I deploy/run the project on Docker that time I am facing an issue. Facing issues like,

Cannot use file stream for [/app/bin/Debug/net6.0/projectname.deps.json]: No such file or directory A fatal error was encountered. The library 'libhostpolicy.so' required to execute the application was not found in '/app/bin/Debug/net6.0/'. Failed to run as a self-contained app.

  • The application was run as a self-contained app because '/app/bin/Debug/net6.0/projectname.runtimeconfig.json' was not found.
  • If this should be a framework-dependent app, add the '/app/bin/Debug/net6.0/projectname.runtimeconfig.json' file and specify the appropriate framework.

and face issue when I run a project with docker on Visual Studio 2022.

face issue when I run project with docker on Visual Studio 2022.

If anyone has an idea about his please share it with me.

Thanks in Advance.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Add Docker File with Nginx Reverse Proxy Server

For Blazor Web Assembly we need to add "nginx.conf" in Project root folder

events { }
http {
   include mime.types;
   types {
      application/wasm wasm;
   }
   server {
      listen 80;
     # Here, we set the location for Nginx to serve the files looking for index.html
     location / {
        root .;
        try_files $uri $uri/ /index.html =404;
     }
  }
}

Now in Dockerfile mention it like👇👇

FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["projectpath/projectname.csproj", "projectpath"]
RUN dotnet restore "projectpath/projectname.csproj"
COPY . .
WORKDIR "/projectpath"
RUN dotnet build "projectname.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "projectname.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "projectname.dll"]

FROM nginx:alpine AS final
WORKDIR /usr/share/nginx/html
#Copy from Environment(build/publish)
COPY --from=publish app/publish/wwwroot . 

Now build and run the project in docker.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda