Welcome to the CodeSmith Community!

Re: Generate DLL right from CST-file

Support Forums

Feel free to ask any questions about CodeSmith here.

Generate DLL right from CST-file

Answered (Verified) This question is answered

Hello!

I have CST (template) files for many classes from previous versions of CodeSmith. I need generate DLL files them.

Before version 6.x, there was a way to generate DLL right away. Now, if you give existing files to Generator, you get an empty DLL file.

I found the solution to get DLL from MSVS, but it is extremely time consuming when generating DLLs for dozens templates  (http://docs.codesmithtools.com/display/Generator/Building%2C+Running%2C+and+Compiling+Templates)

 

With CodeSmith 6.0, is there a way to generate DLL file right from CST template without Visual Studio and get not empty DLL file

 

Thanks!

  • Post Points: 35
Verified Answer
All Replies
  • Blake Niemyjski:

    Hello,

    Is there anyway you could send support the solution you created that creates an empty assembly. 

    Here you are:

    http://dl.dropbox.com/u/3405618/BaseRegionedTemplate.cst

    http://dl.dropbox.com/u/3405618/BaseRegionedTemplate.cst.cs

    Before CodeSmith 6.x, Generator resolved references by itself and it I needed is click Generate. Now, it seems tha tname of namespace in BaseRegionedTemplate.dll will be not "BaseRegionedTemplate" but "BaseRegionedTemplate_cst" and BaseDataObjectTemplate will not find the refenced library. 

    If you can generate BaseRegionedTemplate.dll, then there will be the next step: generate BaseDataObjectTemplate, which references BaseRegionedTemplate.dll.

    Can you please help with BaseDataObjectTemplate generating as well? Links to BaseDataObjectTemplate are:

    http://dl.dropbox.com/u/3405618/BaseDataObjectTemplate.cst

    http://dl.dropbox.com/u/3405618/BaseDataObjectTemplate.cst.cs

     

    Thanks,
    Anton 

     

     

  • Hello,

    You would need to add the BaseRegionedTemplate to a new Visual Studio Project called BaseRegionedTemplate and then add the template and partial class to the solution and follow the steps described here (http://docs.codesmithtools.com/display/Generator/Building%2C+Running%2C+and+Compiling+Templates). Please note that you will also have to add a CodeTemplate Directive Attribute for NameSpace and ClassName to this template. http://docs.codesmithtools.com/display/Generator/The+CodeTemplate+Directive

    From there you will just need to compile after following all the steps above and place the compiled assembly into the same directory as BaseDataObjectTemplate

    Blake Niemyjski
    CodeSmith Tools, LLC. Software Development Engineer
    Blog: http://windowscoding.com/blogs/blake/
    .NetTiers team | Visit http://www.nettiers.net

  • Page 1 of 1 (7 items)