Solutiondir in T4 Template

Asked

Viewed 27 times

2

I’m trying to carry a Assembly in the template T4, but when trying to use the $(SolutionDir) my Assembly does not load, only works if I put the whole way.

That’s how it works

<#@ assembly name="d:\Projetos\Meus.Scaffold\bin\Debug\Meus.Scaffold.dll" #>

So it doesn’t work

<#@ assembly name="$(SolutionDir)\bin\Debug\Meus.Scaffold.dll" #>

Without the two ways VS does not accuse that it was not possible to load the Assembly, but when rotating the command

Scaffold Triggers Teste Teste -force

I have the error

Add-ProjectItemViaTemplate : d:\Projetos\Projeto.Web\CodeTemplates\Scaffolders\Trigger\ConexaoTriggerDelete.cs.t4(3,11) : error CS0246: Compiling 
transformation: The type or namespace name 'Meus' could not be found (are you missing a using directive or an assembly reference?)
At d:\Projetos\Projeto.Web\CodeTemplates\Scaffolders\Trigger\Trigger.ps1:15 char:1
+ Add-ProjectItemViaTemplate $outputPath -Template $Template `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Add-ProjectItemViaTemplate], Exception
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.AddProjectItemViaTemplateCmdlet
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.