T4模板转换由CustomHost获取错误 [英] T4 template transform getting error by CustomHost

查看:213
本文介绍了T4模板转换由CustomHost获取错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi Team,



我根据下面提到的Microsoft文档链接为T4模板转换创建了自定义主机。



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



我试图转换T4模板。但它得到"ErrorGeneratingOutput"。
$


我在主机错误列表中得到以下错误。



错误: 

获取AppDomain从主机运行转换时出现问题。这个过程无法继续。



我在控制台应用程序中使用的方法与其工作正常相同。但是当在Visual Studio扩展项目中使用上面的代码/方法时,它会得到错误。   



注:问题发生在Visual Studio 2015,2017 



我在那里搜索了更多链接没有解决方案。所以,请更新想法以解决上述问题。 

解决方案

嗨jayalakshmi,



对不起,答复延迟,



< span style ="line-height:107%; color:#242729; background:white">正如你所说," 但是当在Visual Studio扩展项目中使用上面的代码/方法时,它会得到错误。 "
但是根据您分享的github链接"
!警告]如果您正在写作一个Visual Studio扩展或包,考虑使用文本模板服务而不是
创建自己的主机。有关详情,请参阅 
调用
VS扩展中的文本转换
< span style ="color:#242729; background:white">"



在我看来,你不应该用customhost发布这个VSX项目。请再次检查您的项目。



真诚


可能 


Hi Team,

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 tried to transform T4 template. but its get "ErrorGeneratingOutput".

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. 

解决方案

Hi jayalakshmi,

Sorry for the reply delays,

As you say, "But when use above code/method in Visual Studio extension project its get error." But according the github link you shared "!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."

in my opinion, you should not to publish this VSX project with customhost. Please check your project again.

Sincerely

May  


这篇关于T4模板转换由CustomHost获取错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