Conversation
src/DataProtection/DataProtection/src/TypeForwardingActivator.cs
Outdated
Show resolved
Hide resolved
src/DataProtection/DataProtection/src/TypeForwardingActivator.cs
Outdated
Show resolved
Hide resolved
| if (versionEndIndex == -1) | ||
| { | ||
| // No end index? | ||
| return forwardedTypeName; |
There was a problem hiding this comment.
Should this be:
return forwardedTypeName.Substring(0, versionStartIndex);? Otherwise it could contain a Version=something but nothing after it?
For reference, I pinged David about this as this regex was being compiled as part of a default MVC app startup and taking ~8% of the time. Related to dotnet/runtime#44598 |
Co-authored-by: Stephen Toub <stoub@microsoft.com>
|
The tests are a bit more complex than removing a single version from a type name it seems. The current implementation handles generics (which I'm dubious is even a scenario that happens). |
What is the scenario here? With the default MVC template, I see this code kicking in to forward several types; why should anything new require forwarding? |
|
Will revisit. @HaoK if you're looking at data protection we should look at this. |
|
Sure, I can roll this into the span work, linking to #30013 |
cc @stephentoub