question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[.NET 6] [Source Compat Failure] ControlzEx app doesn't build with "Possible null reference" when retarget 6.0

See original GitHub issue

Application 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

  1. Source Code at https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1269988
  2. Make sure target 6.0
  3. goto src\ControlzEx
  4. 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]

@dotnet-actwx-bot @dotnet/compat

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
jiangzeng01commented, Feb 7, 2021

@batzen @ryalanms The app works fine now, thanks!

1reaction
batzencommented, Feb 3, 2021

Will fix this in ControlzEx. Would be nice if you could create an issue there the next time you discover something like this. 😉

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found