Welcome to the CodeSmith Community!

Re: Typeloadexception when running nettiers in codesmith 5

.netTiers

A description has not yet been added to this group.

System.TypeLoadException: Could not load type 'System.DateTimeOffset' from assembly 'mscorlib

Answered (Verified) This question is answered

I just installed the full eval copy of CodeSmith and I am trying to run the NetTiers template.  I created my database connection (SQL 2005) and tested it with no errors.  I select the tables I want to use then click run.  I am getting the following error and cannot seem to find any solutions in other posts.

 System.TypeLoadException: Could not load type 'System.DateTimeOffset' from assembly 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
   at SchemaExplorer.SchemaUtility.GetSystemType(DbType type)
   at SchemaExplorer.DataObjectBase.get_SystemType()
   at MoM.Templates.CommonSqlCode.GetCSType(DataObjectBase field, Boolean nullable) in e:\CodeSmith\Samples\v5.0\Templates\Frameworks\NetTiers\TemplateLib\CommonSqlCode.cs:line 3559
   at MoM.Templates.CommonSqlCode.GetCSType(DataObjectBase field) in e:\CodeSmith\Samples\v5.0\Templates\Frameworks\NetTiers\TemplateLib\CommonSqlCode.cs:line 3507
   at _CodeSmith.NetTiers_cst.MappingInstance.__RenderMethod1(TextWriter writer, Control control) in e:\CodeSmith\Samples\v5.0\Templates\Frameworks\NetTiers\SchemaMapping\NetTiersMapInstance.Internal.cst:line 25
   at CodeSmith.Engine.DelegateControl.Render(TextWriter writer)
   at CodeSmith.Engine.Control.RenderChildren(TextWriter writer)
   at CodeSmith.Engine.Control.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.Render(TextWriter writer)
   at _CodeSmith.NetTiers_cst.MappingInstance.Render(TextWriter writer) in e:\CodeSmith\Samples\v5.0\Templates\Frameworks\NetTiers\SchemaMapping\NetTiersMapInstance.Internal.cst:line 51
   at _CodeSmith.NetTiers_cst.Go() in e:\CodeSmith\Samples\v5.0\Templates\Frameworks\NetTiers\NetTiers.cst:line 995
   at _CodeSmith.NetTiers_cst.__RenderMethod1(TextWriter writer, Control control) in e:\CodeSmith\Samples\v5.0\Templates\Frameworks\NetTiers\NetTiers.cst:line 4620
   at CodeSmith.Engine.DelegateControl.Render(TextWriter writer)
   at CodeSmith.Engine.Control.RenderChildren(TextWriter writer)
   at CodeSmith.Engine.Control.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.RenderToString()
   at CodeSmith.Gui.CodeTemplateGenerator.f(Object A_0, EventArgs A_1)

 

Any thoughts or suggestions would be greatly appreciated.

  • Post Points: 65
Verified Answer
All Replies
Page 2 of 2 (22 items) 12