依赖关系> = 1.0.0-rc1-update1无法解析 [英] The dependency >= 1.0.0-rc1-update1 could not be resolved

查看:103
本文介绍了依赖关系> = 1.0.0-rc1-update1无法解析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将我的C#Web应用程序更新到下一个asp.net版本.

I want to update my C# web application to the next asp.net version.

我跑了

dnvm use  1.0.0-rc1-update1 -r clr arch x64 -p

和dnvm列表显示活动版本已设置为rc1-update1

and dnvm list shows that the active version has been set to rc1-update1

现在我想更新我的VS2015解决方案以使用rc1-update1

Now I want to update my VS2015 solution to use rc1-update1

我编辑了project.json以将版本从rc1-final更新为rc1-update1

I edited project.json to update the version from rc1-final to rc1-update1

但是VS现在指示程序包还原失败".而且我有这样的错误消息.

however VS now indicates "package restore failed". and I have error messages like this.

Severity    Code    Description Project File    Line    Suppression State
Error   CS0234  The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)    MyBootStrap.DNX 4.5.1    

将鼠标悬停在project.json显示的已编辑依赖项中

Hovering my mouse over the edited dependencies in project.json shows

我一定错过了一步. 如何升级我的项目以使用框架的活动版本?

I must be missing a step. How do I upgrade my project to use the Active Version of the framework?

[更新] 当我从模板创建一个新的Web应用程序时,我注意到它仍在使用rc1-final.

[Update] When I create a new web application from the template I notice that it is still using rc1-final.

解决方案资源管理器"窗口中也有一条消息 程序包还原失败" 输出显示以下内容

There is also a message in the Solution Explorer window "Package restore failed" The Output shows the following

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\kirsten\.dnx\runtimes\dnx-clr-win-x86.1.0.0-rc1-update1\bin\dnx.exe "C:\Users\kirsten\.dnx\runtimes\dnx-clr-win-x86.1.0.0-rc1-update1\bin\lib\Microsoft.Dnx.Tooling\Microsoft.Dnx.Tooling.dll" 
restore "E:\EShared\Dev2016\MyBootStrap\src\MyBootStrap" -f "C:\Program Files (x86)\Microsoft Web Tools\DNU"
Microsoft .NET Development Utility Clr-x86-1.0.0-rc1-16231
  CACHE https://www.nuget.org/api/v2/
Restoring packages for E:\EShared\Dev2016\MyBootStrap\src\MyBootStrap\project.json
  CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.AspNet.Diagnostics'
  CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.AspNet.IISPlatformHandler'
  CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.AspNet.Mvc'
  CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.AspNet.Mvc.TagHelpers'
  CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.AspNet.Server.Kestrel'
  CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.AspNet.StaticFiles'
  CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.AspNet.Tooling.Razor'
  CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.Extensions.Configuration.FileProviderExtensions'
  CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.Extensions.Configuration.Json'
  CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.Extensions.Logging'
  CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.Extensions.Logging.Console'
  CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.Extensions.Logging.Debug'
  CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.VisualStudio.Web.BrowserLink.Loader'
Unable to locate Dependency Microsoft.AspNet.Diagnostics >= 1.0.0-rc1-update1
Unable to locate Dependency Microsoft.AspNet.IISPlatformHandler >= 1.0.0-rc1-update1
Unable to locate Dependency Microsoft.AspNet.Mvc >= 6.0.0-rc1-update1
Unable to locate Dependency Microsoft.AspNet.Mvc.TagHelpers >= 6.0.0-rc1-update1
Unable to locate Dependency Microsoft.AspNet.Server.Kestrel >= 1.0.0-rc1-update1
Unable to locate Dependency Microsoft.AspNet.StaticFiles >= 1.0.0-rc1-update1
Unable to locate Dependency Microsoft.AspNet.Tooling.Razor >= 1.0.0-rc1-update1
Unable to locate Dependency Microsoft.Extensions.Configuration.FileProviderExtensions >= 1.0.0-rc1-update1
Unable to locate Dependency Microsoft.Extensions.Configuration.Json >= 1.0.0-rc1-update1
Unable to locate Dependency Microsoft.Extensions.Logging >= 1.0.0-rc1-update1
Unable to locate Dependency Microsoft.Extensions.Logging.Console >= 1.0.0-rc1-update1
Unable to locate Dependency Microsoft.Extensions.Logging.Debug >= 1.0.0-rc1-update1
Unable to locate Dependency Microsoft.VisualStudio.Web.BrowserLink.Loader >= 14.0.0-rc1-update1
Writing lock file E:\EShared\Dev2016\MyBootStrap\src\MyBootStrap\project.lock.json
Restore complete, 413ms elapsed

