title: TypeLite fresh install doesn't work
body: <p>I just installed TypeLite into my project via NuGet, but it doesn't work, and everything I've tried hasn't helped... This is the file that was created after installing:</p>
  
  <pre><code>&lt;#@ template debug="false" hostspecific="True" language="C#" #&gt;
  &lt;#@ assembly name="$(TargetDir)TypeLite.dll" #&gt;
  &lt;#@ assembly name="$(TargetDir)TypeLite.Net4.dll" #&gt;
  &lt;#@ assembly name="$(TargetDir)$(TargetFileName)" #&gt;
  
  &lt;#@ import namespace="TypeLite" #&gt; 
  &lt;#@ import namespace="TypeLite.Net4" #&gt; 
  &lt;#@output extension=".d.ts"#&gt;
  
   &lt;#@include file="Manager.ttinclude"#&gt;
  &lt;# var manager = Manager.Create(Host, GenerationEnvironment); #&gt;
  
  &lt;# var ts = TypeScript.Definitions()
          .WithReference("Enums.ts")
          .ForLoadedAssemblies();
  #&gt;
  
  &lt;#= ts.Generate(TsGeneratorOutput.Properties) #&gt;
  
  &lt;# manager.StartNewFile("Enums.ts"); #&gt;
  &lt;#= ts.Generate(TsGeneratorOutput.Enums) #&gt;
  &lt;# manager.EndBlock(); #&gt;
  &lt;# manager.Process(true); #&gt;
  </code></pre>
  
  <p>This is the error I get:</p>
  
  <pre><code>Severity    Code    Description Project File    Line
  Error       Running transformation: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
     at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
     at System.Reflection.RuntimeModule.GetTypes()
     at System.Reflection.Assembly.GetTypes()
     at TypeLite.TsModelBuilder.Add(Assembly assembly)
     at TypeLite.Net4.TypeScriptFluentExtensions.ForLoadedAssemblies(TypeScriptFluent ts)
     at Microsoft.VisualStudio.TextTemplating097C215A707CB07DE5AACDA590F263DF8554A0CCA899B583BF1832F7C0C5D3E595312AE41D3DFD1BB9CA643458AA5D86FE3DBA281ED0000D4B4C1D87EA1DEFFB.GeneratedTextTransformation.TransformText() MyApp   S:\MyApp\Scripts\TypeLite.Net4.tt   1
  </code></pre>
  
  <p>If I choose "Debug T4 template" this is what I get:</p>
  
  <pre><code>Severity    Code    Description Project File    Line
  Error       Running transformation: System.IO.FileNotFoundException: Could not load file or assembly 'System.Web.Http, Version=5.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
  File name: 'System.Web.Http, Version=5.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
     at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
     at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
     at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
         at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly&amp; lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType&amp; attributeType, IRuntimeMethodInfo&amp; ctor, Boolean&amp; ctorHasParameters, Boolean&amp; isVarArg)
     at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
     at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
     at System.RuntimeType.GetCustomAttributes(Type attributeType, Boolean inherit)
     at TypeLite.Extensions.TypeExtensions.GetCustomAttribute[TType](Type type, Boolean inherit)
     at TypeLite.TsModelBuilder.&lt;Add&gt;b__4(Type t)
     at System.Linq.Enumerable.WhereArrayIterator`1.MoveNext()
     at TypeLite.TsModelBuilder.Add(Assembly assembly)
     at TypeLite.Net4.TypeScriptFluentExtensions.ForLoadedAssemblies(TypeScriptFluent ts)
     at Microsoft.VisualStudio.TextTemplating097C215A707CB07DE5AACDA590F263DF8554A0CCA899B583BF1832F7C0C5D3E595312AE41D3DFD1BB9CA643458AA5D86FE3DBA281ED0000D4B4C1D87EA1DEFFB.GeneratedTextTransformation.TransformText() in s:\MyApp\Scripts\TypeLite.Net4.tt:line 13
  
  === Pre-bind state information ===
  LOG: DisplayName = System.Web.Http, Version=5.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
   (Fully-specified)
  LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/
  LOG: Initial PrivatePath = NULL
  Calling assembly : Breeze.WebApi2, Version=1.5.0.0, Culture=neutral, PublicKeyToken=f6085f1a45e2ac59.
  ===
  LOG: This bind starts in LoadFrom load context.
  WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
  LOG: No application configuration file found.
  LOG: Using host configuration file: 
  LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
  LOG: Post-policy reference: System.Web.Http, Version=5.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
  LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/System.Web.Http.DLL.
  LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/System.Web.Http/System.Web.Http.DLL.
  LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/System.Web.Http.EXE.
  LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/System.Web.Http/System.Web.Http.EXE.
  LOG: Attempting download of new URL file:///S:/MyApp/bin/System.Web.Http.DLL.
  WRN: Comparing the assembly name resulted in the mismatch: Build Number
  LOG: Attempting download of new URL file:///S:/MyApp/bin/System.Web.Http/System.Web.Http.DLL.
  LOG: Attempting download of new URL file:///S:/MyApp/bin/System.Web.Http.EXE.
  LOG: Attempting download of new URL file:///S:/MyApp/bin/System.Web.Http/System.Web.Http.EXE.   MyApp   s:\MyApp\Scripts\TypeLite.Net4.tt   13
  </code></pre>
  
  <p>If I add this to the file:</p>
  
  <p>&lt;#@ assembly name="System.Web.Http.dll" #></p>
  
  <p>Then I get:</p>
  
  <pre><code>Error       Compiling transformation: Assembly 'WebUI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Http, Version=5.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'    MyApp   S:\MyASpp\Scripts\TypeLite.Net4.tt  1
  </code></pre>
  
  <p>Unfortunately I haven't been able to figure out where that 5.2.2 reference is; everything in my projects is 5.2.3. If I take the file path to my 5.2.3 DLL and put that in (which is c:\packages... from nuget), it works.</p>
  
  <p>I guess my question is why doesn't it find the DLL reference via the project, or is there a better way to do this? I won't want to have to hard-code paths in this file, ideally I wouldn't need to specify them at all, but I don't know how else to do it at this point.</p>