开发者

How can I reference an assembly in T4 in a way that's supported by both Visual Studio 2010 and TextTransform.exe?

VS2010 introduces a new way to reference assemblies in T4: http://weblogs.asp.net/lhunt/archive/2010/05/04/t4-template-error-assembly-directive-cannot-locate-referenced-assembly-in-visual-studio-2010-project.aspx

These new ways sure seem great, and I've upgraded my t4 files to work this way, but I'd like something that's executable from both visual studio and the command line. I'm currently using TextTransform.exe, and it doesn't seem to matter which version I use, C:\Program Files (x86)\Common Files\Microsoft Shared\TextTemplating\10.0 or C:\Program开发者_运维技巧 Files (x86)\Common Files\Microsoft Shared\TextTemplating\1.2, it requires the old, VS2008 style assembly references (i'm using the -P, reference path, parameter).

Is there a way I can reference custom assemblies from a t4 file that works in both visual studio 2010 and from the command line?


Are you using TextTransform.exe only for testing? If so, you might want to consider using VS macros for the paths and replacing them in the template files in your test setup phase.


Unfortunately, we didn't have time to make equivalent updates to TextTransform.exe so that it matches the built-in Visual Studio 2010 experience in this release cycle. The workarounds suggested above are your best bet at present.

We're thinking about ways to get something out there currently, but I don't have an ETA for you I'm afraid.

I'm interested to get feedback on texttransform.exe/T4msbuild prioritization - which matters most to the community?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