[.NET 6] [Source Compat Failure] ControlzEx app doesn't build with "Possible null reference" when retarget 6.0
See original GitHub issueApplication Name: ControlzEx (DiscordChatExporter failed with similar error code CS8601) OS: Windows 10 RS5 CPU: X64 .NET Build Number: 6.0.100-preview.1.21071.10
Verify Scenarios: 1). Windows 10 RS5 X64 + .NET Core SDK build 6.0.100-preview.1.21075.3: Fail 2). Windows 10 RS5 X64 + .NET Core SDK build 5.0.102: Pass
Repro steps Source code is targeting netcoreapp3.1 and net6.0-windows, global.json set to 6.0.100-preview.1.21075.3
- Source Code at https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1269988
- Make sure target 6.0
- goto src\ControlzEx
- dotnet build
Expected Result: Build succeeded
Actual Result:
C:\Users\valtunc\Desktop\AppSources\ControlzEx\src\ControlzEx\Theming\ThemeManager.cs(80,58): error CS8622: Nullability of reference types in type of parameter 'sender' of 'void ThemeManager.ThemesInternalCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)' doesn't match the target delegate 'NotifyCollectionChangedEventHandler' (possibly because of nullability attributes). [C:\Users\valtunc\Desktop\AppSources\ControlzEx\src\ControlzEx\ControlzEx_z4umz3jg_wpftmp.csproj]
C:\Users\valtunc\Desktop\AppSources\ControlzEx\src\ControlzEx\Theming\ThemeManager.cs(1235,59): error CS8622: Nullability of reference types in type of parameter 'sender' of 'void ThemeManager.HandleStaticPropertyChanged(object sender, PropertyChangedEventArgs e)' doesn't match the target delegate 'PropertyChangedEventHandler' (possibly because of nullability attributes). [C:\Users\valtunc\Desktop\AppSources\ControlzEx\src\ControlzEx\ControlzEx_z4umz3jg_wpftmp.csproj]
C:\Users\valtunc\Desktop\AppSources\ControlzEx\src\ControlzEx\Theming\ThemeManager.cs(1240,63): error CS8622: Nullability of reference types in type of parameter 'sender' of 'void ThemeManager.HandleStaticPropertyChanged(object sender, PropertyChangedEventArgs e)' doesn't match the target delegate 'PropertyChangedEventHandler' (possibly because of nullability attributes). [C:\Users\valtunc\Desktop\AppSources\ControlzEx\src\ControlzEx\ControlzEx_z4umz3jg_wpftmp.csproj]
C:\Users\valtunc\Desktop\AppSources\ControlzEx\src\ControlzEx\Theming\ThemeGenerator.cs(25,20): error CS8603: Possible null reference return. [C:\Users\valtunc\Desktop\AppSources\ControlzEx\src\ControlzEx\ControlzEx_z4umz3jg_wpftmp.csproj]
Results for DiscordChatExporter app:
C:\Users\valtunc\Desktop\AppSources\DiscordChatExporter\DiscordChatExporter.Gui\ViewModels\Framework\DialogScreen.cs(13,44): error CS8601: Possible null reference assignment. [C:\Users\valtunc\Desktop\AppSources\DiscordChatExporter\DiscordChatExporter.Gui\DiscordChatExporter.Gui_qfzufqja_wpftmp.csproj]
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Unable to compile .net 6.0 projects in VS 2022
I am unable to compile .net 6.0 projects in VS 2022 (version 17.4.3). I see error message that - MSB3971 The reference assemblies...
Read more >Migrating to .NET 6 : r/dotnet
If you have a reference type field/property that is not initialized by the constructor/field initializer, it will be null and if you use...
Read more >Compiler refuses to compile after I retarget a .NET 6 project ...
This error is shown when your project settings reference the language version 7.3. I assume you can verify this by right-clicking your ...
Read more >Nullable Reference types in C# – Best practices
In this tutorial, I look at the state of the Nullable Reference Types ... a null value to a non-nullable value type causes...
Read more >Fighting with nullable reference types in Razor Pages
In this post I discuss C#'s nullable reference types in the context ... C# reference types, and the ever-pervasive NullReferenceException .
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@batzen @ryalanms The app works fine now, thanks!
Will fix this in ControlzEx. Would be nice if you could create an issue there the next time you discover something like this. 😉