codecadwallader / codemaid

CodeMaid is an open source Visual Studio extension to cleanup and simplify our C#, C++, F#, VB, PHP, PowerShell, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding.
http://www.codemaid.net
GNU Lesser General Public License v3.0
1.89k stars 356 forks source link

VS2022 cleanup fails in csproj files - null reference exception #870

Open internayt opened 2 years ago

internayt commented 2 years ago

Environment

Description

Attempt to run a cleanup on a csproj file, get the error: Object reference not set to an instance of an object.

Steps to recreate

1 - Open any csproj file 2 - Run cleanup

Current behavior

Shows an error

Expected behavior

Should reformat the XML

FYI - this used to work in VS2019 with v11.2

pierrebrito commented 2 years ago

I have same error.

codecadwallader commented 2 years ago

Thanks for reporting the issue. I am able to reproduce it. Once I attached a debugger though to diagnose it then it started working correctly.

AlastairBateman commented 2 years ago

I get the same thing, but only with "Cleanup Open Code". "All Code" and "Active Document" work fine.

Environment: Windows 11 build 22000.376 Visual Studio Professional 2022 (v17.0.4) CodeMaid 12.0

RedBeardDotDev commented 1 year ago

I'm getting the same thing, also with only "Clueanup Open Code".

Environment: Windows 11 22H2 (OS Build 22621.2134) Visual Studio Professional 2022 (v17.7.1) CodeMaid 12.0

Edit: Typo

dprevato commented 11 months ago

I have the same issue, with every type of cleaning. I'm using Visual Studio Enterprise 2022 version 17.7.4.