由此我看到它正在尝试运行dnx的x86版本.为什么会这样?

from this I see it is trying to run the x86 version of dnx. Why would that be?

[更新] 我想知道为什么会使用nuget.org/api/v2,所以我使用扩展管理器重新安装了nuget.显示版本 在Extension Manager中为3.3.0.167,但Package Manager的输出窗口仍然为V2.

[Update] I am wondering why it would be using nuget.org/api/v2 so I reinstalled nuget using extension manager. It shows version 3.3.0.167 in Extension Manager, yet the output window for Package Manager still metions V2.

我正在运行Windows 7

I am running Windows 7

[更新] project.json是

[Update] project.json is

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

  "dependencies": {
    "Microsoft.AspNet.Diagnostics": "1.0.0-rc1-update1",
    "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-update1",
    "Microsoft.AspNet.Mvc": "6.0.0-rc1-update1",
    "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-update1",
    "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-update1",
    "Microsoft.AspNet.StaticFiles": "1.0.0-rc1-update1",
    "Microsoft.AspNet.Tooling.Razor": "1.0.0-rc1-update1",
    "Microsoft.Extensions.Configuration.FileProviderExtensions" : "1.0.0-rc1-update1",
    "Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-update1",
    "Microsoft.Extensions.Logging": "1.0.0-rc1-update1",
    "Microsoft.Extensions.Logging.Console": "1.0.0-rc1-update1",
    "Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-update1",
    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc1-update1"
  },

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

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

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

这是我的NuGet.Config文件

Here is my NuGet.Config file

    <?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageRestore>
    <add key="enabled" value="True" />
    <add key="automatic" value="True" />
  </packageRestore>
  <packageSources>
    <add key="SBD" value="E:\EShared\NuGet" />
    <add key="nuget.org" value="https://www.nuget.org/api/v2/" />
  </packageSources>
  <activePackageSource>
    <add key="nuget.org" value="https://www.nuget.org/api/v2/" />
  </activePackageSource>
</configuration>

这是我的包裹来源

SBD只是我们内部开发的一些.我认为这不会影响事情.

The SBD one is just a few we developed in house. I don't think it should affect things.

推荐答案

似乎您将dnx(Microsoft .NET执行环境)的版本,dnvm(.NET版本管理器)的版本与版本号混合在一起了.程序集.

It seems you have mixed the version of dnx (Microsoft .NET Execution environment), the version of dnvm (.NET Version Manager) with the version number of the assemblies.

ASP.NET具有模块化结构.这具有优点和缺点.首先,您可以使用以下方法检查当前的dnvm(.NET版本管理器):

ASP.NET has a modular structure. This has advantages and disadvantages. First of all you can examine your current dnvm (.NET Version Manager) by using:

dnvm version

您可以使用

dnvm update-self

将其更新为最新版本.

以相同的方式使用

dnvm list

查看配置文件中安装的所有dnx(Microsoft .NET Execution环境). %USERPROFILE%\.dnx\runtimes.您将为每个已安装的dnx版本都有一个文件夹.通过使用dnvm use 1.0.0-rc1-update1 -r clr arch x64 -p可以更改PATH.您可以看到默认使用的当前版本dnx

