【发布时间】:2018-02-24 05:14:23
【问题描述】:
在 T4 中,我只想引用我自己项目的程序集。按照网上的说明,我尝试了以下方法:
<#@ assembly name="$(TargetDir)" #>
接着是:
<#@ import namespace="LazyDeploy" #>
供您参考,这是我的解决方案结构:
除了HTMLFactory 命名空间之外,所有内容都在LazyDeploy 命名空间范围内。我还尝试将模板放入解决方案的根目录,但无济于事。错误如下:
An exception was thrown while trying to compile the transformation code. The following Exception was thrown:
System.IO.FileNotFoundException: Could not find a part of the path 'c:\users\kmalton\documents\visual studio 2017\Projects\LazyDeploy\LazyDeploy\bin\Debug\'.
File name: 'c:\users\kmalton\documents\visual studio 2017\Projects\LazyDeploy\LazyDeploy\bin\Debug\' ---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'c:\users\kmalton\documents\visual studio 2017\Projects\LazyDeploy\LazyDeploy\bin\Debug\'.
我不确定为什么会出现这种情况,因为目录存在,即我可以直接从堆栈跟踪剪切并粘贴到资源管理器中并在那里导航。
【问题讨论】:
标签: visual-studio visual-studio-2017 .net-assembly t4