简体   繁体   中英

I can not start the project with Asp.Net MVC 6 and DNX

I created an empty project AspNet MVC 6, and chose .Net 4.6

My project.json file:

{
  "webroot": "wwwroot",
  "version": "1.0.0-*",

  "dependencies": {
    "Microsoft.AspNet.Server.IIS": "1.0.0-beta5",
    "Microsoft.AspNet.Server.WebListener": "1.0.0-beta5"
  },

  "commands": {
    "web": "Microsoft.AspNet.Hosting --config hosting.ini"
  },

  "frameworks": {
    "dnx451": { },
    "dnxcore50": { }
  },

  "publishExclude": [
    "node_modules",
    "bower_components",
    "**.xproj",
    "**.user",
    "**.vspscc"
  ],
  "exclude": [
    "wwwroot",
    "node_modules",
    "bower_components"
  ]
}

dnvm list :

Active Version     Runtime Architecture OperatingSystem Alias
------ -------     ------- ------------ --------------- -----
       1.0.0-beta4 clr     x64          win
       1.0.0-beta4 clr     x86          win
       1.0.0-beta4 coreclr x64          win
       1.0.0-beta4 coreclr x86          win
       1.0.0-beta5 clr     x64          win
       1.0.0-beta5 clr     x86          win
       1.0.0-beta5 coreclr x64          win
       1.0.0-beta5 coreclr x86          win
       1.0.0-beta6 clr     x86          win             default

When I run the project I get the following error :

The current runtime target framework is not compatible with 'WebApplication20'.

Current runtime Target Framework: 'DNX,Version=v4.5 (dnx45)' Type: CLR Architecture: x86 Version: 1.0.0-beta6-12256

Please make sure the runtime matches a framework specified in project.json

Where is my mistake?

You cannot have multiple versions installed, you need to only have one version of the runtime installed.

after dnvm uninstall deleted all files in %USERPROFILE%.dnx\\packages (only do this after uninstalling from programs and features)

dnvm list

dnvm upgrade or upgrade-self

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM