Today I quickly developed a new vNext class library, called Sales.Data
, to act as the DAL for an MVC 6 UI project. I am somewhat out of my depth with ASP.NET 5, MVC6, DNX, and whatever else "vNext" includes, but eventually, with a lot of trial and error, and a lot of googling, I somehow managed to turn a standard class library into a vNext library, but now I cannot reference it from my xUnit DNX test project, nor from my MVC 6 UI project. The library uses NHibernate for very basic data access, just to establish proof of concept. This is what the bottom part of its `project.json' looks like, and whether it makes sense or not why it looks like this, at one stage my test project could at least reference the library, if not run a test. Now it cannot even reference it. What is wrong with this project's dependencies and frameworks configuration?
"frameworks": {
"net46": {
"dependencies": {
"FluentNHibernate": "2.0.3",
"log4net": "2.0.5",
"NHibernate": "4.0.4.4000",
"Microsoft.Framework.ConfigurationModel": "1.0.0-beta4",
"Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta4"
}
}
},
"dependencies": {
"System.Diagnostics.Tools": "4.0.0"
}
You haven't posted the error (if any) or explained why you believe you "cannot even reference it", however I suspect that its because the projects you are referencing from do not target the same framework.
You are targeting net46
in the library above, when likely your MVC project is targeting dnx451
or something similar. If you change this project to instead (or also) target the frameworks your MVC project is targeting, you'll then be able to reference it.