-
Notifications
You must be signed in to change notification settings - Fork 1k
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
String Collection Editor dialog is incorrect for PropertiesToLoad property in DirectorySearcher control #3049
Comments
This is a peculiar line in the project file: <TargetFramework>net5.0</TargetFramework> Where did it come from? It feels related to the new TFM work (e.g. dotnet/designs#109) but I'm not aware of any changes to our repo or WindowsDesktop that relate to that... The app is working correctly for me if I change it to <TargetFramework>netcoreapp3.1;netcoreapp5.0</TargetFramework> |
@RussKie yes, you're right. The target framework info in project file should be:
But this issue still can reproduce in .NET Core 3.1 and .NET Core 5.0, I re-uploaded two test apps, please check below: |
This looks similar to #1210, which was fixed in #1552. The issue is originated by .NET Runtime who own System.DirectoryServices.dll. I can see two distinct parts to the problem:
@merriemcgaw what are our appetites for servicing this in 3.1? The second one is likely a blocker. |
The second issue is the top priority to fix, but the first one is good to have as well. |
@merriemcgaw , the second part of this issue is not a regression from the .NET framework. Does it really meet the servicing bar? 1, create a .NET Framework app Why is it important to enable collection editor for specialized collections in .NET Core? |
As I read the discussion, because it is a regression that the dotnet runtime removed their attributes which were present on Desktop. Also there may be more places where this was removed. WinForms has to provide the attributes because it owns the editor, but it can only do that easily by adding it for the whole type. Its technically possible to add attributes on properties through TypeDescriptors but its a lot more work. |
Adding intrinsic attribute to StringCollection type(PR #3120 ) is the right fix. Enabling scenario like this(PR #3111):
Has the following problems:
|
Agree here, but this is about unblocking customers who otherwise |
Why are customers blocked if we added intrinsic editor on this type? This is not a port from the .NET framework scenario because Collection editor had never worked with Specialized string collections. |
I think the awful generic collection editor experience is better than the current error message and no experience. Is there any chance that this would break existing apps that have been ported or impact our designer work in any way? If not, I don't have a problem taking a fix. |
There is no current experience because it had never worked in .NET framework. Our Core out of box experience will show the correct editor. The user has to write code in order to associate the wrong editor with the StringCollection. The error box experience is the correct experience because it indicates that the developer uses incorrect editor. The fix is hiding a useful error. Also the "first" fix should enable all existing StringCollection properties to work with the collection editor. If this is not the case, than intrinsic editors don't work and this is a problem |
.NET Core Version:
5.0.100-preview.4.20202.8
Have you experienced this same bug with .NET Framework?:
No
Problem description:
When edit the PropertiesToLoad property for a DirectorySearcher control in PropertyGrid, the incorrect String Collection Editor dialog be opened.

More info:
This issue occurs in .NET Core 3.1 too.
Expected behavior:
The correct String Collection Editor dialog should be opened.

Minimal repro:
WindowsFormsApp4.zip
The text was updated successfully, but these errors were encountered: