I'm starting the process of reworking a framework set of libraries to use .NET Core. Thought I'd wait for RC2 and keen to get stuck in.
I'm taking the opportunity to get up close and personal with the build system, configs, code everything from scratch to get a deeper understanding and have no unnecessary baggage that I don't want/need. However, the lack of documentation makes this quite difficult.. so I wanted to ask here, where no doubt clever .NET Core folks are hiding ;)
I know this question is long and has lots of sub-questions. But it could be answered I feel by a single link to documentation, or a few succint lines from someone in the know. Thanks for bearing with me, and I hope that this might become a useful answer resource for others in the same boat, trying to understand a good approach for .NET Core.
First, global.json
. I want multiple projects and components in the same 'solution'. Through another SO question I found this hidden link: http://dotnet.github.io/docs/project-model/global-json-reference.html - but there seems to be no VS tooling for setting up or using this from scratch.
1) global.json questions
A) What build system do these docs refer to? dotnet build
? (The help for that says it just builds a project - if it does 'solutions' - if that's still the name - does it just run dotnet build
over all child folders?).
B) Many examples around have an "sdk"
property - but EF Core doesn't have it, and the new "single-sentence-style" docs don't refer to it. The official RC2 migration guide for ASP.NET Core has it Is it still around or not? If so, why is it needed? What uses it? What are the options for it?
Next up, to project.json
and frameworks. I want to understand the options here for frameworks. Is there a list? Official guidance? dotnet new
uses netcoreapp1.0
; "official docs" use an example of dnxcore50
and this GH discussion from last month also raises the question of netcore1.0
as a possibility for frameworks (vs apps).
Furthermore, imports
. Am quite baffled on the naming - the docs talk about this being a list of other frameworks that the project is compatible with..
2) project.json framework questions -
A) Where can I find an up-to-date or maintained list or set of advice around the framework options?
B) If my understanding of the purpose of import
is correct, why is it named so? If not, what exactly does it import?
C) Why is there an import
property for every framework
property? If it's to indicate the whole project is compatible with another framework, that would seem to be best placed at the top level of project.json
, no?
D) How should I decide which import
options should I use? dotnet new
has just dnxcore50
- which packages is that to satisfy? This guy suggests dotnet5.6
, dnxcore50
and portable-net45+win8
!
Finally, I'm building class libraries, test projects, console utils. So..
3) references and packages
A) Do I always want Microsoft.NETCore.App
as per dotnet new
? Are there other baseline options? Guidance on choosing? A list?
B) The docs don't mention anything about the type
option (build
, platform
). Is there any guidance available on these?
C) Some of my projects will use ASP.NET. Where's the best place to find the correct packages to reference? There seem to be a million versions and packages on NuGet. This tutorial just talks about referencing Microsoft.AspNetCore.Server.Kestrel
- and the only ASP.NETty thing that refs is Microsoft.AspNetCore.Hosting
. Does that mean that one package is most of ASP.NET?