如何在Visual Studio 2015中使用实体框架电动工具? [英] How to use Entity Framework Power Tools in Visual Studio 2015?

查看:171
本文介绍了如何在Visual Studio 2015中使用实体框架电动工具?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



但是当我刚刚设置Visual Studio 2015时,由NuGet设置EF电动工具,我找不到反向工程师代码优先选项。



任何人都知道我应该做什么?



谢谢!

解决方案

实体框架电动工具是Visual Studio 扩展程序,因此您需要先安装它但是,有一个问题,支持的Visual Studio版本是2010年,2012年和2013年。Visual Studio 2015是预览版本。我认为这就是为什么它不包括在内。但是我有一个解决方案适用于我这样的情况。


  1. 下载实体框架电动工具

  2. .vsix 文件是一个 zip ,因此您可以使用Winrar(或任何其他具有此功能的程序)解压缩它。仅解压缩名为 extension.vsixmanifest
  3. 的文件
  4. 在此文件(它是一个xml)中,您需要找到一个名为 SupportedProducts 并添加Visual Studio 2015版本(转到帮助 - >关于Microsoft Visual Studio 以查看您安装的版本)。

     < SupportedProducts> 
    ...
    < VisualStudio Version =14.0>
    < Edition> Ultimate< / Edition>
    < Edition>社区< / Edition>
    < / VisualStudio>
    < / SupportedProducts>


  5. 覆盖.vsix中的 extension.vsixmanifest 并尝试安装。


希望这个帮助



更新1



我尝试使用该配置(版本:14.0和版本:Ultimate),它工作正常。为了节省时间,您可以在此链接中下载。我还添加了社区版。



更新2



Julie Lerman 写了一个文章在她的博客中有关如何解决这个问题。



更新3



我强烈建议您使用 EntityFramework Reverse POCO Generator ,当您使用旧版数据库时。如果您的架构可能会更改多次而不使用迁移,那么最好有t4模板可以帮助您在每次更新数据库时重新生成模型。您唯一需要做的是右键单击.tt文件,然后执行 运行自定义工具 选项。 EF Power Tools还有一个选项可以让您自定义t4模板。


I have used Entity Framework in Visual Studio 2012. Build entity model by "reverse engineer code first".

But when I setup Visual Studio 2015 just now, and setup EF power tools by NuGet, I can not find "reverse engineer code first" option.

Anyone knows what i should do?

Thanks!

解决方案

Entity Framework Power Tools is a Visual Studio extension, so you need to install it first. But, there is a problem, the supported versions of Visual Studio are 2010, 2012 and 2013. Visual Studio 2015 is in Preview Version. I think that's why it is not included yet. But I have a solution that works for me in case like this.

  1. Download Entity Framework Power Tools
  2. The .vsix file is a zip, so you can unzip it using Winrar (or any other program with this functions). Unzip only the file named extension.vsixmanifest
  3. In this file (it's a xml) you need to find a tag named SupportedProducts and add the Visual Studio 2015 version (go to Help->About Microsoft Visual Studio to check what edition you have installed) .

     <SupportedProducts>
       ...
       <VisualStudio Version="14.0">
         <Edition>Ultimate</Edition>
         <Edition>Community</Edition>
       </VisualStudio>
     </SupportedProducts>
    

  4. Overwrite the extension.vsixmanifest file in the .vsix, and try to install that.

Hope this help

Update 1

I tried with that configuration (Version:14.0 and Edition:Ultimate) and It worked.To save time, you can download it in this link. I also added the Community edition.

Update 2

Julie Lerman wrote an article in her blog about how to solve this issue as well.

Update 3

I strongly recommend to use EntityFramework Reverse POCO Generator when you are working with legacy databases. If your schema could change several times not using migrations, then is preferable to have t4 template which can help you to re-generate the model every time the DB is updated. The only you need to do is right click on your .tt file and execute Run Custom Tool option, that's all. EF Power Tools also has an option that allows you to customize the t4 template.

这篇关于如何在Visual Studio 2015中使用实体框架电动工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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