MDK-SE icon indicating copy to clipboard operation
MDK-SE copied to clipboard

Crash: "an unexpected error occurred during the attempt to analyze the solution"

Open exo-pla-net opened this issue 1 year ago • 6 comments

System.NullReferenceException: Object reference not set to an instance of an object. at Malware.MDKServices.HealthAnalysis.GetProjects(IEnumerable1 projects) at Malware.MDKServices.HealthAnalysis.GetProjects(IEnumerable1 projects) at Malware.MDKServices.HealthAnalysis.AnalyzeAsync(Solution solution, HealthAnalysisOptions options) at MDK.MDKPackage.<OnSolutionLoaded>d__42.MoveNext() in D:\Repos\SpaceEngineers\MDK-SE\Source\MDK\MDKPackage.cs:line 209

exo-pla-net avatar Oct 10 '22 16:10 exo-pla-net

Notes:

  • Happened immediately when I loaded my .sln.
  • There's nothing SpaceEngineers related on my D:\ drive, so I'm not sure where the MoveNext() error is coming from.
  • The crash was resolved when I made a new Solution and copied the contents of my Projects over.

exo-pla-net avatar Oct 10 '22 16:10 exo-pla-net

Strange - what is different with that solution? And that's from the MDK source and has nothing to do with anything you have 🙂

malware-dev avatar Oct 10 '22 17:10 malware-dev

It could have been solar radiation that corrupted a bit somewhere in the .sln.

Only half-joking.

In the new solution, the only change was that I didn't select the "Trim" option for any of the Projects.

exo-pla-net avatar Oct 10 '22 17:10 exo-pla-net

The same error has resurfaced in my new Solution:

System.NullReferenceException: Object reference not set to an instance of an object.
   at Malware.MDKServices.HealthAnalysis.GetProjects(IEnumerable`1 projects)
   at Malware.MDKServices.HealthAnalysis.GetProjects(IEnumerable`1 projects)
   at Malware.MDKServices.HealthAnalysis.AnalyzeAsync(Solution solution, HealthAnalysisOptions options)
   at MDK.MDKPackage.<OnSolutionLoaded>d__42.MoveNext() in D:\Repos\SpaceEngineers\MDK-SE\Source\MDK\MDKPackage.cs:line 209

exo-pla-net avatar Oct 15 '22 21:10 exo-pla-net

Once again, making a new solution and copy-pasting the contents of all of my .cs files into new projects fixed the error/crashing.

exo-pla-net avatar Oct 15 '22 21:10 exo-pla-net

Next time, please upload the failing project.

malware-dev avatar Oct 16 '22 17:10 malware-dev

Since I haven't received any failing projects again I'll assume this is no longer a problem.

malware-dev avatar May 10 '23 12:05 malware-dev