question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong main dependency in autogen project.json?

See original GitHub issue

Hi! I created a new project called “SolrExpress.Benchmarks” to test 3 projects. When I use Runtime.Core, error dotnet restore has failed occurred. I think it is because my new project is not in Nuget platform yet.

This is project.json generated by Benchmark.

{
  "title": "BenchmarkDotNet.Autogenerated",
  "version": "1.0.0-*",

  "buildOptions": {
    "optimize": true,
    "allowUnsafe": true,
    "emitEntryPoint": true,
    "platform": "x64",
    "debugSymbols": "pdbOnly",
    "comment": "both platform key and debugSymbols seems to be not documented, found at https://github.com/aspnet/dnx/blob/e874201acc19854caff9236b420b2864152659c0/test/Microsoft.Dnx.Compilation.CSharp.Tests/ProjectExtensionsFacts.cs",
    "compile": "SolrQueryableBenchmarks_With10Parameters_Core.notcs"
  },

  "commands": {
    "run": "BenchmarkDotNet.Autogenerated"
  },

  "dependencies": { "Microsoft.NETCore.App": { "version": "1.0.0" } },
  "runtimes": { "win8-x64": { } },


  "frameworks": {
    "netcoreapp1.0": {
      "imports": [ "dnxcore50", "portable-net45+win8", "dotnet5.6", "netcore50" ],
      "dependencies": {
        "SolrExpress.Benchmarks": {
          "version": "1.0.0-*",
          "importantComment": "you must not set the target, otherwise restore will fail!!!",
          "dependenciesComment": "restore adds all of them in recursive way, so we only need this single one"
        }
      }
    }
  }
}

And this is my original project.json

{
  "buildOptions": {
    "allowUnsafe": true,
    "emitEntryPoint": true,
    "keyFile": "../../Key.snk",
    "strongName": true,
    "warningsAsErrors": true
  },
  "configurations": {
    "Debug": {
      "buildOptions": {
        "define": [ "DEBUG", "TRACE" ]
      }
    },
    "Release": {
      "buildOptions": {
        "define": [ "RELEASE", "TRACE" ],
        "optimize": true
      }
    }
  },
  "dependencies": {
    "BenchmarkDotNet": "0.9.8-develop",
    "Moq": "4.6.36-alpha",
    "SolrExpress.Core": {
      "target": "project"
    },
    "SolrExpress.Solr4": {
      "target": "project"
    },
    "SolrExpress.Solr5": {
      "target": "project"
    }
  },
  "frameworks": {
    "net45": {
      "buildOptions": {
        "define": [ "CLASSIC" ]
      },
      "frameworkAssemblies": {
        "System.Reflection": "4.0.0.0"
      }
    },
    "netcoreapp1.0": {
      "buildOptions": {
        "define": [ "CORE" ]
      },
      "dependencies": {
        "Microsoft.NETCore.App": {
          "version": "1.0.0",
          "type": "platform"
        },
        "System.ComponentModel.EventBasedAsync": "4.0.11",
        "System.Diagnostics.TraceSource": "4.0.0",
        "System.IO": "4.1.0",
        "System.Reflection": "4.1.0",
        "System.Reflection.Extensions": "4.0.1",
        "System.Text.Encoding": "4.0.11"
      }
    }
  },
  "title": "SolrExpress.Benchmarks",
  "version": "3.1.2"
}

My question is. Do I really need put this project in nuget platform or I have some other option in my project.json??

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
diegobrumcommented, Aug 11, 2016

It’s alive!!

@adamsitnik Thanks a lot!

1reaction
adamsitnikcommented, Aug 11, 2016

@diegobrum Problem fixed I posted a PR to your repo

The reason was that “benchmarks” folder was not added to global.json file, so dotnet restore was not looking there and hence was failing to restore the project with benchmarks

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - Why is NPM removing the main: attribute from ...
I don't upload the modules, the server pulls the dependency modules from the repositories when I do a commit. The server uses NPM...
Read more >
Missing dependencies in generated package.json when ...
I have generated an Express application in my Nx workspace (which contained a Next application) using the following command nx g @nrwl/node: ...
Read more >
Autogeneration of package.json is not compatible with the ...
I would imagine that people who install dependencies directly to thein package.json via npm/pnpm will not delete the file. And those who are ......
Read more >
Help me to solve this error - Studio Web
go to your project folder and delete a file called project.json, then open your main sequence,uipath will create this file agains restoring ...
Read more >
package.json
Dependencies are specified in a simple object that maps a package name to a version range. The version range is a string which...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found