I have a new ASP.NET 5 project and setup the project.json as below;
"frameworks": {
"dnx451": {
"dependencies": {
"ExternalLibrary": "1.3.0" }
},
"dnxcore50": {}
}
I'm running the project through Kestrel with the default command defined in project.json.
"kestrel": "Microsoft.AspNet.Hosting --server Kestrel --server.urls http://localhost:5001"
Everything works fine. The project runs and the dependency works well. The only thing I don't understand it who decides on which underlying framework to use?
As far as I understand the project should fail if Kestrel uses dnxcore50. If that is the case how do we push Kestrel to use it?
Just as a side note, the project runs pretty good with no errors at all, but when I try to manually build the project with DNU I get the error below. I don't consider it critical at this point, as it does not cause a failure during run time as far as I can see. Just wanted to add it in case it helps.
In Visual Studio 2015, the framework used is determined in this order:
The project properties. Right-Click the .xproj in your Solution Explorer and select Properties. Head to the "Application" section (the default), and you can "Use Specific DNX version", including version, platform, and architecture.
The global.json. I don't know if the platform can be changed here, but for example:
Visual Studio uses a specific runtime by default depending on its version. I believe that VS 2015 RC uses beta4, .Net Framework, x64 by default.
When running from the command line, it's determined by your active
dnvm
. You can use the commanddnvm list
to display your installed VMs. You'll get a list similar to the following:The
*
indicates your current VM.coreclr
usesdnxcore50
, and the others (likelymono
on your Mac) use the corresponding framework, but seem to compile asdnx451
.