dotnet corefx中的System.Composition,是否使用了完整的dotnetframework?

时间:2016-05-06 17:44:25

标签: asp.net5

我从asp.net mvc 4asp.net webformsEf 5MEF 1升级到dotnet核心。 尽管现有代码,他们决定不支持dotnet核心,我需要阅读很多地方才能找到dotnet corefx开发的内容,我的一大问题是我不明白{{1添加依赖等系统 我将使用vs 2015's(System.Composition),因为似乎MEF2(System.ComponentModel.Composition)不会在dotnet核心中实现。所以我在vs2015中创建了一个类库(包)的项目,如下所示:  enter image description here

然后输入:

MEF1
进入PM。 现在,我的Install-Package Microsoft.Composition 文件如下所示:

project.json

问题在于:这是一个只使用dnx包的dnx项目吗?是的,该项目的文件扩展名为{ "version": "1.0.0-*", "description": "___ Class Library", "authors": [ "___" ], "tags": [ "" ], "frameworks": { "net451": { "dependencies": { "Microsoft.Composition": "1.0.30" } }, "dotnet5.4": { "dependencies": { "Microsoft.CSharp": "4.0.1-beta-23516", "System.Collections": "4.0.11-beta-23516", "System.Linq": "4.0.1-beta-23516", "System.Runtime": "4.0.21-beta-23516", "System.Threading": "4.0.11-beta-23516" } } } }

对我而言,我似乎正在使用.xproj的完整.net框架4.5.1实现。 这里还有一个Using System.Composition in dotnet corefx page链接,我没有找到任何有用的信息。

这是否意味着他们还没有在dotnet corefx中实现MEF2?

1 个答案:

答案 0 :(得分:3)

将“dotnet5.4”替换为“dnxcore50”。是的,MEF 1将不受支持,仅支持MEF 2。 我写了一篇关于使用它的帖子,你可以在这里找到:https://weblogs.asp.net/ricardoperes/using-mef-in-net-core