I tried to configure a project in MonoDevelop on Ubuntu, to use EntityFramework with Npgsql provider, by following official steps.
However, something seem to be wrong with that suggested configuration file (or I'm missing something), as I can't get rid of this error:
The Entity Framework provider type 'Npgsql.NpgsqlServices, Npgsql.EntityFrameworkLegacy, Version=2.1.0.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7' registered in the application config file for the ADO.NET provider with invariant name 'Npgsql' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.
Does anyone have a simple working example of the application connecting to PostgreSQL using Entity Framework in MonoDevelop?
Please try with Npgsql 3.0.3 (the error says 2.1.0), the correct package for this would be EntityFramework6.Npgsql, not Npgsql.EntityFrameworkLegacy.
Related
I am trying to create a database using .NET 5.0 and what happens is correct built after Add-Migration InitialCreate but nothing created in the SQL Server.
I spent 2 days in looking what's going wrong but I couldn't find anything. What provoked me to post here my question is the surprise when the migration passed with no error even when I typed wrong connection string with no existent server name (both when the string is in UseSQLServer in ConfigureServices as well in appsettings.json)..
Any idea what happens and how to solve it?
The version of Entity Framework Core I've installed is 5.0.13
There is a second step that is missing here :
Update-Database
in PowerShell or :
dotnet ef database update
in NET core CLI
Read more here :
https://learn.microsoft.com/en-us/ef/core/managing-schemas/migrations/?tabs=dotnet-core-cli
I want to connect the Firebird database with Entity Framework Model. Completed the successful installation and created the database. But, I am facing the issue 'Index was outside the bounds of the array' while connecting the database. Refer the below image.
Visual Studio 2015
Firebird client version 4.10.0.0
DDEX Provider version 3.0.2.0
Firebird setup v3.0.4
I followed the steps as suggested in this link. But I choose 'Embedded Server' as server type. https://firebirdsql.org/file/documentation/reference_manuals/fbdevgd-en/html/fbdg30-efw-vs-prepare.html
After done the above configurations, I faced the below.
Unable to load dll 'fbembed': The specified module could not be found. (Exception from HRESULT:0x8007007E)
So, I set 'fbclient.dll' as a client library in the advanced option. After that I am facing this error
Index was outside the bounds of the array
What I have done wrong here? Please correct me.
I created an empty project in VS2013 and added these packages:
DotNetOpenAuth.AspNet
Microsoft.AspNet.Providers.Core
Microsoft.AspNet.Providers.LocalDb
Microsoft.AspNet.Membership.OpenAuth
In the process, Entity Framework 5 was added to the project. I manually installed EF6 and now I get this error when I try to authenticate a user with an external provider:
"Method not found: 'System.Data.Objects.ObjectContext System.Data.Entity.Infrastructure.IObjectContextAdapter.get_ObjectContext()'."
I checked the DNOA documentation but it does not say a word about dependencies/requisites.
Does anybody know if DotNetOpenAuth can work with EF6?
DotNetOpenAuth does not have EntityFramework as a dependency. The samples however do use EF. You must have some of your own code that uses entity framework.
That said, it sounds to me like you need to add a binding redirect or jiggle your entityframework configuration a bit in your web.config file.
We are developing a windows application on .NET 4, it uses SQLite database with .NET wrapper System.Data.SQLite and Entity Framework. On deployment machine it requires .NET 4 Client Profile.
The latest official release (1.0.66) of SQLite wraper is 2 years old. This version works with .NET 2.0 — 3.5, it's mean that we should force users to install 2 versions of .NET. Also it does not supports foreign keys.
There is also unofficial release 1.0.77 which supports foreign keys, however, support of ORM (.NET Entity Framework) is broken in this version (It raises System.Data.ProviderIncompatibleException).
I can see three ways to fix this issue:
Abandon the use of this wrapper and look for other options. What would you suggest?
Abandon the use of Entity Framework. This option is undesirable because it is old-school way and also require us to rewrite a lot and write more code and increate the likelihood of bugs.
Try to fix an issue with 1.0.77, but I have no idea how long it can take. What would you do in this situation? What other wrappers we should look at?
Finally, I understand how to let 1.0.77 System.Data.SQLite assembly to work with Entity Framework and without placing assembly to the GAC.
My first tries to connect SQLite 1.0.77 resulted in:
System.Data.ProviderIncompatibleException: A null was returned after calling the 'GetService' method on a store provider instance of type 'System.Data.SQLite.SQLiteFactory'. The store provider might not be functioning correctly.
Code analysis showed to me that main assembly System.Data.SQLite.dll can't find System.Data.SQLite.Linq.dll. The second assembly has been referenced in project and existed in output bin folder. But the error didn't disappeared.
Reflector showed that System.Data.SQLite.Linq.dll has no public classes. So it will never load automatically to app domain because there is no code referencing it. So it must be only in GAC for correct working.
But nothing can deny us to load it manually to app domain! For example, at application start:
Assembly.Load("System.Data.SQLite.Linq");
And that's it!
Also, don't forget about adding this lines to your application config:
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SQLite"/>
<add name="SQLite Data Provider" invariant="System.Data.SQLite"
description=".Net Framework Data Provider for SQLite"
type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite, Version=1.0.77.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139"/>
</DbProviderFactories>
</system.data>
Hope my expierence will be usefull.
I followed the simple tutorial # http://www.devart.com/dotconnect/oracle/articles/Tutorial_EF.html
(Which works perfectly, btw) combined with http://www.hanselman.com/blog/CreatingAnODataAPIForStackOverflowIncludingXMLAndJSONIn30Minutes.aspx for the OData part and now I need to deploy it to a server.
The problem I am having is that in step 4 of the devart tutorial, I chose a "Data Connection" to my database. Everything works fine on my dev box, but when I published the EF project, there was no reference to the DevArt dlls in the project. So, none were moved to the server.
And, of course this is producing a 'Unable to find the requested .Net Framework Data Provider. It may not be installed.'.
I tried just copying the dlls into the bin directory and I installed the devart product on the server. Neither worked.
I am used to ASP.Net applications that reference the needed Data dlls. What do I need to do to get my EF Odata service running?
The following page will explain how to deploy your EF devart project:
DevArt - Deployment