Disclaimer: Please pardon me if I am missing the obvious because I am new to just about every piece of technology I am utilizing here.
I'm experimenting with MVC 4, Entity Framework 5, the Web API, and TypeScript with Knockout to create some UI elements. To make things "strongly" typed, I discovered the TypeLite project, which will take my EF model and produce TypeScript interfaces for me.
I've got three projects for my response.
I changed the TypeLite.tt and added the TypeLite reference through NuGet to the MyApp project.
<#@ template debug="false" hostspecific="True" language="C#" #> <#@ assembly name="$(SolutionDir)packages\TypeLite.0.8.2\lib\net40\TypeLite.dll" #> <#@ assembly name="$(TargetDir)$(TargetFileName)" #> <#@ import namespace="TypeLite" #> <#@output extension=".d.ts"#> <#= TypeScript.Definitions() .For<MyApp.Domain.Models.Country>() .For<MyApp.Domain.Models.State>() .For<MyApp.Domain.Models.Address>() .For<MyApp.Domain.Models.Contact>() #>
I see the following error when I "Run Custom Tool" on the TypeLite.tt:
Compiling transformation: The type or namespace name 'MyApp' could not be found (are you missing a using directive or an assembly reference?)
I tried including the following line(s):
<#@ import namespace="MyApp" #> <#@ import namespace="MyApp.Domain" #> <#@ import namespace="MyApp.Domain.Models" #>
However, I continue to receive the same error. I'm sure I'm overlooking something simple, and I'm still sifting through the countless pages that Dr. Google turns up for me when I reference a search for this, but I'm hoping someone on here can point me in the right direction.
Thank you for any assistance.