1

When I install Stormpath for .NET Core through the package console I have these errors:

Unable to resolve 'Stormpath.Owin.Views.Precompiled (>= 0.4.4)' for '.NETFramework,Version=v4.5.2'.

Unable to resolve 'Stormpath.Owin.Abstractions (>= 1.7.2)' for '.NETFramework,Version=v4.5.2'.

Unable to resolve 'Stormpath.SDK.RestSharpClient (>= 0.94.0)' for '.NETFramework,Version=v4.5.2'.

Unable to resolve 'Stormpath.SDK.JsonNetSerializer (>= 0.91.0)' for '.NETFramework,Version=v4.5.2'.

Unable to resolve 'Polyglot (>= 1.2.0)' for '.NETFramework,Version=v4.5.2'.

Unable to resolve 'Stormpath.Configuration (>= 6.0.0)' for '.NETFramework,Version=v4.5.2'.

Unable to resolve 'Stormpath.SDK.Abstractions (>= 0.96.1)' for '.NETFramework,Version=v4.5.2'.

What can be the reason of these errors?

My project.json:

"frameworks":{
   "net452":{
      "dependencies":{
         "PhotoBooking.Contracts":{
            "target":"project"
         },
         "PhotoBooking.Data":{
            "target":"project"
         },
         "PhotoBooking.Domain":{
            "target":"project"
         }
      }
   }
}
Nate Barbettini
  • 51,256
  • 26
  • 134
  • 147
  • I copied your project.json contents from the comment you posted. If possible, can you edit your question and add the rest of your project.json file, not just the frameworks section? – Nate Barbettini Feb 09 '17 at 17:27

2 Answers2

0

You need to add .Net Framework in project.json

"frameworks": {
    "net452": {}
}

After that use dotnet restore

J. Doe
  • 2,651
  • 1
  • 13
  • 31
0

The problem is probably in your package.json file. From the snippet you posted, it looks like your dependencies section is not in the right place.

From your question, I can't tell if you are building an ASP.NET Core application on top of .NET Core (netcoreapp1.1), or .NET Framework (net452). The Stormpath package will work in either scenario, though.

Here's a working project.json file for .NET Framework 4.5.2:

{
  "buildOptions": {
    "emitEntryPoint": true
  },

  "dependencies": {
    "Stormpath.AspNetCore": "0.9.0",
    "PhotoBooking.Contracts": {
      "target":"project"
    },
    // your other dependencies here
  },

  "frameworks": {
    "net452": {}
  }
}

And for a .NET Core project:

{
  "buildOptions": {
    "emitEntryPoint": true
  },

  "dependencies": {
    "Stormpath.AspNetCore": "0.9.0",
    "PhotoBooking.Contracts": {
      "target":"project"
    },
    // your other dependencies here
  },

  "frameworks": {
    "netcoreapp1.1": {
      "imports": "dotnet"
    }
  }
}

Disclaimer: I'm the package author.

Nate Barbettini
  • 51,256
  • 26
  • 134
  • 147