Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert a C# Library to Net.Core

As .NET Core is getting nearer, I will start to convert our Library to NET-Core, so that it could be used from our old Code (Net 4.5) and Net Core! But for me it is not clear what Type should my Library be. I've no "Net-Core" Project Type in VS2015! Do I need to use old school "PCL" Library? Or how do I do it?

like image 309
Jochen Kühner Avatar asked Apr 17 '16 13:04

Jochen Kühner


People also ask

How do you convert Celsius to Fahrenheit easy?

To convert temperatures in degrees Celsius to Fahrenheit, multiply by 1.8 (or 9/5) and add 32.

What temp is C in Fahrenheit?

1 Celsius is equal to 33.8 Fahrenheit.

How do you calculate F to C?

The formula for converting Fahrenheit to Celsius is C = 5/9(F-32). Fahrenheit and Celsius are the same at -40°. At ordinary temperatures, Fahrenheit is a larger number than Celsius. For example, body temperature is 98.6 °F or 37 °C.

What are the type conversion in C?

This type of conversion is known as implicit type conversion. In C, there are two types of type conversion: Implicit Conversion. Explicit Conversion.


1 Answers

But for me it is not clear what Type should my Library be. I've no "Net-Core" Project Type in VS2015! Do I need to use old school "PCL" Library? Or how do I do it?

Use the Web > Class Library (Package) type.

  • File > New > Project
  • Web > Class Library (Package)

Class Library (Package)

The screenshot is from Visual Studio Community 2015 Update 2 with ASP.NET 5 RC1 installed. Its project.json targets two frameworks: .NET 4.5.1 and .NET 5.4 (renamed to .NET Core.)

{
  // other properties deleted for clarity

  "frameworks": {
    "net451": { },
    "dotnet5.4": {
      "dependencies": {
        "Microsoft.CSharp": "4.0.1-beta-23516",
        "System.Collections": "4.0.11-beta-23516",
        "System.Linq": "4.0.1-beta-23516",
        "System.Runtime": "4.0.21-beta-23516",
        "System.Threading": "4.0.11-beta-23516"
      }
    }
  }
}

Tip. When you're upgrading your class library, run the .NET Portability Analyser on the existing code. It will show the classes & members that must change.

like image 191
Shaun Luttin Avatar answered Sep 28 '22 07:09

Shaun Luttin