VS2017& T4模板 [英] VS2017 & T4 Templates

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

问题描述

我们已将我们的点网核心项目从VS 2015升级到Vs 2017项目,2017年不会在保存或重建时重新生成任何T4模板文件。


有谁知道如何解决这个问题?


谢谢


Owen

解决方案

Hi Owen Ashcroft,


感谢您的发布在这里。


非常感谢你找到这个问题。我创建了一个dot net项目并在Visual Studio 2015上添加了一个T4模板,然后从Visual Studio 2017中打开它。我遇到了你的问题,T4模板的结构已经被破坏了,没有
重新生成任何我们保存的T4模板文件。这应该是Visual Studio的升级问题。


此外,如果项目是一个普通项目而不是.dot net,则在将项目升级到Visual后,默认情况下不会加载T4模板2017年工作室。


要解决此问题,您可以在Visual Studio 2017上创建新的T4模板,然后复制上一个模板中的代码,  new模板工作正常。 


此外,我帮助您将此问题提交给Visual Studio开发者社区(感谢您的贡献),您可以按照您的意见和检查这个问题的反馈。我还会跟进此问题,我会向您发送此问题的最新
状态。


https://developercommunity.visualstudio.com/content/problem/31678/t4-template-files-does -work-after-update-project-f.html


希望这可以帮到你。



We have upgraded our dot net core project from VS 2015 to Vs 2017 project, 2017 doesn't regenerate any of our T4 template files on save, or build anymore.

Does anyone know how to fix this?

Thanks

Owen

解决方案

Hi Owen Ashcroft,

Thanks for posting here.

It`s very grateful for you finding this issue. I created a dot net project and add a T4 template on Visual Studio 2015, then open it from Visual Studio 2017. I have encountered your problem, the structure of T4 template has been destroyed, doesn't regenerate any of our T4 template files on save. That should be a upgrade issue for Visual Studio.

Besides, If the project is a common project not .dot net, the T4 template would not be loaded by default after upgrade project to Visual Studio 2017.

To resolve this issue, you can create a new T4 template on Visual Studio 2017, then copy the code in the previous template, the new template will works fine. 

In addition, I help you submit this issue to the Visual Studio Developer Community (Thanks for your contribution), you can follow with your comments and check the feedback of this issue. I will also follow up this issue, I will send you the latest status of this issue.

https://developercommunity.visualstudio.com/content/problem/31678/t4-template-files-does-work-after-update-project-f.html

Hope this can help you.


这篇关于VS2017& T4模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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