4

I am new to this area. I already upgraded my VS2015 with update 3. So now I have: .Net Core 1.0.0 with preview tool 2 installed.

Then I use VS2015 to create a new .Net Source project (class library). I have copied some existing .net 4.6.1 code to the new place and compiled error as expected. Then I use "porting analyzer tool"(https://learn.microsoft.com/en-us/dotnet/articles/core/porting/index) to compare and it did give some suggestion how to use the new way in .Net Core.

But there are still few class missing and cannot compile, like 'TypeDescriptor' or 'NullableConverter' etc. Then I googled and someone from Github say they already added these feature but I still not sure why I still get compilation error.

I also noticed that my class libary project has a project.json file as:

"frameworks": {
    "netstandard1.6": {
        "imports": "dnxcore50"
    }
}

I foundn if I remove the 'netstandard1.6' one but change to:

"frameworks": {
    "net461": {}
}

All the compilation error gone, but I could guess it's NOT .Net core project anymore, and more likely as a standard .Net 4.6.1 project.

So basically I'd like to ask:

  1. Why developer from Github saying that is fixed already but I still couldn't find/compile those classes in my project (e.g. TypeDescriptor : https://github.com/dotnet/corefx/issues/8262)?

  2. Some sample also puts both 'net461' & 'netstard1.6' or 'netcoreapp1.0' under 'frameworks' in project.json file. What's the purpose for that?

  3. If I just use 'net461' for the only framework, there seems no difference to traditional .Net Framework 4.6.1 project. Am I correct?

Thanks a lot!

1 Answer 1

7
  1. Install package System.ComponentModel.TypeConverter and you are good to go with .NET Core project.
  2. For building different output (binaries) each of which targeting different platform. net461 for applications which should run on (full) .NET Framework (under Windows or Mono). netcoreapp1.0 used for app which should be run under .NET Core. netstandard1.6 (avoid using netstandard1.5 and netstandard1.6 by the way - use previous versions) used for portable class libraries, which are supposed to run under different platforms: (full) .NET Framework, .NET Core, Xamarin, Universal Windows App, etc. You may read more about here and here.
  3. Absolutely.
Sign up to request clarification or add additional context in comments.

2 Comments

Hi Deilan, thanks a lot for your post! (1) works after I install the package. Another quick question: I also created another [ASP.NET Core Web Application] and I select '.Net Framework' rather than '.Net Core' in the bracket. And its project json file then shows 'net461' for framework. So could this website/webapi run on Windows Docker/Container then?
@Samuel, Seems to be. I'm not sure about it, so I am proposing starting to learn more about it here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.