Our DSL Tool uses CodeSmith with an SDK license to generate code. Previously, the following DLLs were required to run CodeSmith using the SDK:
I have noticed that version 5.1.2.8409 requires CodeSmith.Feedback.Client.DLL (version 1.0.0.8621); however, I am still getting an error when trying to compile my CodeSmith templates using the CodeSmith API:
TypeInitializationException while generating code: The type initializer for 'CodeSmith.Engine.CodeTemplateCache' threw an exception. at CodeSmith.Engine.CodeTemplateCache.get_Instance() at CodeSmith.Engine.CodeTemplateInfo.EnsureTemplateInfo() at CodeSmith.Engine.CodeTemplateInfo.get_ContentHashCode() at CodeSmith.Engine.CodeTemplateInfo.GetHashCode() at CodeSmith.Engine.CodeTemplateCompiler.Compile(String outputPath, Boolean forceRecompile) at CodeSmith.Engine.CodeTemplateCompiler.Compile() at Cambridge.Framework.Domain.Metadata.CodeEngine.CodeSmith.CodeGenerator.RunCodeGenerator(String domainFile, IProjectStructure projectStructure) at Cambridge.Framework.Domain.Metadata.CodeEngine.CodeSmith.CodeGenerator.LoadProjectAndGenerateCode() at Cambridge.Framework.Domain.Metadata.CodeEngine.CodeSmith.CodeGenerator.GenerateCode(IVsSolution vsSolution, DTE2 dte, IVsUIShell uiShell) at Cambridge.Framework.Domain.Metadata.VSPackage.VSPackagePackage.GenerateCodeMenuItemCallback(Object sender, EventArgs e)
Are there other DLLs that we are missing when using the CodeSmith SDK?
Our final hurdle involved upgrading SQLite from v1.0.60.0 to v1.0.61.0.
So, in order to use the CodeSmith SDK v5.1.2, we are installing our DSL application as follows:
- CodeSmith.Engine.DLL v5.1.2 (install to Application Folder)- SchemaExplorer.DLL v5.1.2 (install to Application Folder)- Ionic.Utils.Zip.DLL v1.7.1.10 (install to GAC)- CodeSmith.Feedback.Client.DLL v1.0.0 (install to GAC)- System.Data.SQLite.DLL v1.0.61.0 (install to GAC)
Hello,
That should be all that you need to reference. Will I be able to reproduce this with what you sent me before?Thanks-Blake Niemyjski
Blake Niemyjski CodeSmith Tools, LLC. Software Development Engineer Blog: http://windowscoding.com/blogs/blake/ .NetTiers team | Visit http://www.nettiers.com
I think that Ionic.Utils.Zip.dll might be required also:
Yes you are correct, (forgot about that one). It is used to extract the samples if the samples are found. I will talk to my pm about giving the SDK documentation an overhaul.Thanks-Blake Niemyjski
Our assembly that calls the CodeSmith code references CodeSmith.Engine.DLL and SchemaExplorer.DLL. The System.Data.SQLite.DLL assembly gets installed into the GAC. I manually installed the following two DLLs in the GAC using gacutil.exe:
However, we are still getting the Type Initialization error as follows:
Is there something else that we are missing?
I'll keep this post updated with all that needs to installed in order to use the SDK.Thanks-Blake Niemyjski