Skip to content

Support for ASP.NET Core 3.0 ? #276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
EdgarMaucourant opened this issue Oct 15, 2019 · 26 comments
Closed

Support for ASP.NET Core 3.0 ? #276

EdgarMaucourant opened this issue Oct 15, 2019 · 26 comments
Labels
discussion enhancement New feature or request

Comments

@EdgarMaucourant
Copy link

Hi Guys,

Is there a plan to support Dotnet core 3.0 ?
As Microsoft is terminating the support of .net core 2.2 in December we are a bit in a hurry to migrate our applications to .netcore 3.0.

Best regards
Edgar

@sungam3r
Copy link
Member

I am sure that this is inevitable. The migration process should not be difficult. Maybe a little later. Most likely, another target will appear in the package, there will be no separate package.

@sungam3r sungam3r added the enhancement New feature or request label Oct 15, 2019
@benmccallum
Copy link
Contributor

I'm trying to update, but the issue I'm currently having is that AddAuthorization has been renamed to AddAuthorizationCore, so the call in the AddGraphQLAuthorization is failing on method not found.

aspnet/Announcements#386

@benmccallum
Copy link
Contributor

I might be able to give the multi-targeting issue a go today, since it's blocking me.

@EdgarMaucourant
Copy link
Author

Hi benmccallum,

I also did try, and fixed the AddAuthorizationCore (by editing the source directly), but then I run also on conflict in the GraphQL code, so I gave up for the moment, and will try later. I let you know if I manage to get this working, but as I'm on tight deadline for the project, it will be not before 10 of November in think.

Edgar

@benmccallum
Copy link
Contributor

Do you have a branch you could push for this repo?

You had an issue with the main GraphQL package too? Hmm... what I'm unsure about is whether we can keep Microsoft.Extensions.Xyz 2.x versions, or they need to be upgraded to 3.0.0, which probably requires netcoreapp3.0, and then it's a big issue.

@sungam3r
Copy link
Member

Multitargeting with Conditional csproj switches all the way...

@benmccallum
Copy link
Contributor

And by all the way you mean in this repo and graphql? Hmm, I can give it a go I suppose :)

@benmccallum
Copy link
Contributor

I think the biggest pain point is that some of upgraded to 2.2 but its only 2.1 that is LTS, so we're like... up sh*t creek unless we wanna back down to 2.1 which is just nasty.

@benmccallum
Copy link
Contributor

benmccallum commented Oct 18, 2019

@sungam3r , I'm going to create a branch for this project support 3.0.0, should I do it off develop or master?

Edit: Nevermind, looks like develop given the commit history.

@sungam3r
Copy link
Member

And by all the way you mean in this repo and graphql? Hmm, I can give it a go I suppose :)

netstandard2.0 and netstandard2.1 in graphql-dotnet

@sungam3r
Copy link
Member

Sorry, I did not immediately realize that the original question was posed incorrectly. In fact, all packages are targeted at netstandard2.0 now. So it's all not about targeting netcoreapp3.0 but about targeting netstandard2.1.

I think the biggest pain point is that some of upgraded to 2.2 but its only 2.1 that is LTS, so we're like... up sh*t creek unless we wanna back down to 2.1 which is just nasty.

No, these problems do not exist, since the code does not use a specific platform.

@sungam3r
Copy link
Member

sungam3r commented Oct 18, 2019

Moreover, since netstandard2.1 has no changed api, then for netcoreapp3.0 you can just use the current version of the library which targets netstandard2.0.

But it should be noted that some docking parts may need to be changed, since the interfaces of ASP.NET Core 3.0 itself have been changed.

@sungam3r sungam3r changed the title Support for donet core 3.0 ? Support for ASP.NET Core 3.0 ? Oct 18, 2019
@sungam3r
Copy link
Member

@EdgarMaucourant @benmccallum I changed the issue title to fit the essence of the problem.

@benmccallum
Copy link
Contributor

benmccallum commented Oct 18, 2019

I wish it was that simple. I think the problem is that if you rely on any of the packages listed here that are now consolidated in to the ASP.NET Core shared framework, your libraries need to use <FrameworkReference Include="Microsoft.AspNetCore.App" /> to get access to these again, which is only supported if you target netcoreapp3.0.

