2016-04-25 5 views
1

Windows 7でdnx coreとVisual Studio Codeを使用してAsp.NET Core 1.0のWebアプリケーションを構築しようとすると、問題が発生しました。空のアプリケーションを生成してdnu restore。これは、次のような出力が得られます。dnxcore50を使用してKestrelでdnu restoreを実行するとき

Microsoft .NET Development Utility CoreClr-x64-1.0.0-rc1-16609 

    CACHE https://api.nuget.org/v3/index.json 
Restoring packages for d:\development\asp.net core\yeoman_test\EmptyApplication\ 
project.json 
Writing lock file d:\development\asp.net core\yeoman_test\EmptyApplication\proje 
ct.lock.json 
---------- 
System.ArgumentOutOfRangeException: Specified argument was out of the range of v 
alid values. 
Parameter name: supportedFrameworks 
    at NuGet.NetPortableProfile..ctor(String frameworkDirectory, String name, IEn 
umerable`1 supportedFrameworks) 
    at NuGet.NetPortableProfileTable.LoadPortableProfile(String versionDirectory, 
String profileDirectory) 
    at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext() 
    at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext() 
    at NuGet.NetPortableProfileTable.BuildPortableProfileCollection() 
    at NuGet.NetPortableProfileTable.GetProfileData() 
    at System.Lazy`1.CreateValue() 
    at System.Lazy`1.LazyInitValue() 
    at NuGet.NetPortableProfileTable.GetProfile(String profileName) 
    at NuGet.NetPortableProfile.Parse(String profileValue) 
    at NuGet.VersionUtility.IsPortableLibraryCompatible(FrameworkName frameworkNa 
me, FrameworkName targetFrameworkName) 
    at NuGet.VersionUtility.IsCompatible(FrameworkName frameworkName, FrameworkNa 
me targetFrameworkName) 
    at NuGet.ContentModel.ContentItemCollection.FindBestItemGroup(SelectionCriter 
ia criteria, ContentPatternDefinition[] definitions) 
    at Microsoft.Dnx.Tooling.Utils.LockFileUtils.CreateLockFileTargetLibrary(Lock 
FilePackageLibrary library, IPackage package, RestoreContext context, String cor 
rectedPackageName) 
    at Microsoft.Dnx.Tooling.RestoreCommand.WriteLockFile(LockFile previousLockFi 
le, String projectLockFilePath, Project project, List`1 graphItems, PackageRepos 
itory repository, IProjectResolver projectResolver, IEnumerable`1 contexts) 
    at Microsoft.Dnx.Tooling.RestoreCommand.<RestoreForProject>d__69.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNot 
ification(Task task) 
    at Microsoft.Dnx.Tooling.RestoreCommand.<>c__DisplayClass68_0.<<Execute>b__2> 
d.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNot 
ification(Task task) 
    at Microsoft.Dnx.Tooling.RestoreCommand.<Execute>d__68.MoveNext() 
---------- 
Restore failed 
Specified argument was out of the range of valid values. 
Parameter name: supportedFrameworks 

NuGet Config files used: 
    C:\Users\<user>\AppData\Roaming\NuGet\nuget.config 

Feeds used: 
    https://api.nuget.org/v3-flatcontainer/ 

現在のランタイムにマイdnvm出力:

* 1.0.0-rc1-update2 coreclr x64   win    default 

そしてproject.json:私は、最小限の形で問題を再現することができます

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

    "dependencies": { 
    "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final", 
    "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final" 
    }, 

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

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

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

次のproject.jsonだけを使用します(ディレクトリ内に他のファイルはありません)。

{ 
    "dependencies": { 
     "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final" 
    }, 

    "frameworks": { 
     "dnxcore50": {} 
    } 
} 
私はケストレルのnugetパッケージと(DNXCore5.0用)その依存関係に掘ってきた

は以下のとおりです。

<group targetFramework="DNXCore5.0"> 
    <dependency id="Microsoft.AspNet.Hosting" version="1.0.0-rc1-final" /> 
    <dependency id="Microsoft.Extensions.Logging.Abstractions" version="1.0.0-rc1-final" /> 
    <dependency id="System.Numerics.Vectors" version="4.1.1-beta-23516" /> 
    <dependency id="System.Collections" version="4.0.11-beta-23516" /> 
    <dependency id="System.Diagnostics.Debug" version="4.0.11-beta-23516" /> 
    <dependency id="System.Diagnostics.TraceSource" version="4.0.0-beta-23516" /> 
    <dependency id="System.Diagnostics.Tracing" version="4.0.21-beta-23516" /> 
    <dependency id="System.Globalization" version="4.0.11-beta-23516" /> 
    <dependency id="System.IO" version="4.0.11-beta-23516" /> 
    <dependency id="System.Linq" version="4.0.1-beta-23516" /> 
    <dependency id="System.Net.Primitives" version="4.0.11-beta-23516" /> 
    <dependency id="System.Runtime.Extensions" version="4.0.11-beta-23516" /> 
    <dependency id="System.Runtime.InteropServices" version="4.0.21-beta-23516" /> 
    <dependency id="System.Text.Encoding" version="4.0.11-beta-23516" /> 
    <dependency id="System.Threading" version="4.0.11-beta-23516" /> 
    <dependency id="System.Threading.Tasks" version="4.0.11-beta-23516" /> 
    <dependency id="System.Threading.Thread" version="4.0.0-beta-23516" /> 
    <dependency id="System.Threading.ThreadPool" version="4.0.10-beta-23516" /> 
    <dependency id="System.Threading.Timer" version="4.0.1-beta-23516" /> 
    </group> 

私は、これらを通じて働いたと私project.jsonの依存関係を変更するだけでMicrosoft.AspNet.HostingまたはSystem.Numerics.Vectors原因のいずれかを含有することがわかりましたsupportedFrameworksで同じエラーが発生しました。他にもあるかもしれませんが、Microsoft.Extensions.Logging.AbstractionsSystem.CollectionsSystem.Diagnostics.Debugの後に私はここで尋ねることにしました。

私はもちろん、何かばかげていると思いますが、正確に何がうまくいかないようです。

+1

これは助けになるかもしれません:http://stackoverflow.com/questions/31467317/nuget-fails-to-install-fluentvalidation –

+1

これは私の指摘した事実です。私の参照アセンブリ\ Microsoft \ Framework \ .NETPortable'フォルダは空のシェルで、空のsupportedFrameworkフォルダを持つ空のプロファイルのみを含みます。おそらくVS2015をアンインストールしてから残っていますか?そのフォルダを削除すると問題が解決されました。回答を書く場合は、受け入れ済みとマークします。 –

答えて

2

Reference Assemblies\Microsoft\Framework\.NETPortableフォルダーを削除(または名前を変更)します。

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable 

また、NuGet Fails to Install FluentValidationも参照してください。

関連する問題