Question

I want to be able to reference an assembly in a T4 template but I don't want to bind myself to the debug/release mode version of it.

I tried to use the following to include my assembly:

<#@ assembly name="..\..\OtherAssy\bin\$(Configuration)\OtherAssy.dll" #>

but this throws an error saying it cant find the dll.

Can I use the Configuration property to get the configuration mode e.g. debug/release? Or am I barking up the wrong tree?

Was it helpful?

Solution

Yes you can, (for transforms within the IDE at least), but your relative path won't work, as T4's 'current' directory isn't the project folder but rather VS's installation folder.

So if you use $(SolutionDir) or $(ProjectDir) you should be good to go.

Incidentally, the full list of variables is here on MSDN

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top