A fix for an IDE crash when generating with ClarionCL.exe
I recently encountered the following IDE crash when trying to generate a C8 application via the command line using ClarionCl.exe (which you can find in your Clarion bin directory):
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at ICSharpCode.SharpDevelop.FileService.GetOpenFile(String fileName) at ICSharpCode.SharpDevelop.FileService.OpenFile(String fileName) at ICSharpCode.SharpDevelop.Project.ProjectService.ParserServiceCreatedProjectContents() at ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.SafeThreadAsyncCall(Action method) at ICSharpCode.SharpDevelop.ParserService.LoadSolutionProjectsInternal() at ICSharpCode.SharpDevelop.ParserService.LoadSolutionProjects() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()
The stack trace suggested a problem with LoadSolutionProjectsInternal() - could there be some bad project data? But no, I couldn't find any reason in the project data for the problem.Â
I'd also been making some modifications to the Clarion template chain (I'm working with a lot of legacy apps these days) and at first I thought this had something to do with a template mod gone bad. But oddly most of the apps I tried to generate worked fine; only a few crashed. And they were apps I'd worked on recently, and I'd selected some global options in those apps. I thought maybe that was the reason.Â
But I couldn't find a pattern; I tried copying in saved versions of the apps; the same ones crashed as before.Â
Finally, in desperation I renamed my %appdata%\Roaming\SoftVelocity\Clarion\8.0\Preferences folder.Â
Presto! ClarionCL could generate my apps again.
Something in the app preferences clearly upset Clarion's digestion.Â
You can also clear out preferences via the ResetIDE program that ships with Clarion.Â