Skip to content

Is .NET 5 supported? #714

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
3 tasks done
Kronos11 opened this issue Jan 7, 2021 · 2 comments
Closed
3 tasks done

Is .NET 5 supported? #714

Kronos11 opened this issue Jan 7, 2021 · 2 comments

Comments

@Kronos11
Copy link

Kronos11 commented Jan 7, 2021

So .NET 5 has been out since November, as far as I can tell it will not work properly with OData, Swagger, and Api-Versioning.

Background:
I have a netcoreapp3.1 project that has been running with the following libraries
Microsoft.AspNetCore.OData.Versioning 4.1.1
Microsoft.AspNetCore.OData.Versioning.ApiExplorer 4.1.1

I have 3 groups of controllers

v1 - that is using ControllerBase
v1.1 - that is using a mix of ODataController and ControllerBase
v1.2 - that is using ODataController

this has all worked correctly for the most part and we have tests around everything, exercising the different scenarios.
We are only using attribute routing ie: api-version=1.1 etc...

We are updating our services to .NET 5 and I have done the following:

  • Update Microsoft.AspNetCore.OData.Versioning to 5.0.0
  • Update Microsoft.AspNetCore.OData.Versioning.ApiExplorer to 5.0.0
  • Update other Microsoft libraries to 5.0.0 (if applicable)

What i'm seeing is that all of my OData test routes are no longer working using the route attributes (api-version=1.1)
etc..
Is this expected to work or am I too early on getting this integrated in to .NET 5

@anranruye
Copy link

anranruye commented Jan 11, 2021

Please notice that the version 5.0 of Microsoft.AspNetCore.OData.Versioning.ApiExplorer and Microsoft.AspNetCore.OData.Versioning is not related to .NET 5(they depend on Microsoft.AspNetCore.Mvc.Versioning 4.2.0 which doesn't have a version '5.0').

In fact the author of ApiVersioning has no plan to support .NET 5(see #695 (comment)). But you can still use ApiVersioning and .NET 5 together because .NET 5 is downward compatible with .NET Core.

This issue is a problem with Microsoft.AspNetCore.OData.Versioning.ApiExplorer 5.0.0 itself, not only in .NET 5 but also happens in .NET Core 3.x. See #710 (comment) and the related issues mentioned in this comment. Either downgrade to Microsoft.AspNetCore.OData.Versioning.ApiExplorer v4.x or do not use odata attribute routing.

ps: do not use Microsoft.AspNetCore.OData v8(now is a preview version), it is designed for .NET 5, but is not compatible with ApiVersioning.

@Kronos11
Copy link
Author

@anranruye Thank you for the concise information. You are correct just downgrading to 4.1.1 fixed my issues and is working fine with .net 5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants