简体   繁体   中英

When targeting dnx451 I don't seem to be able to add reference to MEF (System.ComponentModel.Composition)

Using the latest beta (beta8) and only targeting dnx451 I thought that I would be able to make use of the full .net client framework. I am trying to create a plugin infrastructure in a vnext/dnx application where I can reload the plugins without restarting the app using MEF and have seen some examples but it doesn't look like I can use MEF with dnx451 (I am not targeting dnxcore).

So just in case anyone else runs across this the main Issue that I ran into was the Visual Studio tooling was not updating the project.json correctly. Below is an example of how the framework assemblies references should be added (Such as MEF)

{
  "version": "1.0.0-*",
  "description": "AutoSpark.Runner Class Library",
  "authors": [ "bferr" ],
  "tags": [ "" ],
  "projectUrl": "",
  "licenseUrl": "",
    "frameworks": {
        "net451": {
            "frameworkAssemblies": {
                "System.ComponentModel.Composition": "4.0.0.0",
                "System.Reflection.Context": "4.0.0.0",
                "System.ComponentModel.Composition.Registration": "4.0.0.0"
            }
        }
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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