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
- Create a winform project(SDK versions before 8.0).
- Copy the following code to Form1.cs.
using System.Windows.Forms;
using System.Reflection;
namespace WinFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.Invoke((MethodInvoker)delegate
{
});
}
}
}
- Build the source.
- Build successfully.
- Change the TargetFramework to net8.0-windows in the WinFormsApp1.csproj.
- Build the source.
Expected Result:
Build successfully.
Actual Result:
Get Following error:
CS0104: 'MethodInvoker' is an amb
iguous reference between 'System.Windows.Forms.MethodInvoker' and 'System.Reflection.MethodInvoker'
Findings:
- Removing using System. Reflection can solve the problem.
- Change MethodInvoker to System.Windows.Forms.MethodInvoker can solve the problem.
Dotnet info:
.NET SDK:
Version: 8.0.100-preview.7.23374.6
Commit: 3819e84d90
Runtime Environment:
OS Name: Windows
OS Version: 10.0.22000
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.100-preview.7.23374.6\
.NET workloads installed:
There are no installed workloads to display.
Host:
Version: 8.0.0-preview.7.23370.6
Architecture: x64
Commit: ebd23467f0
RID: win-x64
.NET SDKs installed:
8.0.100-preview.7.23374.6 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.0-preview.7.23371.19 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.0-preview.7.23370.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 8.0.0-preview.7.23371.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
@dotnet-actwx-bot @dotnet/compat