I have done the following:
- Created a new Web.Api project: "WFW3". I used the "Web API" template under ASP.Net 5 .
- I created a new class library "Foo.Domain", again using ASP.Net. 5 .
- I added a link to it from the API project.
- I installed Neo4j.Driver (portable class library) from Nuget in a Foo.Domain project. Neo4j-NuGet
Everything seemed beautiful up to this point. Everything is compiled, although nothing has been done.
In Foo.Domain, I created a class with a method that referenced the GraphDatabase class inside of "use". Here he broke down.
I received this error message (and the like):
The type "IDisposable" is defined in an assembly that is not a reference. You should add a link to assembly 'System.Runtime, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a'. Foo.Domain..NET Framework 4.5.1 C: \ dev \ WFW3 \ src \ Foo.Domain \ FooRepository.cs
My understanding is that redirection binding is not available in ASP.Net 5. Is this correct? How can I solve this problem without referring to the correct version of System.Runtime? Elements found in System.Runtime are available to me. He seems to be looking for an older version of System.Runtime from the Neo4j.Driver.V1 build. I tried the solution found ( Nathan answer ), but then he started complaining that I was trying to import two different types of runtime libraries, and I needed to delete them. But which one should be removed and how?
Project.json API
{ "version": "1.0.0-*", "compilationOptions": { "emitEntryPoint": true }, "dependencies": { "Foo.Domain": "1.0.0-*", "Microsoft.ApplicationInsights.AspNet": "1.0.0-rc1", "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final", "Microsoft.AspNet.Mvc": "6.0.0-rc1-final", "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final", "Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final", "Microsoft.Extensions.Configuration.FileProviderExtensions": "1.0.0-rc1-final", "Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final", "Microsoft.Extensions.Logging": "1.0.0-rc1-final", "Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final", "Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final" }, "commands": { "web": "Microsoft.AspNet.Server.Kestrel" }, "frameworks": { "dnx451": { }, "dnxcore50": { } }, "exclude": [ "wwwroot", "node_modules" ], "publishExclude": [ "**.user", "**.vspscc" ] }
Foo.Domain project.json
{ "version": "1.0.0-*", "compilationOptions": { "emitEntryPoint": true }, "dependencies": { "Foo.Domain": "1.0.0-*", "Microsoft.ApplicationInsights.AspNet": "1.0.0-rc1", "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final", "Microsoft.AspNet.Mvc": "6.0.0-rc1-final", "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final", "Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final", "Microsoft.Extensions.Configuration.FileProviderExtensions": "1.0.0-rc1-final", "Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final", "Microsoft.Extensions.Logging": "1.0.0-rc1-final", "Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final", "Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final" }, "commands": { "web": "Microsoft.AspNet.Server.Kestrel" }, "frameworks": { "dnx451": { }, "dnxcore50": { } }, "exclude": [ "wwwroot", "node_modules" ], "publishExclude": [ "**.user", "**.vspscc" ] }
Code FooRepository (in Foo.Domain):
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Neo4j.Driver.V1; namespace Foo.Domain { public class FooRepository: IFooRepository { public Foo GetById(string Id) {