-
Notifications
You must be signed in to change notification settings - Fork 711
Asp Net Core 2.0 Razor pages UnsupportedApiVersion #189
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
Comments
Using MVC with API versioning enabled is a supported scenario. If you can share your configuration and/or the world's smallest repro, I can help you iron out the setup. It's possible your configuration may have hit an edge case. I've encountered them before. I add each such case to the acceptance tests to make sure that UI and API routes play nice together. Hopefully, this is just be a simple case of misconfiguration. |
Thanks for taking a look at this. Simple Repro project located at https://github.com/paul-xtr/apiversioning Configuration used in startup
Along with a simple razor page TestRP. Hopefully I'm not missing something obvious. |
Thanks so much for the repro. There is definitely an issue. While I know normal Razor Views work, I haven't played much with the new, shiny Razor Pages. API Versioning relies quite heavily on applying model conventions. I need to figure out how or if that's even possible. If it's not possible, then I need to somehow generically figure out how to ignore versioning strategies for such routes. Today, there is no special consideration for UI versus API routes. |
Thanks for the confirmation. A possibility to allow Razor Pages to just run before deciding on a convention based approach may be to adapt the route constraint to check if the route values page 'property' is set (or even controller value empty) and return true. From what I have seen for razor pages controller is empty and page value is set. I'm definitely not an expert so it's just a thought. |
I am on 2.0 and I also am experiencing |
Looks like this merge is not current build / available. |
Is it possible to provide a workaround? |
Apologies if you were waiting on this. The newest package versions are published. This fix is in the new packages. Let me know if you encounter any new issues. Thanks. |
Cool, thanks @commonsensesoftware - i was just trying to upgrade to 2.0 and razor pages and found the issue. THanks for pushing updated packages. |
I am on 2.0 and I also am experiencing UnsupportedApiVersion on razor pages |
2.1+ allows Razor Pages to pass through |
Sorry to say, but adding
and
to a NET5.0 Razor Pages project created from the default template also throws the UnsupportedApiVersion error:
Referenced ApiExplorer is 5.0.0-preview.1 |
I have a project mixing simple Razor Pages and WebAPI. After installing versioning I can not access Razor Pages with the error "UnsupportedApiVersion". I specified AssumeDefaultVersionWhenUnspecified =true and defined a default in startup but still get the error. The ApiVersion and MapToVersion don't seem to apply to razor pages. Is there any way to make Razor pages either ApiVersionNeutral or inherit the default version?
The text was updated successfully, but these errors were encountered: