简体   繁体   English

将实体框架核心与VSTO结合使用

[英]Using Entity Framework Core with VSTO

In our Word 2010 application-level VSTO AddIn we want to use EF Core to connect to a database. 在我们的Word 2010应用程序级VSTO AddIn我们要使用EF Core连接到数据库。 We followed the following official MSDN article for this purpose. 为此,我们关注了以下官方MSDN文章 But the article is talking about modifying project.json file that does not exits in a VSTO project. 但是本文讨论的是修改不会在VSTO项目中退出的project.json文件。 How can we do some tweaking somehow to make EF Core work in a VSTO project - or what are the alternatives ( but still using EF Core )? 我们如何进行一些调整以使EF Core在VSTO项目中工作?或者有哪些替代方案( but still using EF Core )?

I ran into a similar problem when using VS 2017 RC. 使用VS 2017 RC时遇到了类似的问题。

VS 2017 RC doesn't create a project.json file any longer so the only way to modify it is to do it through Dependencies - Manage Nuget Packages. VS 2017 RC不再创建project.json文件,因此修改该文件的唯一方法是通过“依赖关系-管理Nuget程序包”进行操作。

You can just manually add dependencies through the package manager, but make sure you pay close attention to the version numbers. 您可以通过软件包管理器手动添加依赖项,但请确保密切注意版本号。

This does the same thing as editing package.json. 这和编辑package.json一样。 I feel like they are giving us less control this way but I would imagine it also protects us from over editing this file. 我觉得他们以这种方式给我们带来了更少的控制权,但我想它也可以保护我们免于过度编辑此文件。

Hope that helps. 希望能有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM