t4 调试:ReflectionTypeLoadException "Unable to load one or more of the requested types"
t4 Debuging: ReflectionTypeLoadException "Unable to load one or more of the requested types"
我有一个自定义的 T4 模板。当我右击 select "Run Custom Tool" 它 运行 没有错误。如果我右键单击 select "Debug T4 Template" 我会得到上面的错误并添加
=== Pre-bind state information ===
LOG: DisplayName = My.Interfaces, Version=1.0.5708.24057, Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
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: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/My.Interfaces.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/My.Interfaces/My.Interfaces.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/My.Interfaces.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/My.Interfaces/My.Interfaces.EXE.
我正在使用 'Assembly' 指令以及从 c:... 到 dll 的完全限定有效路径。
<#@ Assembly Name="C:\...\MY.Interfaces.dll" #>
再次不调试时不报错
我的问题是如何让调试器正确导入程序集而不将其复制到 'IDE' 目录?
看来我引用的dll版本不对。它位于同一解决方案中项目的 bin 目录中。我更新了 dll 并重建了该项目。然后它就可以工作了,无需将 dll 放在其他任何地方。
:\
我有一个自定义的 T4 模板。当我右击 select "Run Custom Tool" 它 运行 没有错误。如果我右键单击 select "Debug T4 Template" 我会得到上面的错误并添加
=== Pre-bind state information ===
LOG: DisplayName = My.Interfaces, Version=1.0.5708.24057, Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
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: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/My.Interfaces.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/My.Interfaces/My.Interfaces.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/My.Interfaces.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/My.Interfaces/My.Interfaces.EXE.
我正在使用 'Assembly' 指令以及从 c:... 到 dll 的完全限定有效路径。
<#@ Assembly Name="C:\...\MY.Interfaces.dll" #>
再次不调试时不报错
我的问题是如何让调试器正确导入程序集而不将其复制到 'IDE' 目录?
看来我引用的dll版本不对。它位于同一解决方案中项目的 bin 目录中。我更新了 dll 并重建了该项目。然后它就可以工作了,无需将 dll 放在其他任何地方。
:\