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


disclaimer: i'm new every piece of technology using here, forgive me please if missing obvious...

i starting mess mvc 4 entity framework 5 , web api, , want use typescript knockout ui stuff. found typelite project take ef model , generate typescript interfaces me "strongly" typed.

my solution consists of 3 projects:

  • myapp.dll = contains of mvc work
  • myapp.domain.dll = contains ef domain model
  • myapp.webapi.dll = contains webapi work

i added typelite reference myapp project (via nuget), , modified typelite.tt read:

<#@ 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>() #> 

when "run custom tool" on typelite.tt error:

compiling transformation: type or namespace name 'myapp' not found (are missing using directive or assembly reference?)

i have tried adding line(s):

<#@ import namespace="myapp" #> <#@ import namespace="myapp.domain" #> <#@ import namespace="myapp.domain.models" #> 

it still keeps giving me same error though. missing trivial, , still picking thru thousands of articles dr. google finds me referencing search this, hoping on here can me find light.

thanks help...

t4 templating engine, drives typescript interfaces generation, runs separate process, though myapp.webapi project references myapp.domain.dll, t4 doesn't know it.

you should add assembly directive points myapp.domain.dll typelite.tt. it's t4 analogue of 'add reference" command regular c# projects.

<#@ assembly name="$(solutiondir)path\to\myapp.domain.dll" #> 

$(solutiondir) variable, contains path solution directory.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -