Closed ionmincu closed 3 years ago
??? No idea what you are referring to?
??? No idea what you are referring to?
Sorry pressed shift enter by mistake and the comment just posted, check edited version 😄
.net core or .net framework?
It works with the Smoke test for .net Framework.
.net core or .net framework?
It works with the Smoke test for .net Framework.
.NET Core 5.0
Please share a full repro.
I doubt that will work, but please share a repro.
Check, https://github.com/ionmincu/EfTesting PS I gave you admin rights on this repo you should be able to commit to it.
I don't think .NET 5 knows anything about app.config
I don't think .NET 5 knows anything about app.config
It most definitely does, try to delete it and you will see another error. EDIT: and we do use app.config in our application
Thanks or the repro, proposed update to the docs:
You can also use XML/App.Config based configuration:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<providers>
<provider invariantName="Microsoft.Data.SqlClient" type="System.Data.Entity.SqlServer.MicrosoftSqlProviderServices, ErikEJ.EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>
If you use App.Config with a .NET Core / .NET 5 or later app, you must register the DbProviderFactory in code once:
DbProviderFactories.RegisterFactory(MicrosoftSqlProviderServices.ProviderInvariantName, Microsoft.Data.SqlClient.SqlClientFactory.Instance);
Weeel I kinda figured this out, wanted a config only solution, but I guess it's not really possible (at least not without a small update).
Ok fine by me, you can close this if you want, turns out I cant really switch between SDS or MDS because we have some SqlParameter
types and they are either SDS or MDS.
Correct, you can only do that with conditional compilation, not at runtime.
Description
Adding the section as described in documentation does not work.
I've also added:
Exception
At startup I'm getting the following exception