4
votes

I'm trying to create my first ASP.NET 5 Web Api project. I need to add a previously create class library as a reference. So I go References -> Add reference and add the appropriate project. Unfortunately the reference is still unresolved.

Seems like it happens cause the reference goes to DNX 4.5.1 but not DNX Core 5.0. And in project.json it goes not to root dependencies but to frameworks:

"frameworks": {
        "dnx451": {
            "dependencies": {
                "MyLibrary": "1.0.0-*"
            }
        },
        "dnxcore50": { }
    },

What should I do to my library to make it compatible to ASP.NET 5?

1
if you are not able to port the MyLibrary to dnxcore50 then you could remove dnxcore50 from your project.json and only use dnx451 aka desktop framework.Joe Audette

1 Answers

4
votes

If the libraries that your project depends on don't support dotnetcore50 (CoreCLR) then you're out of luck. You need those to be ported first to CoreCLR before other CoreCLR libraries can use them.

Once you get a CoreCLR enabled dependency, you can add it to the top level dependencies node in project.json and then it will be available to all frameworks that your project supports.