Installing
The recommended way of installing MySqlConnector is through NuGet.
Note that if you are using the MySql.Data
NuGet package, it must be uninstalled first.
Automatically
At the command line, run: dotnet add package MySqlConnector
Or, in Visual Studio, use the NuGet Package Manager to browse for and install MySqlConnector
.
Manually
Step 1: Add MySqlConnector to the dependencies in your csproj
file:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyTitle>My Application</AssemblyTitle>
<Description>A great application</Description>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MySqlConnector" Version="2.2.5" />
</ItemGroup>
</Project>
Step 2: Run the command dotnet restore