<#@ template debug="false" hostspecific="true" language="C#" #> <#@ assembly name="EnvDTE" #> <#@ assembly name="System.Core" #> <#@ import namespace="System.Reflection" #> <#@ output extension=".cs" #> using System; using System.Collections.Generic; using System.Linq; using System.Xml; namespace MyProject { <# EnvDTE.DTE dte = (EnvDTE.DTE) ((IServiceProvider) this.Host) .GetService(typeof(EnvDTE.DTE)); // Assembly assembly = Assembly.LoadFrom(@"c:\CAD.dll"); Assembly assembly = Assembly.LoadFrom(System.IO.Path.Combine(dte.ActiveDocument.Path, @"bin\Debug\CAD.dll")); Type[] ts = assembly.GetTypes(); foreach (var item in ts) { #> public class <#=item.Name#> {} <# } #> }