Hi,
I have created a custom tool that inherits from BaseCodeGeneratorWithSite. This overrides GetDefaultExtension and GenerateCode, and makes use of base.CreateExceptionMessage (if there's an exception) and base.GeneratorErrorCallback (if I detect errors with the input).
I've registered this with /codebase (not GAC'd) and added it to the "VisualStudio\10.0_Config\Generators" key with GeneratesDesignTimeSource set to 1.
My input file is called "xyz.action" and my default extension is ".action.cs". I have the custom tool's name specified in the "Custom Tool" property of my input file, and when I save or go to "Run Custom Tool", it generates the output correctly.
However, if there are errors in my input file, the errors are not output to the VS Output/Error List (I was expecting GeneratorErrorCallback to write things there?). I have tried this with the input file's "Build Action" set to "Content" and set to "Compile". When set to "Content", VS just generates the output. When set to "Compile", VS generates the output, but also tries to compile the input as if it were C#, i.e., I get C# errors linked to the input file (even though the input file is called xyz.action?)
Of all the few examples and tutorials I've read on this, none of them mention how to handle errors and only one mentioned the Build Action, which it said it should be "Compile". There were a few other interesting posts... well, their title
seemed interesting, but they only covered details such as 404: page cannot be found.
Is a BaseCodeGeneratorWithSite custom tool supposed to be able to generate VS errors, and if so, how?
Thank you kindly,
Regards,
Eliott