I'm using ASP.NET 5.0 and I wanted to run just on the new Core CLR, so I removed "dnx451": { }
from dependencies in my project.json
file. I now get the following error when I launch in IIS:
Failed to resolve the following dependencies for target framework 'DNX,Version=v4.5.1': Microsoft.AspNet.Mvc 6.0.0-beta4 Microsoft.AspNet.Server.IIS 1.0.0-beta4 Microsoft.AspNet.Server.WebListener 1.0.0-beta4 Microsoft.AspNet.StaticFiles 1.0.0-beta4
My understanding was that AspNet.Mvc 6 would run on Core CLR? Why then do I have to include dnx451
as a dependency?
My project.json
file:
{
"webroot": "wwwroot",
"version": "1.0.0-*",
"dependencies": {
"Microsoft.AspNet.Mvc": "6.0.0-beta4",
"Microsoft.AspNet.Server.IIS": "1.0.0-beta4",
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta4",
"Microsoft.AspNet.StaticFiles": "1.0.0-beta4"
},
"commands": {
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000"
},
"frameworks": {
"dnxcore50": { }
},
"exclude": [
"wwwroot",
"node_modules",
"bower_components"
],
"publishExclude": [
"node_modules",
"bower_components",
"**.xproj",
"**.user",
"**.vspscc"
]
}
I had this error when publishing my DNX web app. It turned out it was because I had upgraded from Beta5 to Beta6 but neglected to update my publish powershell script which looks like:
So in the last parameter my publish was still telling it to target beta5 instead of beta6.
Specifying
dnxcore50
as a dependency inproject.json
is not the same as telling the Solution to target thatdnx
. To fix this I had to modify the solutionglobal.json
file to use a specific version of thednx
(i.e. a specific .Net executable). I also had to change a fewusing
statements to use new Core CLR libraries instead of .Net 4.5 libraries. You will get intellisense and error warnings about these.The
global.json
file can be found under the Solution node. I had to add the sdk version part:Note that you can also edit this in a GUI:
Strongly recommend the recently uploaded ASP.NET Introduction and ASP.NET Deep Dive videos from Build 2015 available on Channel 9.