CodeSmith seems to run in .NET 2.0!

As you probably know, CodeSmith is a freeware code generator based on templates. Even though CodeSmith requires good C# or VB.NET programming skills, it is very, very flexible. When I told about it to my pal Tomás Zules, he liked the idea but, as we were in an ASP.NET 2.0 training, the immediate question was whether CodeSmith run on .NET 2.0, I didn't know so yesternight I made some testing. To begin with, the CodeSmith .msi installer demands .NET 1.1 so I had to look for another road so I downloaded the CodeSmith .zip file, unzipped it and I had CodeSmith in my .NET 2.0 partition. When I tried to run CodeSmith.exe, I got again a message asking for .NET 1.0 or 1.1 and, as I recalled of a similar issue with NUnit, I opened the CodeSmith.exe.config file and found this lines at the beginning of the file:

  <startup>
    <supportedRuntime version="v1.1.4322" />
    <supportedRuntime version="v1.0.3705" />
    <requiredRuntime version="v1.0.3705" />
  </startup>

Y just added my .NET version like this:

  <startup>
    <supportedRuntime version="v1.1.4322" />
    <supportedRuntime version="v1.0.3705" />
    <supportedRuntime version="v2.0.40607" />
    <requiredRuntime version="v1.0.3705" />
  </startup>

And lo and behold, it run.Well, at least some simple examples run. I hope some of you will make more detailed tests but, so far, .NET 2.0 binary compatibility with .NET 1.1 is looking good.

1 Comment

  • Excellent -- this actually solves a problem that I had been meaning to solve!!! Basically, I was trying to use a template that uses reflection on Whidbey assemblies, but the problem was that CS using 1.1 and the Reflection API puked on the Whidbey assemblies (naturally).



    I hadn't considered NOT installing 1.1 (it comes w/ 2003 server by default) and getting CS to run on top of Whidbey :)...

Comments have been disabled for this content.