T4 template transform getting error by CustomHost

458 Views Asked by At

I tried to transform T4 template. but its get "ErrorGeneratingOutput".

I have created custom host for T4 template transform based on below mention Microsoft document link.

https://github.com/MicrosoftDocs/visualstudio-docs/blob/master/docs/modeling/walkthrough-creating-a-custom-text-template-host.md

I have get below error in host error list. Error : There was a problem getting an AppDomain to run the transformation from the host. The process cannot continue.

Same method I used in console application its working fine. But when use above code/method in Visual Studio extension project its get error.

Note:Issue occurred Visual Studio 2015, 2017

I have searched more link there is no solution. So, please update idea to resolve above reported issue.

1

There are 1 best solutions below

0
LoLance On

Please check the warning of the document like below:

[!WARNING] If you are writing a Visual Studio extension or package, consider using the text templating service instead of creating your own host. For more information, see Invoking Text Transformation in a VS Extension.

It seems you use the own host, which is not recommended by the author. Please check the document for text templating service to check if helps.