C# T4 Template equivalent for "extern alias"
Asked Answered
G

0

6

I'm looking for a way to make use of an assembly referenced by the project with an alias (i.e. other than global) from a runtime T4 template.

My goal is to be able to reference a namespace, with all its content obviously, from that assembly:

<#@ import namespace="CustomAlias::Target.Namespace" #>

Basically, I'm looking for the equivalent of writing something like:

extern alias CustomAlias;
using CustomAlias::Target.Namespace;

I've attempted searching, here and Google, and the only mention that I've found for aliases in a T4 context was about giving an alias to a namespace. Which is not my current issue.

Is this possible to do, or should I start looking for an alternative solution?

Gamone answered 9/4, 2014 at 11:59 Comment(1)
You might be able to use <#@ template compilerOptions="-reference:CustomAlias=SomeAssembly" #> to do this.Recidivate

© 2022 - 2024 — McMap. All rights reserved.