4

I have the following project.json:

{
"version": "1.0.0-*",

  "dependencies": {
    "NETStandard.Library": "1.5.0-rc2-24027",
    "Dapper": "1.50.0-rc2b",
    "Microsoft.Extensions.DependencyInjection": "1.0.0-rc2-final",
    "System.Dynamic.Runtime": "4.0.11-rc2-24027",
    "Microsoft.CSharp": "4.0.1-rc2-24027"
  },

  "frameworks": {
    "netstandard1.5": {
      "imports": "dnxcore50"
    },
    "net461": {}
  }
}

now, I am getting the following warnings, that I would rather not have

Dependency specified was System.Dynamic.Runtime >= 4.0.11-rc2-24027 but ended up with System.Dynamic.Runtime 4.0.10.0.

Dependency specified was Microsoft.CSharp >= 4.0.1-rc2-24027 but ended up with Microsoft.CSharp 4.0.0.0.

dropping the net461 from the frameworks solves my issue - but is not a prefered choice.

However, now I can guess why I am getting them, something to do with those libraries not supporting net461 - although it seems kinda odd to me.

I tried just using the older version - but then I get a warning that Dapper expected a newer version of those - any Ideas?

for some reason, moving dependencies to each framework specifically (same versions) solves this issue too

Community
  • 1
  • 1
gilmishal
  • 1,884
  • 1
  • 22
  • 37
  • I can't reproduce this, your project.json doesn't produce any warnings for me. And both of those packages support `net45`. – svick Jun 10 '16 at 17:57
  • Weird, I managed to reproduce it with a new core class library project – gilmishal Jun 10 '16 at 18:25
  • @gilmishal I can reproduce the warnings. But why do you need those dependencies anyway? Referencing Dapper will implicitly add them. Can you just remove them? – Nate Barbettini Jun 10 '16 at 19:55
  • removing those results in the following error "Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create'" – gilmishal Jun 11 '16 at 09:54
  • I suspect there's a build rule buried somewhere that wants to speak up because the resolved assembly has a lower version number. Really rather best to click the [New Issue button](https://github.com/dotnet/corefx/issues). – Hans Passant Jun 11 '16 at 15:58

1 Answers1

2

The framework-specific dependencies should be specified within the framework-specific element. Like so:

{
  "version": "1.0.0-*",

  "dependencies": {
    "Dapper": "1.50.0-rc2b",
    "Microsoft.Extensions.DependencyInjection": "1.0.0-rc2-final",
    "System.Dynamic.Runtime": "4.0.11-rc2-24027"
  },

  "frameworks": {
    "netstandard1.5": {
      "dependencies": {
        "NETStandard.Library": "1.5.0-rc2-24027"
      },
      "imports": "dnxcore50"
    },
    "net461": {
      "dependencies": {
        "Microsoft.CSharp": "4.0.1-rc2-24027"
      }
    }
  }
}
Ivan Prodanov
  • 34,634
  • 78
  • 176
  • 248