I am working on an application (let's call it A, an ASP.NET MVC3 web site) in .NET 4.0, under Visual Studio 2010 and with Entity Framework and Oracle. Everything goes right.
For an other application (let's call it B), I installed Visual Studio 2012, which installed the new version of the .NET framework. Since, I can not get A working right.
The error I get is : Oracle 11.2.0.3.0 does not support APPLY
I've made some digging and I found a solution : uninstall the .NET framework 4.5 when I need to work on A, and install it back when I need to work on B. This is not very
satisfactory.
It looks like Oracle did not succeed to translate the EF query into an Oracle query. But why ? I still target the same version of the .NET framework (4.0) ...
I am currently trying different ODAC version in order to see if the problem could come from an incompatibility between ODAC and the new version of .NET.
Do you have any other idea of what could cause that and how to fix it ?
Thank you !
Sorry for my english, I am not a native speaker.
Oracle does not support CROSS/OUTER APPLY and some queries generated by EF require these operators. See this and this for more details
Having said that - as per the comments there seems to be a regression in EF5/.NET Framework 4.5 where EF started creating Apply nodes in queries for which Apply nodes were not created in EF4. It was previously investigated but apparently this scenario was not covered.
This regression was actually fixed in EF6 (which is probably not extremely helpful since currently there is no Oracle EF6 provider (at least not from Oracle) at this point)
Related
Entity Framework Core does not support spatial data, which I need to use in my app.
Can I use Entity Framework 6 in .net core? If so, how can I register DatabaseContext in Startup.cs?
Update
You can now use EF 6.3 with .NET Core 3.0:
https://devblogs.microsoft.com/dotnet/announcing-ef-core-3-0-and-ef-6-3-general-availability/#what-s-new-in-ef-6-3
Below is an excerpt. However, EF Core has come a long way these days and it's worth giving it another go before going back to something that's reaching end-of-life soon. Specifically for your issue, EF Core supports mapping to spatial data types using the NetTopologySuite spatial library since version 2.2.
What’s new in EF 6.3
Support for .NET Core 3.0
The EntityFramework package now targets .NET Standard 2.1 in addition to .NET Framework 4.x.
This means that EF 6.3 is cross-platform and supported on other operating systems besides Windows, like Linux and macOS.
The migrations commands have been rewritten to execute out of process and work with SDK-style projects.
Support for SQL Server HierarchyId.
Improved compatibility with Roslyn and NuGet PackageReference.
Added ef6.exe utility for enabling, adding, scripting, and applying migrations from assemblies. This replaces migrate.exe.
There are certain limitations when using EF 6.3 in .NET Core. For example:
Data providers need to be also ported to .NET Core. We only ported the SQL Server provider, which is included in the EF 6.3 package.
Spatial support won’t be enabled with SQL Server because the spatial types aren’t enabled to work with .NET Core.
Note that this limitation applies to EF 6.3 but not to EF Core 3.0. The latter continues to support spatial using the NetTopologySuite
library.
There’s currently no support for using the EF designer directly on .NET Core or .NET Standard projects.
Original Answer
It isn’t ready yet, but starting with .NET Core 3.0, you will be able to.
https://blogs.msdn.microsoft.com/dotnet/2018/05/07/net-core-3-and-support-for-windows-desktop-applications/
Similarly, EF6 will be updated to work on .NET Core 3.0, to provide a simple path forward for existing applications using EF6.
https://youtu.be/GN54OV5cCBM?t=1146
But there's also EF6, which we've already announced is going to be ported to work on .NET Core...
UPDATE: Yes, EF6 has been cross-platform since version 6.3. https://devblogs.microsoft.com/dotnet/announcing-ef-core-3-0-and-ef-6-3-general-availability/#what-s-new-in-ef-6-3
ORIGINAL ANSWER THAT IS NOW INVALID: No, you can not directly, because EF6 doesn't support .NET Core.
But, you can create another project, that compiles against full .NET framework and use it as a reference.
MS has actually made a decent tutorial for this:
https://learn.microsoft.com/en-us/aspnet/core/data/entity-framework-6#reference-full-framework-and-ef6-in-the-asp-net-core-project
UPDATE: Yes, EF6 has been cross-platform since version 6.3. https://devblogs.microsoft.com/dotnet/announcing-ef-core-3-0-and-ef-6-3-general-availability/#what-s-new-in-ef-6-3
ORIGINAL ANSWER THAT IS NOW INVALID: Like #Niko said, you cannot directly with EF6 but there is a fork that allows it.
Disclaimer: I'm the owner of the project Entity Framework Classic
Entity Framework Classic is an EF6 fork. It's everything you like about EF6, but with better performance, must-have features, .NET Core support, and more.
There is a FREE Community version that includes pretty much everything and an Enterprise version that include additional features.
Actually, I want to update old 'nhibernate' version used in my ASP .Net project to its latest stable version i.e. 4.0.0.4000.
However, in this process, I am facing problem.
Currently, Target .Net Framework of my project is .Net 3.5 and with that nhibernate 2.1.2.4000 is used.
For updating the same, I have simply replaced the NHibernate.dll assembly with its 4.0.0.4000 version(downloaded from SourceForge).
However, with .Net 3.5 target framework and nhibernate 4.0.0.4000, I am receiving a number of errors related with missing definition of Type/Namespace like Criterion, Engine, SqlCommand, Type, Cfg, Impl, Metadata etc.
Also, on changing Target Framework to .Net 4.0 or higher and nhibernate 4.0.0.4000, almost all the errors gets removed.
So, it seems that nhibernate 4.0.0.4000 is not compatible with .Net 3.5 Framework. Am I correct?
If so, which max version of nhibernate can be used with .Net 3.5 Framework?
If not, please confirm what could possibly causing these errors and how it can be evited.
Also, please confirm the min .Net framework required for using nhibernate 4.0.0.4000. Let me know if there is any other information I needs to be aware of.
Lastly, please confirm if process of updating nhiberate is correct or not?
Thanks in advance.
Regards,
Shubham
Yes, that's right: NHibernate 4 only targets .NET 4. You can see that in the release notes: https://github.com/nhibernate/nhibernate-core/blob/master/releasenotes.txt.
I need to get any ideas of how i should be managing our previous asp.net MVC 5.2 web application.. now i am using asp.net mvc-5.2 with entity framework 6.0. and i want to start phase-2 for some of these projects. so should i consider upgrading my mvc 5.2 to be using mvc6 (vnext) first ? and will there be any migration plans ?
second question , when is it expected for vnext to be released? or it is has been officially released ?
third question, will i be able to create a vnext project inside VS 2012 ?
I would simply recommend following the standard best practice of n-tier architecture and keeping logic related to things like querying a database in class libraries. MVC 6 is drastically different from previous versions, so there's no easy migration. You'll basically need to start a brand new project and move over relevant code where you can and spend a good bit of time converting code. For example, child actions are gone and have been replaced with view components. You'll need to go through any child actions you're using currently and create view components out of them. As I said, making sure your current MVC project is as thin as possible (by factoring out code into class libraries and such) will go a long way in reducing the amount of code you need to move/change.
As far as I'm aware, no release date has been set, but at least in the alpha and beta phases of Visual Studio 2015 and ASP.NET 5/MVC 6, Windows 10 has been required, so there won't be an official release likely until Windows 10 is public. However, Visual Studio 2015 has reached release cadidate stage, so I'd say it's definitely close, either launching alongside Windows 10 or shortly after.
Kind of answered this in point 2, but ASP.NET 5/MVC 6 will require VS2015. As far as I'm aware, there's no plans to add support to lesser versions. A lot of that has to do with Rosyln, the new .NET compiler. Trying to bootstrap previous versions of VS with support for an entirely new compiler/syntax engine would be a monstrous task. However, VS has been on an MSDN subscription model for many versions now and as long as you're a current subscriber you can always download the latest version for free. If you're not an MSDN subscriber, you can still download the community edition of VS 2015 for free. It's missing a lot of the more advanced VS features, but it's still totally sufficient for web development work.
is there some possibility to work with an open database like mysql, mariadb or other and ASP.NET vNext?
Perhaps a beta driver or something like that?
For ASP.NET vNext you can choose to target the full .NET Framework or a slimmed down, bin-deployable, cross platform, Core framework.
If you target the full .NET Framework then you get all the data access options you had before. If you target the CoreCLR then you can use the new version of Entity Framework (EF7). Currently we have the following providers available on CoreCLR; SQL Server, SQLite, and an in memory provider for testing. Of course, more providers will become available as we work towards RTM.
In addition to EF7, there are also the corresponding provider specific SDKs that EF is building on top of, and these can be used in application code as well (e.g. there is an implementation of SqlClient that can be used to access a SQL Server database).
You can read more about our plans for EF7 here - http://blogs.msdn.com/b/adonet/archive/2014/05/19/ef7-new-platforms-new-data-stores.aspx.
It depends on if you are using the CoreCLR (the trimmed down version) or the Desktop profiles. In the Desktop profile you have everything you have in .NET available and you can add your own open source libraries (via Nuget).
Just open up your project.json and add the needed dependencies.
Anyway you should not be dealing with low level ADO.NET, you can use Entity Framework, or Massive or nHibernate, or whatever, to abstract away the specific database your project is using now, as it is bound to change or multiply during the project lifetime...
You should still be able to use anything ADO.Net related with ASP.Net vNext - it is, after all, still .Net!
Yes, it is possible, but only if you use full .net profile (on windows it will be .net framework and on linux - mono). NHibernate working well on mono, so you can eventually use mysql, postgresql and other databases in you APS.NET 5 vNext application. Here is complete example of application with NHibernate and PostgreSQL on Ubuntu server.
i having an error said that "Unable to find the requested .Net Framework Data Provider. It may not be installed."
I'm using (visual studio 2010) with (Sqlserver 2008 R2) And (.net framework 4.0)
(ASP.net:C#)
I'm trying to use SubSonic for vb.net windows apps and mySql and had the same error as you,
I've just installed vb.net 2010 express
I read a stack overflow question here which suggested that the db connector had been installed before .net v4 (vs2010) hence they couldn't be found, I thought this sounded feasible so I downloaded the latest MySql connector, uninstalled the old one and installed the new one. The next time I ran my project the simpleRepository worked straight away!
I was blaming SubSonic! but it really is great!
Hope this might help