-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Remove Routing with a Fully Qualified Type name #5045
Conversation
This behavior is not trim-compatible, since it just a random string "route name" and calls Type.GetType with it, and then Activator.CreateInstance. The trimmer might have removed the whole type, or even the constructor on the Type. This would cause a trimmed application to behave differently than an untrimmed application. I do not know of anyone who relies on this behavior, and there are no tests for it. So removing it seems like the best path forward. Contributes to dotnet#1962
// okay maybe its a type, we'll try that just to be nice to the user | ||
var type = Type.GetType(route); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think anyone would use a route like:
app://home/MyAssemblyName, MyNamespace.MyPageName
The space, comma, and dot would make this a very weird URL.
Looks like this needs to delete a test, though:
|
Right, the build is failing because of this test. |
@@ -623,57 +623,6 @@ public async Task RouteWithGlobalPageRoute() | |||
Assert.AreEqual("//animals/domestic/cats/catdetails", shell.CurrentState.Location.ToString()); | |||
} | |||
|
|||
[TestCase(typeof(PageWithDependency), typeof(PageWithDependency))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we want to fully remove this test. Let me fix
This behavior is not trim-compatible, since it just a random string "route name" and calls Type.GetType with it, and then Activator.CreateInstance. The trimmer might have removed the whole type, or even the constructor on the Type. This would cause a trimmed application to behave differently than an untrimmed application.
I do not know of anyone who relies on this behavior, and there are no tests for it. So removing it seems like the best path forward.
Contributes to #1962