我正在尝试使用asp.net 5。我从visual studio 2015附带的模板创建了一个asp.net5 mvc应用程序。 但是dnu还原不适用于src文件夹。
Nuget.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<activePackageSource>
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
</activePackageSource>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
</packageSources>
<disabledPackageSources>
<add key="nuget.org" value="true" />
<add key="nuget.org" value="true" />
</disabledPackageSources>
</configuration>
这就是我做的事情
C:\Users\sam\Documents\Visual Studio 2015\Projects\WebApplication\src\WebApplication> dnvm list
Active Version Runtime Architecture Location Alias
------ ------- ------- ------------ -------- -----
1.0.0-beta5 clr x64 C:\Users\sam\.dnx\runtimes
1.0.0-beta5 clr x86 C:\Users\sam\.dnx\runtimes
1.0.0-beta5 coreclr x64 C:\Users\sam\.dnx\runtimes
1.0.0-beta5 coreclr x86 C:\Users\sam\.dnx\runtimes
1.0.0-beta6 clr x86 C:\Users\sam\.dnx\runtimes
1.0.0-beta6 coreclr x64 C:\Users\sam\.dnx\runtimes
* 1.0.0-beta7 clr x86 C:\Users\sam\.dnx\runtimes default
1.0.0-beta8-15530 clr x86 C:\Users\sam\.dnx\runtimes
1.0.0-beta8-15548 clr x86 C:\Users\sam\.dnx\runtimes
1.0.0-beta8-15548 coreclr x86 C:\Users\sam\.dnx\runtimes
C:\Users\sam\Documents\Visual Studio 2015\Projects\WebApplication\src\WebApplication> dnu restore
Microsoft .NET Development Utility CLR-x86-1.0.0-beta7-15532
Restoring packages for C:\Users\sam\Documents\Visual Studio 2015\Projects\WebApplication\src\WebApplication\project.json
Unable to locate EntityFramework.Commands >= 7.0.0-beta7
Unable to locate Microsoft.Framework.Configuration.UserSecrets >= 1.0.0-beta7
Unable to locate Microsoft.VisualStudio.Web.BrowserLink.Loader >= 14.0.0-beta7
Writing lock file C:\Users\sam\Documents\Visual Studio 2015\Projects\WebApplication\src\WebApplication\project.lock.json
Restore complete, 1698ms elapsed
Errors in C:\Users\sam\Documents\Visual Studio 2015\Projects\WebApplication\src\WebApplication\project.json
Unable to locate EntityFramework.Commands >= 7.0.0-beta7
Unable to locate Microsoft.Framework.Configuration.UserSecrets >= 1.0.0-beta7
Unable to locate Microsoft.VisualStudio.Web.BrowserLink.Loader >= 14.0.0-beta7
答案 0 :(得分:1)
尝试添加包源。这是我的,工作得很好(甚至在Azure上):
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="AspNetVNext" value="https://www.myget.org/F/aspnetvnext/api/v2" />
<add key="NuGet" value="https://nuget.org/api/v2/" />
<add key="Roslyn" value="https://www.myget.org/F/roslyn-nightly/" />
<add key="DotNet" value="https://www.myget.org/F/dotnet-corefx/" />
</packageSources>
</configuration>