So for us:

  1. Authorization.AspNetCore - references Microsoft.AspNetCore.Authorization and ...Http
  2. Transports.AspNetCore - references Microsoft.AspNetCore.Hosting.Abstractions
  3. Core - references Microsoft.Extensions.Xyz packages at v2.2 - this is one thing I'm not sure about, will they "just work" if the runtime is executing as netcoreapp3.0?
  4. Transports.Subscriptions.Abstractions - same as Core above
  5. Transports.Subscriptions.WebSockers - references Microsoft.AspNetCore.WebSockets.

So in my mind 1, 2 and 5 need multi-targeting to netcoreapp3.0, conditionally including <FrameworkReference Include="Microsoft.AspNetCore.App" /> and, since we can, pointing definitively at 3.0.0 Microsoft.Extensions.Xyz packages.

For 3 and 4 though, I'm not sure.

@sungam3r
Copy link
Member

Well, you just need to start this path. And then we will see how the dependencies are laid out. Essentially, we have a current workable dependency configuration. We are adding a second.

If in some place you need to change part of the api of one of the server packages to embed it smoothly in ASP.NET Core 3.0, then this can be done using preprocessor directives. This is standard practice as an alternative to completely copying code to separate files like GraphQLMiddleware2.0.cs and GraphQLMiddleware3.0.cs.

@benmccallum
Copy link
Contributor

Yep, almost there, just checking everything builds and will try running it up soon. Fingers crossed I've got it right. In any case, it seems like netstandard is dead moving fwd as netcoreapp5.0 will just be everything I guess shrugs. basically I'm saying even though it feels weird adding this to some libraries, it'd be the default moving forward.

@sungam3r
Copy link
Member

it seems like netstandard is dead

Why? It is just a set of common apis. ASP.NET Core is not a set of apis, it is a framework. If some netstandard2.0 package does not fit with the new version of ASP.NET Core framework, then we cannot say that this is a package problem. ASP.NET Core changes the rules of the game, not netstandard. And we... we adapt to them all sooner or later :).

@benmccallum
Copy link
Contributor

Because netstandard2.1 isn't supported by full .net framework and .net 5 is just .net core, which is cross-plat, so the need for .net standard goes away. I'm probably being very limited in view here though, as I guess there's other runtimes that could find it useful.

https://docs.microsoft.com/en-us/dotnet/standard/net-standard#net-implementation-support

@sungam3r
Copy link
Member

so the need for .net standard goes away

Really?
изображение

@pkellner
Copy link

If I want to do some non-production work and use the asp.net core 3.0, what's the best plan? That is, what sample project should I use that lets me create a graphql server from entity framework data. I see there is a "develop" branch on the server project but it's not obvious if I should us that sample, or one from this repo (graphql-dotnet) but there is no "develop" branch here.

@sungam3r
Copy link
Member

Default branch in that repo (develop) has a fully functional graphql ASP.NET Core 3.0 server. You can modify it while studying ASP.NET Core 3.0.

@ya-erm
Copy link

ya-erm commented Dec 3, 2019

Hello,
When new nuget-package with fixed problem of authorization will be available?

AddAuthorization has been renamed to AddAuthorizationCore, so the call in the AddGraphQLAuthorization is failing on method not found.

@sungam3r
Copy link
Member

sungam3r commented Dec 3, 2019

The package was already ready - https://github.com/graphql-dotnet/server/blob/develop/nuget.config

@sungam3r
Copy link
Member

sungam3r commented Dec 3, 2019

@benmccallum maybe it's time to close this issue?

@benmccallum
Copy link
Contributor

Yea that method rename issue was definitely addressed in my PR and is now in develop and being released in the alpha packages, @sungam3r. Feel free to close and direct them to a version and feed that's got it in there.

@sungam3r
Copy link
Member

sungam3r commented Dec 3, 2019

@yass98 You can use the latest preview version from aforementioned myget feed.

@sungam3r sungam3r closed this as completed Dec 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants