DotNetAnalyzers / WpfAnalyzers

MIT License
168 stars 19 forks source link

NullReferenceException in WpfAnalyzers.RoutedEventEventDeclarationAnalyzer #187

Closed GeertvanHorrik closed 6 years ago

GeertvanHorrik commented 6 years ago

I am currently migrating tons of open source projects to the new .NET SDK project style. In one of the projects, I now encounter this:

CSC : error AD0001: Analyzer 'WpfAnalyzers.RoutedEventEventDeclarationAnalyzer' threw an exception of type 'System.NullReferenceException' with message 'Obj ect reference not set to an instance of an object.'. [C:\Source\orc.controls\src\Orc.Controls\Orc.Controls.csproj]

You can find the project at https://github.com/wildgums/orc.controls

For now I have disabled the analyzer to continue the migration process.

JohanLarsson commented 6 years ago

Does WPF work with SDK project now? Nice if so. I wrote a small hack for migrating: https://github.com/JohanLarsson/ProjectFileConverter

About the issue, I'll try to write a test to repor, then fix & release. Sorry about the bug, thanks for reporting.

GeertvanHorrik commented 6 years ago

I use MSBuild SDK Extras (see https://github.com/onovotny/MSBuildSdkExtras) by @onovotny. That allows me to create multi-targeting projects (so several versions of WPF, but also UAP, etc).

JohanLarsson commented 6 years ago

Released an update where this is hopefully fixed.

JohanLarsson commented 6 years ago

Do you still see this in the newest version?

GeertvanHorrik commented 6 years ago

Haven't noticed it, so let's close as fixed.