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

Switching to new ‘dotnet’ target framework monikers #98

Open
Eilon opened this Issue Oct 31, 2015 · 0 comments

Comments

Projects
None yet
1 participant
@Eilon
Member

Eilon commented Oct 31, 2015

What is it?

These are a new, simpler way of targeting versions of .NET. More information here https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/standard-platform.md

Action required

For RC1 applications and test projects should still target dnx4x and dnxcore50 and don't need to change at all. Anything that has a Program.Main or Startup.cs is considered an application.

Only _class libraries_ should change to target net4x and dotnet5.x. For class libraries the recommended conversion steps are:

In project.json:

  • Change dnx4x to net4x (e.g. dnx451 to net451)
  • Change dnxcore50 to dotnet5.4

And in your CS files:

  • Change #if DNX451 to #if NET451
  • Change #if DNXCORE50 to #if DOTNET5_4

Example

Here's what a project.json file used to look like:

{
  "version": "1.0.0-*",

  "frameworks": {
    "dnx451": { },
    "dnxcore50": {
      "dependencies": {
        "System.Collections": "4.0.11-beta-*"
      }
    }
  }
}

And here's what to change it to:

{
  "version": "1.0.0-*",

  "frameworks": {
    "net451": {},
    "dotnet5.4": {
      "dependencies": {
        "System.Collections": "4.0.11-beta-*"
      }
    }
  }
}

And in your CS files if you had:

#if DNX451
        // whatever 
#endif 
...
#if DNXCORE50
        // whatever 
#endif 

Change that to:

#if NET451
        // whatever 
#endif 
...
#if DOTNET5_4
        // whatever 
#endif 

@Eilon Eilon added the Announcement label Oct 31, 2015

@Eilon Eilon added this to the 1.0.0-rc1 milestone Oct 31, 2015

@aspnet aspnet locked and limited conversation to collaborators Oct 31, 2015

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.