Error: Compiling transformation: 'TypeLite.TsGeneratorOutput' does not contain a definition for 'Classes'

Issue #59 resolved
jefoliveira
created an issue

I've just upgraded TypeLite to 0.9.4.0 to play with the export enums feature.

I'm using the out-of-the-box TypeLite.Net4.tt file, which content is:

<#@ template debug="false" hostspecific="True" language="C#" #>
<#@ assembly name="$(TargetDir)TypeLite.dll" #>
<#@ assembly name="$(TargetDir)TypeLite.Net4.dll" #>
<#@ assembly name="$(TargetDir)$(TargetFileName)" #>

<#@ import namespace="TypeLite" #> 
<#@ import namespace="TypeLite.Net4" #> 
<#@output extension=".d.ts"#>

 <#@include file="Manager.ttinclude"#>
<# var manager = Manager.Create(Host, GenerationEnvironment); #>

<# var ts = TypeScript.Definitions()
        .WithReference("Enums.ts")
        .ForLoadedAssemblies();
#>

<#= ts.Generate(TsGeneratorOutput.Classes) #>

<# manager.StartNewFile("Enums.ts"); #>
<#= ts.Generate(TsGeneratorOutput.Enums) #>
<# manager.EndBlock(); #>
<# manager.Process(true); #>

Saving the file/running custom tool I have these errors:

Error   1   Compiling transformation: 'TypeLite.TsGeneratorOutput' does not contain a definition for 'Classes'  d:\Code\Service.WebApi\Scripts\TypeLite.Net4.tt 18  131 Service.WebApi
Error   2   Statements are not allowed in ambient contexts. D:\Code\Service.WebApi\Scripts\TypeLite.Net4.d.ts   1   1   TypeLite.Net4.d.ts
Error   3   Could not find symbol 'ErrorGeneratingOutput'.  D:\Code\Service.WebApi\Scripts\TypeLite.Net4.d.ts   1   1   TypeLite.Net4.d.ts

Checking TsGeneratorOutput source code I noticed that "TsGeneratorOutput" contains no "Classes" value.

Any workaround?

Comments (3)

  1. Log in to comment