dotnet / dotnet/aspnetcore

MapDynamicControllerRoute doesn't work with DefaultLinkGenerator

Open
#16,965 17 comments 4 reactions 0 assignees View on GitHub
affected-medium area-mvc enhancement feature-routing needs-prototype Priority:2 severity-blocking
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

### Describe the bug
The DefaultLink Generator (and the AnchorTagHelper) do not work when mapping dynamic routes. They do not find any routes and produce a null href.

### To Reproduce

1. create a vanilla mvc site
2. add one dynamic route
3. use the anchor tag helper or the LinkGen class
4. Result is href is null.

see v simple example here.

https://github.com/ollieferns/dynamiclinkgenissue

### Further technical details
- ASP.NET Core version 3.1 (preview)
.NET Core SDK (reflecting any global.json):
Version: 3.1.100-preview2-014569
Commit: 4bd5d24d87

Runtime Environment:
OS Name: Mac OS X
OS Version: 10.15
OS Platform: Darwin
RID: osx.10.15-x64
Base Path: /usr/local/share/dotnet/sdk/3.1.100-preview2-014569/

Host (useful for support):
Version: 3.1.0-preview2.19525.6
Commit: 5672978d91

.NET Core SDKs installed:
3.0.100 [/usr/local/share/dotnet/sdk]
3.1.100-preview1-014459 [/usr/local/share/dotnet/sdk]
3.1.100-preview2-014569 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.0-preview1.19508.20 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.0-preview2.19528.8 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.13 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.0-preview1.19506.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.0-preview2.19525.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.