skip to Main Content

Unable to run Docker .NET 6 console image – Debian

Hi I have below dockerfile for .NET 6 console app FROM mcr.microsoft.com/dotnet/runtime:6.0 AS base WORKDIR /app FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build WORKDIR /src COPY ["MyProj/MyProj.csproj", "MyProj/"] RUN dotnet restore "MyProj/MyProj.csproj" COPY . . WORKDIR "/src/MyProj" RUN dotnet build "MyProj.csproj" -c Release…

VIEW QUESTION

Checking in C# whether MySQL database exists

I'm writing a simple console application in C# using top-level statements, and I want to check at the beginning whethere there exists a database. Here's my code: using MySql.Data.MySqlClient; using (MySqlConnection connection = new MySqlConnection("Server=localhost;Uid=root;Pwd=password;")) { connection.Open(); if (CheckDatabaseExistence(connection)) Console.WriteLine("Database…

VIEW QUESTION
Back To Top
Search