问题
What might be the error? I looked at similar problems, downgrading the version to 2.0 is workaround but this is not true
DAL.dll
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="3.1.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.4" />
</ItemGroup>
UIWEBAPP.dll
<ItemGroup>
<PackageReference Include="CKEditor" Version="3.6.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="3.1.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.4" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.3" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup>
回答1:
Hey mate try these steps because this way works !!!
1.
dotnet tool install --global dotnet-ef --version 3.0.0
2.
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.0.0" />
3.
dotnet ef dbcontext scaffold "Server=serveraddresst;Database=db_name;User=db_username;Password=db_password" Microsoft.EntityFrameworkCore.SqlServer -c DataBaseContext -o Models
来源:https://stackoverflow.com/questions/62262004/platformnotsupportedexception-microsoft-data-sqlclient-is-not-supported-on-this