1

我正在尝试在 mac 上运行 asp.net。我正确安装了所有东西,但是当我运行命令“ dnx web”时它崩溃了。

这是我的 project.json 文件:

 {
   "version": "1.0.0-*",
   "compilationOptions": {
     "emitEntryPoint": true
   },
   "tooling": {
     "defaultNamespace": "MyWebApp"
   },

   "dependencies": {
     "EntityFramework.Commands": "7.0.0-rc1-final",
     // Dependencies deleted for brevity.
     "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final"
   },

   "commands": {
     "web": "Microsoft.AspNet.Server.Kestrel",
     "ef": "EntityFramework.Commands"
   },

   // Markup deleted for brevity.

   "scripts": {
     "prepublish": [
       "npm install",
       "bower install",
       "gulp clean",
       "gulp min"
     ]
   }

} 那是日志:

System.TypeLoadException:无法从程序集“Microsoft.Extensions.PlatformAbstractions,版本=1.0.0.0,Culture=neutral,加载类型“Microsoft.Extensions.PlatformAbstractions.IAssemblyLoadContextAccessor”,

4

1 回答 1

2

我昨天刚刚在我的 Mac 上做了这个,没有任何问题。您可以运行“dnvm list”命令来确保正确的 DNX 存在吗?

你也做了“dnu restore”吗?

另外,您能否总结一下您为达到现在所采取的步骤?当我第一次尝试它时,我在某个地方错过了一步,它对我不起作用。然后我重新阅读了这些步骤并再次尝试,然后它对我有用。

I also realized that my port number was different from the one in the documentation so the browser couldn't find my web app the first time I had everything done right. I looked at the terminal to determine the correct port number, then got it to work in my browser.

于 2016-04-11T23:57:06.020 回答