TypeLite -> TypeScript -> ReflectionTypeLoadException:无法加载一种或多种请求的类型

TypeLite -> TypeScript -> ReflectionTypeLoadException: Unable to load one or more of the requested types

当我尝试使用 TypeLite.Net4.tt

中的 Run Custom ToolDebug T4 Template 时出现以下错误

ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

如果我在收到此错误后尝试构建项目:

Could not copy "obj\Debug\Shared.Web.dll" to "bin\Debug\Shared.Web.dll". Exceeded retry count of 10. Failed. The file is locked by: "T4VSHostProcess.exe (9848)"

TypeLite 以前工作过,但由于某种原因现在停止工作了。 TypeLite 从两个项目生成文件,ModelsShared.Web 的引用项目。这两个 DLL 都存在于 bin\Debug\.

我在 SO 上阅读了关于检索 LoaderException 和获取更多信息的答案,但我不知道如何为 T4 执行此操作。

通过编辑 TypeLite.Net4.tt 解决并显式包含其他程序集。这以前有效,所以我无法回答为什么我现在必须这样做。

<#@ assembly name="$(TargetDir)Model.dll" #>