I just migrated to RC2 from RC1 and having a really hard time getting the ef commands and migrations to work.
I've read several other questions and have ran into the problem that's getting described in this link as a known issue.
The problem is that if I follow the instructions and create a brand new console application (.core) I'm still getting the following message:
This preview of Entity Framework tools does not support targeting class library projects in ASP.NET Core and .NET Core applications. See http://go.microsoft.com/fwlink/?LinkId=798221 for details and workarounds.
What am I doing wrong? Do I need to revert to rc1?
How did you do this migration ? I ask because in my case everything works time - as for now.
In my case I have removed all RC1 components first and then I have installed new RC2 components...
Next I have created new APS project using new Visual Studio Templates to get correct references and just moved my code to this new project.
Of course it's few things which I had to update in my code, but everything works fine for me including ef commands and migrations.
As you can read in ASP.NET Core installation guide
Before you start
Remove all previous versions of .NET Core from your system by using Add/Remove programs.
You need RC1 setup file to uninstall this component - if you do not have it, check StackOverflow - you can find link to download missing files.
Try follow the docs:
ASP.NET Migration
Migrating from ASP.NET 5 RC1 to ASP.NET
Core
Migrating from DNX to .NET Core CLI
ASP.NET 5 RC1 apps were based on the .NET Execution Environment (DNX)
and made use of DNX specific features. ASP.NET Core RC2 is based on
.NET Core, so you must first migrate your application to the new .NET
Core project model. See Migrating from DNX to .NET Core CLI for more
information.
Hope this help you :)
Related
I've verified that Entity Framework 6 Tools is installed as suggested in other answers on this site, but ADO.NET Entity Data Model never shows up in the New Items/Data list. I've also tried installing the .NET CORE 2.0 SDK as other answers have suggested to no avail.
To be clear, I'm not creating a .NET CORE application, I'm just trying to make a class library based on .NET framework 4.6. I created the project via .NET Standard and selected Class Library (.NET Standard).
I just need to install EF so I can do a code first generation from my existing SQL Server DB.
Don't use .NET Standard, select a .NET Framework project type.
.NET Standard is an abstract "Core or Framework" option, as if the naming wasn't confusing enough.
I am completely unaware of EF, but got an EF project from a candidate. Couldn't open it in Visual Studio 2010 and want at least to run it in IIS to review if neccessary functionality has been done.
How to install it in IIS ?
Entity Framework 6 is not supported by VS 2010, please check that this is not your problem.
Ensure your IIS server has .NET 4 for EF 5 and below, or .NET 4.5 if using EF 6
You will probably also need to edit the supplied connection string to point at a valid database server.
I wanted to follow up on a post from last year ("EF5 , Widows Forms , Dragging a chield entity from project datasource into a GridView creates only 2 columns").
I believe the problem described with EF5 is still true and the solution found (use EF4) continues to be the only reasonable answer.
Before I upgrade to VS2012, I wanted to check whether anyone knows if there is any problem using EF4 in VS 2012.
Anyone with experience on this?
VS2012 requires .NET Framework 4.5 which is an in-place update. This means that once you install the .NET Framework 4.5 it will be always used when running .NET Framework 4 or .NET Framework 4.5 apps. This also means that you will be running EF5 even if you target .NET Framework 4 in VS (targeting is only a design time thing which prevents from using APIs that were not available in the targeted .NET Framework version while at runtime the app will use the version installed on the box).
With regards to the problem you are reporting - take a look at this bug report on the EF codeplex site as it apparently contains a solution to the problem
I need to know if it is possible to start using the latest version of EF (4.3.1) with VS 2011 without having to install these CTP components as stated here.
I had these components installed but I removed them and since then I can't add a new edmx file to .net 4 targeted project; it complains about missing reference to System.Data.Entity.
Do I need to re install VS 2011?
After I removed and reinstalled Visual Studio, I still couldn't get red of the error, so I used process monitor to log what Visual Studio is doing with System.Data.Entity as a path filter, turned out that Visual Studio was reading from
C:\Windows\Microsoft.NET\assembly\GAC_MSIL\policy.4.0.system.data.entity v4.0_0.0.0.0__b77a5c561934e089\policy.4.0.system.data.entity.config
which had binding to the
System.Data.Entity.dll v 4.2.0.0
once I cleared the file VS was worked like charm.
The CTP uninstall left this out.
Yeah should work with no issues using .net 4, however theres a list of known issues when using .net 4.5. You dont need to re-install vs to get version 4.3.1 of entity framework, simply install it from the nuget package gallery and if you are using .net 4 it all seems to just work.
Issues listed when installing EF4.3.1 on .net 4.5 include those listed below.
Known Issues with Entity Framework 4.x and .NET Framework 4.5
Entity Framework 4.1 thru 4.3 included additional data annotations in the
System.ComponentModel.DataAnnotations namespace in the EntityFramework assembly.
In .NET 4.5 these annotations were moved to be part of the .NET Framework in the
System.ComponentModel.DataAnnotations.Schema namespace of the
System.ComponentModel.DataAnnotations.dll assembly. If you are using EF 4.x and targeting
.NET 4.5 this results in two data annotations with the same name in different assemblies.
Because the annotations in the .NET Framework are in a different namespace we were not
able to use type forwarding to avoid this conflict.
It is possible to use EF 4.x on .NET 4.5 but we recommend using the latest pre-release
version of EF 5. If you are not using the affected data annotations there is no impact
on your code. If you are using the data annotations in a C# project you can use the extern
modifier to ensure your code uses the annotations from EntityFramework.dll
(http://msdn.microsoft.com/en-us/library/e59b22c5(v=VS.80).aspx). If you use the new
annotations from the System.ComponentModel.DataAnnotations.dll assembly in .NET 4.5
they will not be processed by Code First.
The affected annotations are:
Column
ComplexType
DatabaseGenerated
DatabaseGeneratedOption
ForeignKey
InverseProperty
MaxLength
MinLength
NotMapped
Table
This might seem like an odd request, but is there any simple way to downgrade my ASP.NET MVC2 application running on .NET 4 (developed in VS2010) to run on .NET 3.5? I'm asking because the server I will be using to host the application on is within my university and only has.NET 3.5 installed.
Many thanks
The ASP.NET MVC 2 is built against .Net 3.5 so there is no downgrade needed there. The only problem you might have is your own code - if you are using some .Net 4.0 specific stuff you will have to change it. For starters change your projects target framework (in project properties) to 3.5 and check if it still builds.