Aspnetboilerplate: Upgrade to .netstandard 2.0, asp.net core 2.0, entity framework core 2.0 and asp.net core identity 2.0

Created on 12 Aug 2017  路  42Comments  路  Source: aspnetboilerplate/aspnetboilerplate

TODO

Problems to Solve

  • [x] Getting Could not load file or assembly netfx.force.conflicts exception for .net 4.6.1 & asp.net mvc 5.x projects. See https://github.com/dotnet/corefx/issues/23229 - The problem exists only if you have a very long path for the solution.

About Breaking Changes

This is a breaking change because the libraries above have breaking changes.

In addition, ABP supports .net framework 4.6 and .net standard 1.6 now (multiple targeting). We will move to .net standard 2.0 (single target). That means .net framework 4.6 will no be supported and upgraded to 4.6.1.

We will release ABP v3.0. While these breaking changes does not effect applications much, it will be good to indicate that we changed the .net framework dependency and upgraded major libraries.

breaking-change enhancement

All 42 comments

Exciting upgrade, look forward to use .net core 2.0 for a long time, is there a schedule to release v2.4?

since EF Core 2.0 has global filter you plan to replace EF.DynamicFilter with built-in filter?

No schedule. This is a high priority item we will work in the next days.

We will try to implement EF Core 2.0 filters, sure. But it's not a replacement of EF.DynamicFilter because EF.DynamicFilter is for EF 6.x, not for EF Core.

.net core 2.0 runtime/sdk not released yet: https://github.com/aspnet/Home/issues/2125#issuecomment-322016353
So, we should wait for it before upgrading packages. Even Microsoft has not officially announced asp.net core 2.0 as you can see.

Thank you @acjh we were just waiting for it :)

@hikalkan How about your upgrade progress? We want to use .net core 2.0 based on ABP, it seems EF core and AspNetCore Identity with some breaking changes, are you working on these changes?

It will be great if you add first class support for identityserver4

When you think upgrade to .net core 2.0 ?

We are working on it. We think to finish As Soon As Possible. (See the progress: https://github.com/aspnetboilerplate/aspnetboilerplate/tree/netstandard2.0)

Wow great job can't wait to get it work :)

@hikalkan what is the upgrade progress, a little time not see the update on this issue

Are you going to update template core 1.x to 2.0 ? if so when you think please ?

@viewtance I'm working on new EF Core 2.0 Global Filter feature. It has some problems gets my time (https://github.com/aspnet/EntityFrameworkCore/issues/9502). It does not support to define more than one filter and enable/disable them one by one. That means if you disable multitenancy filter you will disable soft delete filter too. That's not what we can accept. If I can not find a proper way, we will not use this feature for now.

The second problem is .net standard 2.0 support is not available for IdentityServer4 yet: https://github.com/IdentityServer/IdentityServer4/issues/1055 We can ignore this package and release others for now. But since AspNet Zero depends on IdentityServer4 we should wait AspNet Zero for it.

@hikalkan Thanks for your feedback, it seems still no response from EF core team for aspnet/EntityFrameworkCore#9502, it is fine if no proper way, we can still use current approach (current customized filter doesn't work for navigation properties, right?)

For the second problem, maybe we need to wait it, since we are using AspNet Zero now, we want to use .Net Core 2.0 based on AspNet Zero.

current customized filter doesn't work for navigation properties, right?

yes.

EF Core Model-filter (Global Filter) doesn't support nav propreties too ... if you want comment / +1 this issue

Thank you very much, but one more thing how do we enable Google and Facebook login ? please :)

@hikalkan IdentityServer/IdentityServer4.AspNetIdentity#29 already closed

@viewtance notice that it's closed because there is such an open issue: https://github.com/IdentityServer/IdentityServer4/issues/1055

@tuvshuu There are already documents (by Microsoft) for social logins.

Just released v3.0.0-beta1.
All packages are released except Abp.ZeroCore.IdentityServer4 and Abp.ZeroCore.IdentityServer4.EntityFrameworkCore.

Please share your results if you can test it.

@hikalkan Great job, would you considering release a beta AspNet Zero Core version according to ABP 3.0 beta version?

@viewtance We can not because we are waiting IdentityServer4 dependency (and we don't want to remove all IdentityServer4 related code from the project and add it later when it's released).

