Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dnu restore: unknown keyword platform #88

Closed
falconmick opened this issue May 3, 2016 · 4 comments
Closed

dnu restore: unknown keyword platform #88

falconmick opened this issue May 3, 2016 · 4 comments
Labels

Comments

@falconmick
Copy link

Hey guys.
Just spent the last 2 hours trying to get this damn thing to run... And yeah, no luck. I have tried heaps of things and got heaps of diferent errors, but I will start out with the initial error I get as the ones that were after might be due to my "fixes"

I have a fresh clone of my forked repo as suggested via Contributing.md I cd into: AspNet.Security.OAuth.Providers and type:

dnu restore

This is where the fun starts!

I get the following output:

Microsoft .NET Development Utility Clr-x86-1.0.0-rc2-20221

  CACHE https://api.nuget.org/v3/index.json
  CACHE https://www.myget.org/F/aspnetcidev/api/v3/index.json
  CACHE https://api.nuget.org/v3/index.json
Restoring packages for J:\programming\AspNet.Security.OAuth.Providers\samples\Mvc.Client\project.json
----------
J:\programming\AspNet.Security.OAuth.Providers\samples\Mvc.Client\project.json(0,0): Error: Microsoft.Dnx.Runtime.FileFormatException: unknown keyword platform ---> 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.BuildTargetFrameworkNode(Project project, String frameworkKey, JsonObject frameworkValue)
   at Microsoft.Dnx.Runtime.ProjectReader.BuildTargetFrameworksAndConfigurations(Project project, JsonObject projectJsonObject, ICollection`1 diagnostics)
   --- End of inner exception stack trace ---
   at Microsoft.Dnx.Runtime.ProjectReader.BuildTargetFrameworksAndConfigurations(Project project, JsonObject projectJsonObject, ICollection`1 diagnostics)
   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:\Users\go_ha\AppData\Roaming\NuGet\nuget.config
    J:\programming\AspNet.Security.OAuth.Providers\nuget.config

Feeds used:
    https://api.nuget.org/v3-flatcontainer/
    https://myget-2e16.kxcdn.com/artifacts/aspnetcidev/nuget/v3/flatcontainer/

Apparently the issue is that it is tripping up on this part of the project.json:
"Microsoft.NETCore.App": { "type": "platform", "version": "1.0.0-*" }
As this is the only reference to platform (which is the issue) in the project.json
If I then go ahead and use delete the issue approach (bad I know, but hey, just run under 4.5?)

I get allot further :D yay!
(following removed from project.json)

    "netcoreapp1.0": {
      "dependencies": {
        "Microsoft.NETCore.App": { "type": "platform", "version": "1.0.0-*" }
      },

      "imports": [
        "dnxcore50",
        "portable-net451+win8"
      ]
    }

Yay! It builds

I then proceed to open the solution in the root folder and set the sample project as the startup project. I hit run (IIS) and I get the following:

Managed Debugging Assistant 'BindingFailure' has detected a problem in 'C:\Users\go_ha\.dnx\runtimes\dnx-clr-win-x86.1.0.0-rc2-20221\bin\dnx.exe'.

Additional information: The assembly with display name 'Microsoft.AspNet.Server.Kestrel' failed to load in the 'Load' binding context of the AppDomain with ID 1. The cause of the failure was: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AspNet.Server.Kestrel' or one of its dependencies. The system cannot find the file specified.

The same happens for the web command.

Does anyone have a solution for any of these? Really want to get to implementing Steam login.

Cheers :(

@kevinchalet
Copy link
Member

Hey,

The ASP.NET Core RC2/aspnet-contrib projects no longer work with DNX: you need to install .NET CLI to install and run the latest bits: https://github.com/dotnet/cli

I'll update CONTRIBUTING.md to reflect that.

Note that we already have a Steam middleware, that uses the generic OpenID2 provider: https://github.com/aspnet-contrib/AspNet.Security.OpenId.Providers/tree/dev/src/AspNet.Security.OpenId.Steam.

You can find the latest release on NuGet.org (for RC1) and the nightly builds on our MyGet repository (for RC2): https://www.nuget.org/packages/AspNet.Security.OpenId.Steam/

@falconmick
Copy link
Author

thanks for that.... Haha who would have known keeping up with beta/rc projects would be so hard (not).

A bit off topic, but how do you keep up to date with these changes?

@bhatnagar-anuj
Copy link

bhatnagar-anuj commented May 19, 2016

@PinpointTownes I'm having RC1 version project in my Solution. I don't want to update that project to RC2 for the time being and adding new ASP.Net Core RC2 project in the same solution. I'm seeing the same error. How I can add two version ASP.net (RC1 and RC2) in the same solution ??????

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, IList1 results, JsonObject settings, String propertyName, Boolean isGacOrFrameworkReference) at Microsoft.Dnx.Runtime.ProjectReader.ReadProject(Stream stream, String projectName, String projectPath, ICollection1 diagnostics)
at Microsoft.Dnx.Runtime.Project.TryGetProject(String path, Project& project, ICollection`1 diagnostics)
--- End of inner exception stack trace ---

@kevinchalet
Copy link
Member

A bit off topic, but how do you keep up to date with these changes?

@falconmick sometimes, I really wonder 😄

How I can add two version ASP.net (RC1 and RC2) in the same solution ??????

Unfortunately, you can't. At all. Either stay with RC1-only or migrate to RC2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants