Sto convertendo un progetto da .NET Core RC1 in RC2. Ho installato il pacchetto di anteprima degli strumenti di Visual Studio e aggiornato il plug-in VS Nuget alla versione più recente."piattaforma parola chiave sconosciuta" durante il ripristino in Visual Studio
Questo è un progetto di test, quindi devo aggiungere Microsoft.NETCore.App
al mio project.json
per il library guide. Ecco come si presenta:
{
"dependencies": {
"dotnet-test-xunit": "1.0.0-rc2-build10015",
"FluentAssertions": "4.2.1",
"Microsoft.Extensions.PlatformAbstractions": "1.0.0-rc2-final",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-3002702"
},
"xunit": "2.1.0"
},
"frameworks": {
"netcoreapp1.0": {
"imports": [ "dotnet", "portable-net45+win8" ]
}
},
"testRunner": "xunit",
}
Il progetto ripristina e si basa sulla riga di comando (dotnet restore/build
). Tuttavia, quando Visual Studio tenta di ripristinare i pacchetti, ottengo questo errore:
PATH=.\node_modules\.bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External;%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\git
C:\Users\Nate\.dnx\runtimes\dnx-clr-win-x86.1.0.0-rc2-20221\bin\dnx.exe "C:\Users\Nate\.dnx\runtimes\dnx-clr-win-x86.1.0.0-rc2-20221\bin\lib\Microsoft.Dnx.Tooling\Microsoft.Dnx.Tooling.dll" restore "C:\Users\Nate\Documents\stormpath-dotnet-config\test\Stormpath.Configuration.Test"
Microsoft .NET Development Utility Clr-x86-1.0.0-rc2-20221
CACHE https://api.nuget.org/v3/index.json
Restoring packages for C:\Users\Nate\Documents\stormpath-dotnet-config\test\Stormpath.Configuration.Test\project.json
----------
C:\Users\Nate\Documents\stormpath-dotnet-config\test\Stormpath.Configuration.Test\project.json(0,0): Error: Microsoft.Dnx.Runtime.FileFormatException: unknown keyword platform ---> System.InvalidOperationException: unknown keyword platform
at Microsoft.Dnx.Runtime.LibraryDependencyType.Parse(String keyword)
at Microsoft.Dnx.Runtime.ProjectReader.PopulateDependencies(String projectPath, IList`1 results, JsonObject settings, String propertyName, Boolean isGacOrFrameworkReference)
at Microsoft.Dnx.Runtime.ProjectReader.ReadProject(Stream stream, String projectName, String projectPath, ICollection`1 diagnostics)
at Microsoft.Dnx.Runtime.Project.TryGetProject(String path, Project& project, ICollection`1 diagnostics)
--- End of inner exception stack trace ---
at Microsoft.Dnx.Runtime.Project.TryGetProject(String path, Project& project, ICollection`1 diagnostics)
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.HandleNonSuccessAndDebuggerNotification(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.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.Dnx.Tooling.RestoreCommand.<Execute>d__68.MoveNext()
----------
Restore failed
unknown keyword platform
NuGet Config files used:
C:\ProgramData\NuGet\Config\Microsoft.VisualStudio.Offline.config
C:\Users\Nate\AppData\Roaming\NuGet\nuget.config
Feeds used:
https://api.nuget.org/v3-flatcontainer/
C:\Users\Nate\Documents\LocalNuget
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
Ovviamente la proprietà "type": "platform"
sta gettando via, ma non dovrebbe questo lavoro con l'ultima release utensili?
Damien Edwards utilizzato "versione": "1.0.0-rc2-002392 "... non è aggiornato https://github.com/aspnet/live.asp.net/commit/d67e1d09cdca8acdba7e2cefa5061a5fb279ba5d? Dove è documentato? – Aligned
Ho intenzione di eliminare solo il globale .json file e vedere come va. – Aligned
@ Allineato: non sono sicuro che funzioni o meno. Puoi ripristinare in VS con il valore usato da Damien? –