I am trying to reference a .NET 4.6 assembly from my ASP.NET 5 project. I'm running ASP.NET and Web Tools 2015 (RC1 Update 1).
I've read the following question but could not get it to work: ASP.NET 5 Application Reference .NET 4.6 DLL
I've also read the following question but I can't even get the project to build: Referencing a .NET 4.6 project from ASP.NET 5 causes build error
When the target framework on the referenced assembly is set to 4.5.1, I can build and run the application but as soon as the target framework on the referenced assembly is changed to 4.6, the compiler reports the following error:
"The type or namespace name 'ClassLibrary' could not be found (are you missing a using directive or an assembly reference?)"
Below are some of the sections of my project.json file where "ClassLibrary" is my referenced .Net 4.6 assembly.
"dependencies": {
"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": {
"dnx46": {
"dependencies": {
"ClassLibrary": "1.0.0-*"
}
},
},