RdJNL / TextTemplatingCore

T4 Text Templating with .NET 6
Other
57 stars 15 forks source link

Error regarding <#@ import namespace="Microsoft.Extensions.Configuration" #> #11

Closed maxprog closed 1 year ago

maxprog commented 1 year ago

Hi, First of all, Thank You very much for amazing tool which solving all issues reagarding tt file in .net 6. I noticed that You tool has problem only with <#@ import namespace="Microsoft.Extensions.Configuration" #> and I've got error:

Error (21,21): error CS0234: The type or namespace name 'Extensions' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) Client.tt 21

So, my question is: how solve it this error.. I suppose that maybe TextTemplating source code will be improved or do You have any suggestion ?

RdJNL commented 1 year ago

I think you'll probably need to add an assembly reference, as the error message indicates. Microsoft.Extensions.Configuration is in its own assembly, so you could try adding <#@ assembly name="Microsoft.Extensions.Configuration" #>. Let me know if this works.