-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
Version 5 for .NET 6 Support #1109
Comments
Also just clarified on looking on AppVeyor to that version 5 does not exist. |
That's correct. The documentation website is published from the master branch, which is where we work on v5. We haven't tested against .NET 6 and EF Core 6 yet, but it's a goal we pursue for the stable v5 release. There's no v5 prerelease on NuGet yet, however, we welcome you to try our latest build on .NET 6 and let us know if there are any issues. What you can also do is try v4 on .NET 6. We'll consider officially supporting .NET 6 with v4 if the fixes are small enough. |
Hi bart, thank you for getting back to me and clarifying. I'm on my phone currently but when trying to run earlier; I couldn't get it to run because of .addJsonApi() so it fell at the first hurdle unfortunately. I'm willing to be a tester for this; so I will find the error later and see if you can advise anything if that's okay? |
So, obviously in .NET 6 the startup has changed. It appears
|
Further: Just as an added, when I pulled the project down and referenced it locally to use
It worked and from testing so far, everything seems to be good! Would it be possible to get a version of .net6.0 on the AppVeyor feed? Many thanks! |
For the exception you mentioned, can you include the full stack trace? And include which versions of .NET, EF Core, JADNC, and the database provider you used when you got this failure? About the AppVeyor feed: we use the free tier, which means jobs cannot be run in parallel and each job is restricted to a maximum duration of 1 hour. Running the cibuild already takes a while today (and occasionally times out, the VMs are quite slow), so I'm not looking forward to doubling our build times. However, before crafting a new release I usually run some tests locally against the latest versions of frameworks, just to make sure the basics still work. |
@bart-degreed yeah sure, no problem! Thank you for your support on this. Is there a discord server for this package? Don't worry if not, just might be helpful. So versions are as follows: .NET: net6.0 In terms of version for the JADNC, it was the latest master branch so I believe that to be One thing to note though, there is a few warnings about #nullable annotations context. However, this does not stop the build. EDIT: I forgot to include the stack trace, my apologies.
|
We use gitter chat instead of discord. Thanks for providing the details. I did some experiments myself. First, I created a simple .NET 6 WebApi project by following the steps from Getting Started and ended up with the following in using DemoWebApiOnDotNet6.Data;
using DemoWebApiOnDotNet6.Resources;
using JsonApiDotNetCore.Configuration;
using Microsoft.EntityFrameworkCore;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddDbContext<AppDbContext>(options => options.UseNpgsql(
"Host=localhost;Port=5432;Database=DotNet6Example;User ID=postgres;Password=postgres"));
builder.Services.AddJsonApi<AppDbContext>();
var app = builder.Build();
app.UseRouting();
app.UseJsonApi();
app.MapControllers();
using (var scope = app.Services.CreateScope())
{
var dbContext = scope.ServiceProvider.GetRequiredService<AppDbContext>();
dbContext.Database.EnsureDeleted();
dbContext.Database.EnsureCreated();
dbContext.People.Add(new Person { Name = "John Doe" });
dbContext.SaveChanges();
}
app.Run(); For this demo API, I found the following:
Next, I opened the solution from the master branch and found the following:
Then I opened the solution from the 4.2 release branch and found the following:
Conclusion: Using .NET 6 seems to work fine, EF Core 6 has issues that we'll need to investigate. Note that all the above applies to a fresh start with an empty database, which is usually not very realistic. The release notes of PostgreSQL sum it up pretty well:
|
@bart-degreed i forgot to mention I was actually using SQLServer for my current application and didn't encounter errors. What do you recommend moving forward? Keep the latest version up to date locally so it's eligible for use? I haven't encountered any issues thus far but am keen to explore and upgrade my application to .NET 6 😀. |
Thanks for trying out the latest bits. We have a rule that each PR merge should improve the codebase, so we won't be merging half work to master. This means you can safely use the master branch until we have a prerelease out. However, you may face breaking changes until the stable v5, which we generally document in the PR descriptions. Aside from the general list of breaking changes in EF Core 6, I haven't found documents online for the SQL Server provider, so you should be fine. I've been thinking about what we can do for JADNC v4. It seems fine to support .NET 6, but not EF Core 6 due to its binary breaking changes. Even if we multi-targeted JADNC against .NET 5 with EF Core 5 and .NET 6 with EF Core 6, it would mean that using .NET 6 with EF Core 5 is no longer possible because NuGet does not support forcing a different TFM (see here and here). So this would be a breaking change in JADNC v4 for existing users that have already upgraded to .NET 6, which we cannot do. In the master branch, we currently target .NET 5 with EF Core 5, but we aim to support running against .NET 6 and EF Core 6 in the first prerelease. We could achieve supporting both the 5.x versions and the 6.x versions using multi-targeting, but given the various breaking changes in JADNC v5 already, I think it's reasonable to support just .NET 6 with EF Core 6. Yet we may still choose to multi-target, based on substantial community feedback. However, we'd like to wait a few weeks before updating master, until the first maintenance fixes for .NET 6 and EF Core 6 are out, as well as tooling updates (Resharper is currently in EAP) and dependent packages. While it's tempting to develop against the latest and greatest, dive into all sorts of bugs, create issues, workarounds, etc, we're expected to remain productive. Though I'll keep an eye out for what's coming, as well as listen to the JADNC community feedback. I hope this gives some perspective on what to expect in the near future, as well as invite users to provide feedback on our plans. |
@bart-degreed that's amazing thank you for getting back in touch with me and taking the time to investigate. Is there a place where I can if I experience issues with JADNC to post. Wherever is best for yourself for visibility. Much appreciated. |
Opening separate issues for different problems would work best. It enables us to solve them separately and link PRs to them. |
@bart-degreed Not a problem! I'll go ahead and close this issue and raise anymore that I may come across. Thank you for your brilliant work on the package! |
Reopening to track the work needed for .NET 6 support. Linked from roadmap to here. |
Hi @bart-degreed,
That is definitely true. One set of activities that takes relatively long is this:
On Linux (Ubuntu image), The question is why you need to run:
If possible, you should only run this on Windows. |
We need to run Linux before Windows, because the Windows build publishes the NuGet package and the documentation website. We'd like to fail fast on formatting issues, not wait for the whole Linux build to complete first. During regular work, formatting issues are usually the cause for failure. Instead of running cleanup locally, we queue up a build and work on something else meanwhile. I know how frustrating it can be to have to wait on cibuild when working on that, so by all means disable steps temporarily to be productive. |
I'll open a separate issue for discussing the build topic because you are right: it has been the most frustrating experience. |
I've also come across this error when starting a new .NET 6 project, downgrading to EF 5 worked. |
@ziali088 See /~https://github.com/json-api-dotnet/JsonApiDotNetCore#compatibility. You'll need to clone/download the repo and build from source to use EF Core 6 currently. |
I can see in the README that this package offers .NET 6 support, however upon looking through nuget and the released on GitHub there is no version 5, I also checked branches just to be sure and can't see anything on there.
The text was updated successfully, but these errors were encountered: