Skip to content

.MapFallbackToPage() in RazorPages-Project fails with "UnsupportedApiVersion" #678

Closed
@DNF-SaS

Description

@DNF-SaS

2.1+ allows Razor Pages to pass through

Sorry to say, but adding

services.AddApiVersioning(options =>
{
  options.DefaultApiVersion = new ApiVersion(1, 0);
  options.AssumeDefaultVersionWhenUnspecified = true;
});

and

app.UseEndpoints(endpoints =>
{
  endpoints.MapRazorPages();
  endpoints.MapFallbackToPage("/Index");
});

to a NET5.0 Razor Pages project created from the default template also throws the UnsupportedApiVersion error:

{"error":{"code":"UnsupportedApiVersion","message":"The HTTP resource that matches the request URI 'http://localhost:5000/' is not supported.","innerError":null}}

Referenced ApiExplorer is 5.0.0-preview.1

Originally posted by @DNF-SaS in #189 (comment)

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions