-
Notifications
You must be signed in to change notification settings - Fork 971
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
[dotnet-sdk-8.0.100-preview.7.23374.6] Fail to retarget greenshot app to .NET 8.0 with 'MethodInvoker' ambiguous reference exception between 'System.Windows.Forms.MethodInvoker' and 'System.Reflection.MethodInvoker' #9586
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
@marcpopMSFT This bug was found in .NET 8 Preview 7 validation, could you please help confirm whether it is a blocker for Preview 7? Please help to move to the right area if this is not correct. Thanks. |
Not sure if this is a winforms issue or Roslyn issue related to the upgrade but routing to winforms first as it appears to be a winforms app. |
Maybe this happened because of dotnet/runtime#88415? |
@JeremyKuhne - FYI |
This is expected. There is a new public type that has the same name as our existing one. The source needs updated to explicitly say that they want the WinForms one. This can be done by using the full name or adding a using alias to simplify specifying a known type: using WinFormsMethodInvoker = System.Windows.Forms.MethodInvoker;
namespace MyNameSpace;
internal class MyClass
{
public void Foo()
{
System.Windows.Forms.MethodInvoker invoker1 = Bar;
WinFormsMethodInvoker invoker2 = Bar;
}
public void Bar() { }
} |
Application Name: greenshot
OS: Windows 10 21H2
CPU: X64
.NET Build Number: dotnet-sdk-8.0.100-preview.7.23374.6
App & Source Location checking at: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1860865
App github link: https://github.com/greenshot/greenshot
Verify Scenarios:
1). Windows10 21h2 x64 + dotnet-sdk-8.0.100-preview.7.23376.3: Fail
2). Windows10 21h2 x64 + dotnet-sdk-8.0.100-preview.7.23375.2: Fail
3). Windows10 21h2 x64 + dotnet-sdk-8.0.100-preview.7.23374.6: Fail
4). Windows10 21h2 x64 + dotnet-sdk-8.0.100-preview.7.23371.2: Fail
5). Windows10 21h2 x64 + dotnet-sdk-8.0.100-preview.7.23364.32: Pass
6). Windows10 21h2 x64 + dotnet-sdk-8.0.100-preview.6.23330.14: Pass
7). Windows10 21h2 x64 + .net 7.0.306: Pass
Minimal Repro steps (Demo attached):
WinFormsApp1.zip
Expected Result:
Build successfully.
Actual Result:
Get Following error:
Findings:
Dotnet info:
@dotnet-actwx-bot @dotnet/compat
The text was updated successfully, but these errors were encountered: