2

I have a ASP.NET MVC 5 / .NET 4.7 project that I want to upgrade to ASP.NET Core.

The MVC frontend references a service layer project (SL) which in its that uses a datalayer (DAL) project built using Entity Framework.

Our assessment is that Entity Framework Core is still missing features that we need and that we should not upgrade the DAL project to .NET Core.

What framework should my projects target to be able to work together? Can we upgrade just one project to .NET Core and keep the rest in .NET Framework?

4
  • This blog from Scott Hanselman should be of help.Not sure though that how much of it is valid as of today in Visual Studio 2017 with .Net core 2.0. Commented Nov 16, 2017 at 22:03
  • 1
    I converted projects natemcmaster.com/blog/2017/03/09/vs2015-to-vs2017-upgrade. I made the conversion by hand first one project, then I used it for "template" for converting the other projects. I also wrote a small script to get all package references from pacakges.config and add them to the project file as <PackageReference .../>s. I used <TargetFramework>net47</TargetFramework> and <RuntimeIdentifier>win-x64</RuntimeIdentifier> in the projects. I created a new aspnetcore web projetct (net47) and added what was needed. I have not converted the EntityFramework DAL project Commented Nov 17, 2017 at 9:19
  • The reason I have not converted the EF project is that it uses an .edmx and I not sure if there is any support for .edmx using the new project format. Commented Nov 17, 2017 at 9:21
  • It took several days to figure out what to do. I have to admit it was very confusing before I figured out that you don't need .NET Core to use ASP.NET Core (confusingly named?). And that you only need to target .netstandard if your projects are to be used by more than one framework (i.e: more than one of [.NET "classic" (>=4.5) | .NET Core | Mono (win/linux/mac etc)]) Commented Nov 17, 2017 at 9:56

2 Answers 2

2

If you want to switch to .NETCore and still be able to use older libraries you should tagret .NETFramework.
So when creating new project select:

ASP.NET Core Web Application (.NET Framework)

In addition this month(actually yesterday) .NETCore 2.0 along with EFCore 2.0 is released. Both frameworks have much more features, so I suggest migrating to 2.0 project.
Also EFCore 2.0 should now have most features that were needed so I would go with that as well.

Sign up to request clarification or add additional context in comments.

2 Comments

It seems that "ASP.NET Core Web Application (.NET Framework)" has disappeared from VS 2017 as a project template in 15.3.2.
It hasn't disappeared but is moved. When creating New Project select 'ASP.NET Core Web Application' - > OK. Then new dialog will appear with 2 combos on top: Type and Version, and defaults Targets are [.NET Core] [ASP.NET Core 2.0] so in first just change to [.NET Framework]. Also under that there is Template selection: Empty / Web API / Web App. / Angular / React / ...
1

What framework should my projects target to be able to work together? Can we upgrade just one project to .NET Core and keep the rest in .NET Framework?

You don't need to make any of your projects target .NET Core in order to use ASP.NET Core. I'd recommend using the .NET Core SDK (and associated csproj file format) but you can set the target framework to a desktop framework version (e.g. net47) and then you should be fine.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.