Last post May 18, 2019 09:46 PM by DA924
May 18, 2019 06:14 PM|vahid.ch|LINK
I'm using .Net core 2.0 and after running my app I get this issue:
The ADO.NET provider with invariant name 'System.Data.SqlClient' is either not registered in the machine or application config file, or could not be loaded. See the inner exception for details.
The specified invariant name 'System.Data.SqlClient' wasn't found in the list of registered .NET Data Providers.
<?xml version="1.0" encoding="utf-8"?>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=184.108.40.206, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
connectionString="Server=.;Database=InstaYab;User Id=blahblah; Password=blahblah;"
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameter value="mssqllocaldb" />
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
var _cmd = new Commands();
_cmd.commentLog(currentUser, fullName, mediaId, pk, userName, description + "/" + text, code);
private readonly myDbContext _db = new myDbContext();
public void commentLog(string CurrentUser,string FullName, string MediaId, long Pk, string Username,string Description,string Code)
var comment = new Comment
CreatedDate = DateTime.Now,
CurrentUser = CurrentUser,
FullName = FullName,
MediaId = MediaId,
Pk = Pk,
Username = Username,
May 18, 2019 07:17 PM|DA924|LINK
How is it that you have an app.config file? What kind of program is trying to use EF? Did you try to use the EF Core scaffolding through Nuget?
May 18, 2019 07:31 PM|vahid.ch|LINK
It's a console app (.NET Core) , another project in my solution is a class library in which , there are classes and models (EF), I referenced my class library into console app(.NET Core) and in app.config I added above codes.
If I run my console app with .NET Framework everything works fine, but I want to use Bot Framework Emulator and I think it should be .NET Core application.
May 18, 2019 09:46 PM|DA924|LINK
I don't know how it works for a Core solution as to where it expects to find the root.config/runtime config file or even if there is such a file that exist in Core that .NET Core even looks for at runtime on its own, like non Core .NET solutions do.. If
the Bot program is not a Core solution or this classlib is not a Core classlib project, then things may be suspect in getting things to work.
All I can suggest is look at the thread,
IMHO, what you are doing in not viable.