-
Notifications
You must be signed in to change notification settings - Fork 4.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
DefaultValueAttribute doesn't use TypeConverter #26604
Comments
could you "gist" this(link is internal)?I could help if i understand well. Do you mean add condition |
Yes, that's what I was referring to, though we can't call typeconverter directly. Here's what I did in that internal commit: ericstj/coreclr@17ac7be |
@MarcoRossignoli are you planning to work on this ? |
@Anipik if It isn't too urgent i could try a PR!Feel free to work on it if you have to! |
No, it`s not urgent. Feel free to give it a try. |
Only to be sure to understand...because TypeDescriptor/TypeConverter are on corefx codebase?If so do we need to move "classes" to coreclr, in past i asked and answer was "we move to coreclr if we need". /cc @jkotas |
There are exceptions to this rule when the the closure of types that would need to be moved is large like in this case. We make the call using reflection like in the Eric's prototype. |
In desktop DefaultValueAttribute would use TypeDesicriptor/TypeConverter to try and convert a string to a type: https://referencesource.microsoft.com/#System/compmod/system/componentmodel/DefaultValueAttribute.cs,b956ede3a6b29f1f,references
In Core we are not doing this: https://github.com/dotnet/coreclr/blob/85374ceaed177f71472cc4c23c69daf7402e5048/src/System.Private.CoreLib/shared/System/ComponentModel/DefaultValueAttribute.cs#L38-L51
We should add back the call to TypeConverter as an ultimate fallback, where we use lightup to load it. See https://devdiv.visualstudio.com/DevDiv/_git/DotNet-CoreCLR-Trusted/commit/90f7bf708e4a23f4f2096a847a820d75bf94aa2d?refName=refs%2Fheads%2Fericstj%2Fadd.back.exeperiment.
I suspect this will be needed for WinForms work. /cc @Tanya-Solyanik I ran into in some application code I was porting where the app was explicitly using DefaultValueAttribute itself.
The text was updated successfully, but these errors were encountered: