Ask a questionAsk a question
 

AnswerT4 Project Reference doesn't work in VS2010 Beta 2

  • Friday, November 06, 2009 7:49 PMln613 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hi,

    In a .tt file, adding a assembly reference to another project in the solution (first in the current project, add a reference to the other project, then add <#@ assembly name="T1.dll"#> to the .tt file). 
     
    This works in VS2008, but in VS2010 Beta 2, it doesn't work. When I save the .tt file, I got the error:

    Compiling transformation: Metadata file 'T1.dll' could not be found

    Anything changed in VS2010 Beta 2?

    What should I do to make it work?


    Thanks

     

Answers

  • Friday, November 06, 2009 10:07 PMDuncanPMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    Yes, this behaviour has changed. The T4 host in VS no longer uses project references when resolving <#@ assembly #> directive processors as this can cause problems in multi-targetting scenarios.

    Instead, you can use environment variables or VS project variables in "assembly" and "include" directive processors e.g.
    <#@ assembly name="$(ProjectDir)\bin\Debug\ClassLibrary1.dll"#>

     

     

All Replies

  • Friday, November 06, 2009 10:07 PMDuncanPMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    Yes, this behaviour has changed. The T4 host in VS no longer uses project references when resolving <#@ assembly #> directive processors as this can cause problems in multi-targetting scenarios.

    Instead, you can use environment variables or VS project variables in "assembly" and "include" directive processors e.g.
    <#@ assembly name="$(ProjectDir)\bin\Debug\ClassLibrary1.dll"#>