to see all dnx (Microsoft .NET Execution environment) installed in your profile. %USERPROFILE%\.dnx\runtimes. You will have a folder for every installed version of dnx. By using dnvm use 1.0.0-rc1-update1 -r clr arch x64 -p you change the PATH. You can see the current versions dnx used by default

dnx --version

它使用%USERPROFILE%\.dnx\runtimes子目录中的dnx.exe,您将其包含在dnvm use ...的PATH中.

It uses the dnx.exe from the subdirectory of %USERPROFILE%\.dnx\runtimes, which you included in PATH by dnvm use ....

如果使用Visual Studio Project,则通常创建global.json其中包含

If you use Visual Studio Project then you create typically global.json which contains

{
  "projects": [
    "src"
  ],
  "sdk": {
    "version": "1.0.0-rc1-update1"
  }
}

此类设置会通知dnx的版本,该版本应在解决方案/项目的构建过程中使用.

Such a setting informs the version of dnx, which should be used during building of the solution/project.

以上所有步骤与当前发布的许多现有软件包的版本无关.您可以转到页面 https://www.nuget.org/packages/并搜索软件包名称.如果使用 https://www.nuget.org/api/v2/<,则会找到相同的软件包/a>或 https://api.nuget.org/v3/index.json 在NuGet配置中.您可以检查 http://myget.org/gallery/aspnetmaster 来查看ASP.NET的当前版本. 5个主"版本(稳定版本)的程序集,您可以检查 http://myget.org/gallery/aspnetvnext 查看最新消息(来自GitHub dev不稳定).您可以在 https://www.myget.org/gallery/下找到许多其他供稿,但我认为只有 https://api.nuget.org/v3/index.json https://www.myget.org/F/aspnetmaster/api如果要使用ASP.NET 5的最新稳定版本,则应使用/v3/index.json .

All above steps have no relation to versions of a lot of existing packages currently released. You can go to the page https://www.nuget.org/packages/ and to search for the names of packages. The same packages will be found if you use https://www.nuget.org/api/v2/ or https://api.nuget.org/v3/index.json in NuGet configuration. You can examine http://myget.org/gallery/aspnetmaster to see the current version of ASP.NET 5 assemblies of the "master" builds (stable build) and you can examine http://myget.org/gallery/aspnetvnext to see the latest (unstable from GitHub dev). One can find a lot of other feeds under https://www.myget.org/gallery/, but in my opinion only https://api.nuget.org/v3/index.json and https://www.myget.org/F/aspnetmaster/api/v3/index.json should be used if you want use the latest stable release of ASP.NET 5.

您将看到 http://myget.org/gallery/aspnetmaster 的最新稳定版本具有名称"1.0.0-rc1-final",但是仍然有很多程序集,它们的另一个版本为*-rc1-final.以同样的方式, http://myget.org/gallery/aspnetvnext 中的不稳定版本今天已经出现名称"v1.0.0-rc2-16357",但是有很多程序集,它们的另一个版本为*-rc2-16357.

You will see that the latest stable release from http://myget.org/gallery/aspnetmaster have the name "1.0.0-rc1-final", but there are still a lot of assemblies, which have another version as *-rc1-final. In the same way unstable build from http://myget.org/gallery/aspnetvnext have today the name "v1.0.0-rc2-16357", but there are a lot of assemblies, which have another version as *-rc2-16357.

换句话说,您不应该只更改所有依赖项的名称以使用版本"*-rc1-update1".您可以在上下文菜单中打开管理NuGet软件包...",选中包括预发行版",然后选择更新"选项卡以查看是否发布了包含在package.json的依赖项"中的新软件包.仅在找到一些新软件包后,您才能对其进行更新,但是所有软件包使用-rc1-update1都会产生错误.

In other words you should not just change the names of all dependencies to use version "*-rc1-update1". You can open "Manage NuGet Packages..." in context menu, check "Include prerelease" and choose "Updates" tab to see whether a new package, which you included in "dependencies" of package.json, is released. Only if you find some new package then you can update it, but the usage of-rc1-update1 for all packages will produce an error.

这篇关于依赖关系&gt; = 1.0.0-rc1-update1无法解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