I upgraded module-zero-core-template (https://github.com/aspnetboilerplate/module-zero-core-template/tree/netcore2.0-2). It's not released on https://aspnetboilerplate.com/Templates but you can see in this (netcore2.0-2) branch.

Is the ABP 2.x branch going to continue? We are not yet ready to upgrade to VS2017 and .NET Core 2 and the 3.x branch.

@hikalkan I am also guessing that 3.x will be the basis for "version next" of ABP we discussed some time ago? Will that then become 4.x?

Is the ABP 2.x branch going to continue? We are not yet ready to upgrade to VS2017 and .NET Core 2 and the 3.x branch.

2.x branch for critical bugfixes for v2.x. We can not continue to develop two versions/branchs. We will continue to develop 3.x after 3.0 release.

I am also guessing that 3.x will be the basis for "version next" of ABP we discussed some time ago? Will that then become 4.x?

@natiki I explained why it's 3.0 here: https://github.com/aspnetboilerplate/aspnetboilerplate/issues/2406#issue-249809373
Don't know, maybe it's 4, 5 or 6.. what's matters :)

We can not continue to develop two versions/branchs. We will continue to develop 3.x after 3.0 release.

Understood.

@natiki I explained why it's 3.0 here: #2406 (comment)

My bad I did not start reading at the top. Sorry :-(

So if I have this right then this will also require an upgrade to VS2017 as well for any .Core projects? It is my understanding that VS2015 will not support .NET Standard 2.0 (Unless you do some fiddling by opening the existing project in VS2017 saving it and then reopening it in VS2015).

Or put another way what is your expected minimum version of VS that you will support once 3.0 is out for .NET 4.61 and .NET Standard 2.0? Is it VS2015 with .NET 4.61 and VS2017 with .NET Standard 2.0?

These are Microsoft's breaking changes, not ours.

I suggest to use VS 2017. It's already free, I don't see a reason to not use it.

I understand MS is at issue here. I am just trying to understand what my options are here. For other reasons the team needs Professional so using the free version of VS is not an option. Upgrading them to VS2017 is in the roadmap I am just trying to work out it works with what is coming for ABP.

So am I correct in understanding that I could use VS2015 with .NET 4.61 and ABP 3?

could use VS2015 with .NET 4.61 and ABP 3

Haven't tried and don't know actually (VS 2015 is not installed in my computer at all). You may search on the web. What we do is that we move ABP to .netstandard 2.0.

Thanks @hikalkan. I appreciate the hard work you are putting in here. I will do some research and get back to you.

EDIT:

So it looks like it will be possible to use ABP 3.0 with Visual Studio 2015 as long as you use the .NET Framework 4.61 version. Full details here.

If you have are using ,NET Core version (.NET Standard 2 .NET Core 2) then your only option realistically is to use VS2017 as it is doubtful that any seamless support will be added for it to VS2015.

We are also excited for new .netstandard2.0 release. But unfortunately there are some problems to solve. One of them is we are getting this exception: https://github.com/dotnet/corefx/issues/23229

You can try module-zero-template branch: https://github.com/aspnetboilerplate/module-zero-template/tree/abp-3.0.0-beta3

But it seems one dependence package: https://www.nuget.org/packages/IdentityServer4.AspNetIdentity still has no 2.0.0-preview yet.

@viewtance Now it has: https://www.nuget.org/packages/IdentityServer4.AspNetIdentity/2.0.0-rc1

We will immediately work on to move to these new packages.

@hikalkan Great! A long expected thing.

When OData to Core 2.0 ?

@tuvshuu ask to Microsoft :)

Getting Could not load file or assembly netfx.force.conflicts exception for .net 4.6.1 & asp.net mvc 5.x projects. See dotnet/corefx#23229 - The problem exists only if you have a very long path for the solution.

I downloaded the MVC 5.x startup template and decompressed it in C:\Template (Only the contents in "src" folder).

After setting up the database and building the project (with a lot of "reference not found" warnings, conflicts between dependent assemblies, and a bunch of "Consider app.config remapping of assembly" messages in the Web project) I get the same Could not load file or assembly 'netfx.force.conflicts' error. Path length may not be the only cause of this issue

I'm using Visual Studio 2017 Community Edition, 15.3.5 version.

Edit
After some reading on the dotnet/sdk repo I found a PR that described the issue in a bit more detail, providing a workaround. Half of the lines of the workaround are already in the Web.csproj file. The "complete" workaround looks like this:

<Target Name="ReplaceNetFxNetStandardRefWithLib" AfterTargets="ImplicitlyExpandNETStandardFacades">
  <ItemGroup>
    <Reference Remove="@(_NETStandardLibraryNETFrameworkReference)" Condition="'%(FileName)' != 'netfx.force.conflicts'"/>
    <Reference Include="@(_NETStandardLibraryNETFrameworkLib)">
      <Private>true</Private>
    </Reference>
  </ItemGroup>
</Target>
<Target Name="RemoveNetFxForceConflicts" AfterTargets="ResolveAssemblyReferences">
  <ItemGroup>
    <ReferencePath Remove="@(ReferencePath)" Condition="'%(FileName)' == 'netfx.force.conflicts'" />
  </ItemGroup>
</Target>

I added that only to the Web.csproj file and got the template working. The only thing I don't know how to solve is the warnings and the conflicting dependent assemblies versions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vitorlacerda picture vitorlacerda  路  28Comments

alandillon picture alandillon  路  28Comments

abolfazlmohammadiseif picture abolfazlmohammadiseif  路  29Comments

beriniwlew picture beriniwlew  路  31Comments

alexeynikitin picture alexeynikitin  路  27Comments