简体   繁体   English

在 ASP.NET 5/VS2015 中遇到 DNX 参考问题

[英]Stuck with DNX reference issue in ASP.NET 5/VS2015

DNX 参考问题

This is the Error which I am getting and i have installed with Powershell 3.0 Kindly help me with the solution.这是我得到的错误,我已经安装了 Powershell 3.0 请帮我解决这个问题。 Not sure how do overcome this issue.不知道如何克服这个问题。 I have tried to upgrade dnvm but nothing works out :(我曾尝试升级 dnvm,但没有任何效果:(

PATH=.\node_modules\.bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External;%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\git
C:\Users\Selva\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta8\bin\dnx.exe "C:\Users\Selva\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta8\bin\lib\Microsoft.DNX.PackageManager\Microsoft.DNX.PackageManager.dll" restore "C:\Projects\MVA\src\MVA" -s "C:\Program Files (x86)\Microsoft Web Tools\DNU"
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.DNX.PackageManager' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.DNX.PackageManager'
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
   at Microsoft.Dnx.Runtime.Loader.LoadContext.Load(AssemblyName assemblyName)
   at Microsoft.Dnx.Host.Bootstrapper.RunAsync(List`1 args, IRuntimeEnvironment env, String appBase, FrameworkName targetFramework)
   at Microsoft.Dnx.Host.RuntimeBootstrapper.ExecuteAsync(String[] args, BootstrapperContext bootstrapperContext)
   at Microsoft.Dnx.Host.RuntimeBootstrapper.Execute(String[] args, BootstrapperContext bootstrapperContext)
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
PATH=.\node_modules\.bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External;%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\git
C:\Users\Selva\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta8\bin\dnx.exe "C:\Users\Selva\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta8\bin\lib\Microsoft.DNX.PackageManager\Microsoft.DNX.PackageManager.dll" restore "C:\Projects\MVA\src\MVA" -f "C:\Program Files (x86)\Microsoft Web Tools\DNU"
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.DNX.PackageManager' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.DNX.PackageManager'
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
   at Microsoft.Dnx.Runtime.Loader.LoadContext.Load(AssemblyName assemblyName)
   at Microsoft.Dnx.Host.Bootstrapper.RunAsync(List`1 args, IRuntimeEnvironment env, String appBase, FrameworkName targetFramework)
   at Microsoft.Dnx.Host.RuntimeBootstrapper.ExecuteAsync(String[] args, BootstrapperContext bootstrapperContext)
   at Microsoft.Dnx.Host.RuntimeBootstrapper.Execute(String[] args, BootstrapperContext bootstrapperContext)
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
PATH=.\node_modules\.bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External;%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\git
C:\Users\Selva\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta8\bin\dnx.exe "C:\Users\Selva\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta8\bin\lib\Microsoft.DNX.PackageManager\Microsoft.DNX.PackageManager.dll" restore "C:\Projects\MVA\src\MVA" -f "C:\Program Files (x86)\Microsoft Web Tools\DNU"
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.DNX.PackageManager' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.DNX.PackageManager'
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
   at Microsoft.Dnx.Runtime.Loader.LoadContext.Load(AssemblyName assemblyName)
   at Microsoft.Dnx.Host.Bootstrapper.RunAsync(List`1 args, IRuntimeEnvironment env, String appBase, FrameworkName targetFramework)
   at Microsoft.Dnx.Host.RuntimeBootstrapper.ExecuteAsync(String[] args, BootstrapperContext bootstrapperContext)
   at Microsoft.Dnx.Host.RuntimeBootstrapper.Execute(String[] args, BootstrapperContext bootstrapperContext)
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

My Project.Json goes like below我的 Project.Json 如下所示

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

  "dependencies": {
    "EntityFramework.SqlServer": "7.0.0-beta5",
    "EntityFramework.Commands": "7.0.0-beta5",
    "Microsoft.AspNet.Mvc": "6.0.0-beta5",
    "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-beta5",
    "Microsoft.AspNet.Authentication.Cookies": "1.0.0-beta5",
    "Microsoft.AspNet.Authentication.Facebook": "1.0.0-beta5",
    "Microsoft.AspNet.Authentication.Google": "1.0.0-beta5",
    "Microsoft.AspNet.Authentication.MicrosoftAccount": "1.0.0-beta5",
    "Microsoft.AspNet.Authentication.Twitter": "1.0.0-beta5",
    "Microsoft.AspNet.Diagnostics": "1.0.0-beta5",
    "Microsoft.AspNet.Diagnostics.Entity": "7.0.0-beta5",
    "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-beta5",
    "Microsoft.AspNet.Server.IIS": "1.0.0-beta5",
    "Microsoft.AspNet.Server.WebListener": "1.0.0-beta5",
    "Microsoft.AspNet.StaticFiles": "1.0.0-beta5",
    "Microsoft.AspNet.Tooling.Razor": "1.0.0-beta5",
    "Microsoft.Framework.Configuration.Abstractions": "1.0.0-beta5",
    "Microsoft.Framework.Configuration.Json": "1.0.0-beta5",
    "Microsoft.Framework.Configuration.UserSecrets": "1.0.0-beta5",
    "Microsoft.Framework.Logging": "1.0.0-beta5",
    "Microsoft.Framework.Logging.Console": "1.0.0-beta5",
    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-beta5"
  },

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

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

  "exclude": [
    "wwwroot",
    "node_modules",
    "bower_components"
  ],
  "publishExclude": [
    "node_modules",
    "bower_components",
    "**.xproj",
    "**.user",
    "**.vspscc"
  ],
  "scripts": {
    "prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ]
  }
}

I'm under the impression that you have a version mismatch (older project with newer version of the framework).我的印象是您的版本不匹配(较旧的项目与较新版本的框架)。

First, make sure that you have the beta8 tooling installed.首先,确保您安装了beta8工具 Then, go in your project properties and make sure to change the target runtime to beta8 .然后,进入您的项目属性并确保将目标运行时更改为beta8

Finally, check your project.json to ensure that you are not left with pre- beta8 packages.最后,检查您的project.json以确保您没有留下beta8包。

In your project.json , ensure to remove any reference to beta5 and replace them by beta8 .在您的project.json ,确保删除对beta5任何引用并将其替换为beta8 Some packages were renamed and some were merged so you might not be able to replace everything.有些包被重命名,有些被合并,所以你可能无法替换所有东西。

If you are running with IIS and dependes on Microsoft.AspNet.Server.IIS , make sure to add app.RunIISPipeline();如果您使用 IIS 运行并且依赖于Microsoft.AspNet.Server.IIS ,请确保添加app.RunIISPipeline(); on your Startup.cs/Configure() method.在您的Startup.cs/Configure()方法上。

This issue appears to have been fixed in a newer release of ASP.net, which is available here.此问题似乎已在较新版本的 ASP.net 中修复, 可在此处获得。

Based on this discussion from GitHub基于来自 GitHub 的讨论

You need to not only install beta 8, but also the tooling for visual studio.您不仅需要安装 beta 8,还需要安装 Visual Studio 工具。 the download can be found here .下载可以在 这里找到。 Specifically, you need to download and install WebToolsExtensionsVS14.msi具体需要下载安装WebToolsExtensionsVS14.msi

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在安装vs2015之后在vs2015上安装Asp.Net? - How can I install Asp.Net on vs2015 after already installing vs2015 ? 安装VS2015后,asp.net 4.0尚未注册VS 2010 - asp.net 4.0 has not been registered VS 2010 after VS2015 install Microsoft ASP.NET和Web Tools 2015 - DNX和DNVM - Microsoft ASP.NET and Web Tools 2015 - DNX and DNVM 用VS2015创建的ASP.Net核心Web应用程序(.Net Framework)创建了一个看上去很狡猾的项目 - ASP.Net Core Web Application (.Net Framework) created with VS2015 creates a dodgy looking project 奇怪的ASP.Net错误:.net 4.6.1,VS2015 - 不支持插值字符串? - Strange ASP.Net Error: .net 4.6.1, VS2015 - interpolated strings not supported? 无法使用VS2015 RTM在ASP.NET 5项目上还原nuget程序包 - Can't restore nuget packages on ASP.NET 5 project with VS2015 RTM VS2015 / ASP.NET Web服务:服务器端超时,连接异常终止 - VS2015/ASP.NET WebService: Server-side timeout, Connection aborted 在VS2015中创建ASP.NET MVC5项目应该选择哪个模板? - Which template should be select for creating an ASP.NET MVC5 project in VS2015? F5不适用于Visual Studio 2017 RC中的VS2015 ASP.NET项目 - The F5 isn't working for VS2015 ASP.NET projects in Visual Studio 2017 RC 如果网站创建为 Visual C# ASP.Net Web 应用程序在 VS2015 中,PageMethods 不起作用 - PageMethods not working if the website is created as a Visual C# ASP.Net Web Application in VS2015
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM