I found the excellent article by Paulo Reichert at http://blogs.conchango.com/pauloreic...5/21/1459.aspx,
which shows how to build a code generator for Visual Studio 2005. I followed
this and made a small generator that output a dummy file containing only
this:
namespace TestNamespace { public class TestClass { } }
This works nicely. The namespace and class is available in the project and
I can compile it and check that it's present via Reflector.
However, if in the solution explorer I make it show all the files so I can
see my generated file and double-click on that file, it opens up in Notepad,
whereas the Settings.Design er.cs file opens up inside Visual Studio.
Additionally, if I right-click on Settings.Design er.cs and selects View Code,
the file opens up in VS, but if I do the same on mine I get this error message:
---------------------------
Microsoft Visual Studio
---------------------------
There is no editor available for 'D:\Dev\VS.NET\ WindowsApplicat ion113\WindowsA pplication113\t est.Designer.cs '.
Make sure the application for the file type (.cs) is installed.
---------------------------
OK
---------------------------
I'm not sure what, if anything, to do about this.
Opening up both of these files in a binary editor shows me that the Settings.Design er.cs
file got BOM at the start but mine doesn't, probably because I chose UTF-8
encoding.
If anyone got any advice, please let me know. I can post the project if anyone
wants to look at it, but a "short and complete example" can't be shown in
this post.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:la***@vk arlsen.no
PGP KeyID: 0x2A42A1C2