Allow internal types to be selected as object data source for binding
Environment
Microsoft Visual Studio Enterprise 2022 (64-bit) - Version 17.9.6
.NET version
.NET 8
Did this work in a previous version of Visual Studio and/or previous .NET release?
Nope
Issue description
We are unable to select internal types as a DataSource for binding. Our company policy is to have all non-customer-facing public APIs set to internal and make them internally available within the company using the InternalsVisibleTo project element.
As a current workaround, we temporarily set the access modifier of the classes to public, and then revert them back to internal after selecting the type in question. However, this can become cumbersome with larger view models that have multiple layers of internal classes, where the public modifier has to cascade to every dependency.
Steps to reproduce
- Create a new .NET 8 WinForms project
- Create a
internalclass with apublicproperty for data binding - Add a control to the Form supporting data binding
- Attempt to set the
DataSource(orDataContext) of the control to theinternalclass using the "Add and update object data sources" tool - Observe an empty list
Diagnostics
No response
@KlausLoeffelmann what is the plausibility of this?
@JeremyKuhne: It's likely an oversight and a breaking change from .NET Framework. Need to be fixed in the Designer, though. -> VSNext.
@Olina-Zhang: If we haven't yet, can you create an Issue in the Designer (or move it to VSNext), and keep this open for tracking?
@KlausLoeffelmann we have a known Designer issue about Friend class is not shown when binding data source from project, can use it to track these similar issues.
Scheduled for 17.13.