2

New to .NET5, so not sure if this is something simple or not. I have 5 other projects in my solution, which all have this in the project.json file

"frameworks": {
    "net5": { }
}

I needed to reference net5 because i am using EntityFramework, and for some reason it wouldnt work if i had the default "dotnet".

Now my website project has a slightly different frameworks tag. I have included all of it encase i am missing something else, but as you can see it is referencing DNX5 and DNXCore5 (Not sure why)

{
    "webroot": "wwwroot",
    "version": "1.0.0-*",

    "dependencies": {
        "Microsoft.AspNet.Server.IIS": "1.0.0-beta5",
        "Microsoft.AspNet.Server.WebListener": "1.0.0-beta5",
        "Microsoft.AspNet.Mvc": "6.0.0-beta5"
    },

    "commands": {
        "web": "Microsoft.AspNet.Hosting --config hosting.ini"
    },

    "frameworks": {
        "dnx50": { },
        "dnxcore50": { }
    },

    "publishExclude": [
        "node_modules",
        "bower_components",
        "**.xproj",
        "**.user",
        "**.vspscc"
    ],
    "exclude": [
        "wwwroot",
        "node_modules",
        "bower_components"
    ]
}

But i have an error when i am trying to reference use

StringComparer.InvariantCultureIgnoreCase

See the screenshot below

enter image description here

If i look under References in the project, it appears that the DMXCore is referenced correctly and appears, as you can see here

enter image description here

VMAtm
  • 27,943
  • 17
  • 79
  • 125
Gillardo
  • 9,518
  • 18
  • 73
  • 141
  • 2
    Right, so it's saying that that enum member isn't available under DNX Core, so you can't use it. I'm not quite sure why you're confused at the moment. – Jon Skeet Oct 09 '15 at 09:23
  • I can reference this in another project if i change the framework to "net5"? Maybe I just need to know when i should reference "net5" and when i should reference dnx50". Sorry very new to it – Gillardo Oct 09 '15 at 09:30
  • Well if you don't need to support dnxcore (as opposed to dnx) just remove "dnxcore50" from your list of frameworks. – Jon Skeet Oct 09 '15 at 09:32

1 Answers1

1

See this question for full details.

  • dnxcore50 - DNX SDK running on CoreCLR/CoreFx
  • dnx451 - DNX SDK running on .Net 4.5.1 (Desktop CLR / Full BCL and FCL)
  • net46 - .Net Framework SDK running on .Net 4.6 (Desktop CLR / Full BCL and FCL).
  • uap10.0 - UWP SDK running on .Net Native/CoreFx
  • dotnet - any pure IL code which declares its dependencies (instead of a PCL contract). Framework dependencies are available for .Net 4.6, DNX or UWP.

For .NET 4.5 you need to use dnx45 for ASP.NET projects and net45 for other projects to target .NET 4.5 which is what I think you are doing according to your other question.

Community
  • 1
  • 1
Muhammad Rehan Saeed
  • 35,627
  • 39
  • 202
  • 311