-
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
Running the control fails, displaying "The type 'IHandle<>' is defined in an assembly that is not referenced" #10661
Comments
Hmm. Happens when you cast any control to any interface, but not when you cast to base classes. Not what I would have expected. @jaredpar do you know why casting to a public interface needs an explicit reference to an assembly where an internal interface is defined? Is this expected?
|
If the
In general if you perform compilations where you do not give the compiler the full reference graph you are playing with fire. While the compiler is careful to not traverse symbols unless it needs to it is sometimes necessary. Bug fixes, new features, etc ... can always force us to look a bit deeper on existing symbols and thus pull in more assembly references. This can break existing code which only gave the compiler a partial reference graph. Such behavior changes are considered "by design" / "won't fix" bugs though. If we could go back in time and fail compilations that didn't provide full reference graphs we'd strongly consider doing so to avoid issues like this. |
Fixed by #10673 |
@JeremyKuhne @elachlan verified on .NET 9.0.100-alpha.1.24068.28 + latest dlls from Winforms Repo of main branch, it is not fixed. Running the control still fails, displaying "The type 'IHandle<>' is defined in an assembly that is not referenced." 10661.mp4 |
@MandiMan 24069.3 is the first SDK build to include the fix |
Verified this on .NET 9.0.100-alpha.1.24070.3, issue was fixed. Running the control was successful. 10661.mp4 |
Verified this issue with .NET 9 Preview 1 test pass build, it was fixed. Test result is same as above. |
.NET version
9.0.100-alpha.1.24062.11
Did it work in .NET Framework?
Yes
Did it work in any of the earlier releases of .NET Core or .NET 5+?
Yes
Issue description
Running the control fails, displaying "The type 'IHandle<>' is defined in an assembly that is not referenced."
In the latest .Net 9.0 SDK build: 9.0.100-alpha.1.24062.11, an exception pops up:
The type 'IHandle<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Private.Windows.Core, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
9.0.mp4
Steps to reproduce
More info:
The text was updated successfully, but these errors were encountered: