Compiling transformation: The type or namespace name could not be found when running TypeLite.tt

asp.net-mvc entity-framework javascript typescript

Question

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.

  • Contains all of the MVC work is MyApp.dll.
  • The EF domain model is contained in MyApp.Domain.dll.
  • The WebAPI work is located in MyApp.WebAPI.dll.

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.

1
7
4/19/2013 10:01:03 AM

Accepted Answer

ZZZ_tmp
15
4/18/2013 1:36:18 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow