Category : .net-5

I’m trying to dockerize isolated process .net5.0 Azure Function. But I’m getting errors. All my projects target net5.0. My Dockerfile looks like this: FROM mcr.microsoft.com/azure-functions/dotnet-isolated:3.0-dotnet-isolated5.0-core-tools AS build WORKDIR /app COPY . ./ RUN dotnet publish My.Functions -c Release -o out -r linux-x64 FROM mcr.microsoft.com/azure-functions/dotnet-isolated:3.0 ENV AzureWebJobsScriptRoot=/home/site/wwwroot ENV AzureFunctionsJobHost__Logging__Console__IsEnabled=true ENV FUNCTIONS_WORKER_RUNTIME=dotnet-isolated COPY –from=build /app/out /home/site/wwwroot The ..

Read more

I am using MySQL with .net5 web API in docker. I am using docker on Window10 Home WSL2. My Docker-compose and compose.override file like below docker-compose.yml version: ‘3.4’ services: userdb: image: mysql portainer: image: portainer/portainer-ce usermanagement.api: image: ${DOCKER_REGISTRY-}usermanagementapi build: context: . dockerfile: Services/User/User.API/Dockerfile volumes: mysql_data: portainer_data: docker-compose.override.yml version: ‘3.4’ services: userdb: container_name: userdb restart: always ..

Read more

This is the scenario: We have a web platform with multiple applications created with dotnet 5. Each application has an individual solution in Visual Studio and an individual GitHub repository. Each repository contains a single Web project, and each solution references one or more projects stored in another repository. This repository is called Commons and ..

Read more

Im trying to use the following lib to automatically build an image and run it as a container: https://github.com/dotnet/Docker.DotNet Basically its just a wrapper of the Docker Engine API: https://docs.docker.com/engine/api/v1.41/#operation/ImageBuild However, as stated by the Docker engine API documentation for the "build an image"-section, it expects the request body to be a tar-archive.. but I ..

Read more

Problem: Running dotnet test in container as non root user fails. Details: dotnet test runs successfully using the following docker file and docker command on running as root user. Docker file: FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build WORKDIR /app # run the tests COPY [".", "."] ENTRYPOINT ["dotnet","test"] Docker build command: docker build -t test:v1 . Docker ..

Read more

I have a dotnet5 Console application that is inside a solution and has dependencies on other sibling projects. I create the Docker file with visual studio tools and this is the Docker file: FROM mcr.microsoft.com/dotnet/runtime:5.0-buster-slim AS base WORKDIR /app FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build WORKDIR /src COPY ["src/MyProject/MyProject.Launcher/MyProject.Launcher.csproj", "src/MyProject/MyProject.Launcher/"] COPY ["src/MyProject/MyProject.DataAccess/MyProject.DataAcess.csproj", "src/MyProject/MyProject.DataAccess/"] COPY [src/MyProject/MyProject.Service/MyProject.Service.csproj", "src/MyProject/MyProject.Service/] COPY ..

Read more

I have a .net 5.0 application with a custom logger, which writes logs to a text file. Here is the code for it: var filePath = String.IsNullOrEmpty(Configuration.TempFolderPath) ? Path.GetTempPath() : Configuration.TempFolderPath; var regex = new Regex(@"Content-Disposition=.*filename=[‘""]?([^’""s]+)[‘""]?$"); foreach (var header in headers) { var match = regex.Match(header.ToString()); if (match.Success) { string fileName = filePath + SanitizeFilename(match.Groups[1].Value.Replace(""", ..

Read more