Questions tagged [.net-core]

.NET Core is an open-source successor of the .NET Framework. It can be used in a wide variety of applications and verticals, ranging from servers and data centers to apps and devices. .NET Core is supported by Microsoft on Windows, Linux and macOS.

.NET Core is a modular, open-source, and cross-platform software framework and is the successor to the .NET Framework. It consists of the following four subsystems:

  • CoreFX – .NET Core foundational libraries; everything in the System.* namespace (also runs on the .NET Framework).
  • CoreCLR – Cross-platform .NET Core common language runtime.
  • CoreRT – an experimental .NET Core runtime optimized for AOT scenarios (it isn't officially supported, there are no plans to productize it in current form).
  • CLI – Command line interface for building .NET Core (netcoreapp) based projects on any framework (.NET Core or .NET Framework, including ASP.NET Core applications).

On 11/10/2020 the next version of .NET Core was released which dropped the 'Core' part of the name and is simply called .NET 5 in order to emphasize that this is the main implementation of .NET moving forward.

Versions

![enter image description here

External resources

33552 questions
1316
votes
8 answers

AddTransient, AddScoped and AddSingleton Services Differences

I want to implement dependency injection (DI) in ASP.NET Core. So after adding this code to ConfigureServices method, both ways work. What is the difference between the services.AddTransient and service.AddScoped methods in ASP.NET Core? public void…
Elvin Mammadov
  • 17,572
  • 9
  • 34
  • 76
917
votes
12 answers

What is the difference between .NET Core and .NET Standard Class Library project types?

In Visual Studio, there are at least three different types of class libraries you can create: Class Library (.NET Framework) Class Library (.NET Standard) Class Library (.NET Core) While the first is what we've been using for years, a major point…
Gigi
  • 24,295
  • 20
  • 85
  • 170
446
votes
5 answers

Build .NET Core console application to output an EXE

For a console application project targeting .NET Core 1.0, I cannot figure out how to get an .exe to output during build. The project runs fine in debug. I've tried publishing the project, but that does not work either. It makes sense since an EXE…
kenchilada
  • 7,030
  • 5
  • 22
  • 34
399
votes
8 answers

What's the difference between .NET Core, .NET Framework, and Xamarin?

Microsoft now has .NET Core, .NET Framework and Xamarin (Mono) in its family. It seems to be a lot of overlap here. What's the difference between these types of .NET Platforms? When should I choose to use .NET Core in my project, instead of .NET…
MeeChao
  • 4,027
  • 3
  • 8
  • 6
366
votes
32 answers

Assets file project.assets.json not found. Run a NuGet package restore

I'm trying to use nopCommerce(Which is written in .NET Core) but when I want to run the project I face 52 Errors telling me Run a nuget package restore Assets file ~\obj\project.assets.json' not found. Run a NuGet package restore to generate this…
NeverTrust
  • 3,905
  • 2
  • 9
  • 14
344
votes
18 answers

How to determine if .NET Core is installed

I know that for older versions of .NET, you can determine if a given version is installed by following https://support.microsoft.com/en-us/kb/318785 Is there an official method of determining if .NET Core is installed? (And I don't mean the SDK,…
weloytty
  • 4,940
  • 5
  • 26
  • 35
332
votes
12 answers

What is ".NET Core"?

Recently in an official .NET Framework Blog it was announced that .NET Core is going open source. Ironically, the author mentions that what .NET Core is will be explained in the next post. Some more details are mentioned in another announcement…
Petr Abdulin
  • 30,380
  • 8
  • 56
  • 90
304
votes
23 answers

How to read AppSettings values from a .json file in ASP.NET Core

I have set up my AppSettings data in file appsettings/Config .json like this: { "AppSettings": { "token": "1234" } } I have searched online on how to read AppSettings values from .json file, but I could not get anything useful. I…
Oluwafemi
  • 11,553
  • 10
  • 38
  • 58
286
votes
9 answers

.NET Core vs Mono

What is the difference between .NET Core and Mono? I found a statement on the official site that said: "Code written for it is also portable across application stacks, such as Mono." My goal is to use C#, LINQ, EF7 and Visual Studio to create a…
Captainlonate
  • 4,172
  • 2
  • 19
  • 33
277
votes
7 answers

Equivalent to AssemblyInfo in dotnet core/csproj

Since dotnet core moved back to the .csproj format, there is a new autogenerated MyProject.AssemblyInfo.cs which contains, among others: [assembly: AssemblyCompany("MyProject")] [assembly: AssemblyVersion("1.0.0.0")] Note that this is automatically…
hultqvist
  • 14,837
  • 14
  • 59
  • 90
271
votes
11 answers

dotnet ef not found in .NET Core 3

I'm following the docs in order to create an initial migration. When I execute dotnet, I get the help section, meaning that the PATH works properly. Then I try to execute the command below from the docs in console window: dotnet ef migrations add…
Konrad Viltersten
  • 28,018
  • 52
  • 196
  • 347
262
votes
7 answers

.NET Standard vs .NET Core

I have read about the difference between .NET Standard and .NET Core, but I really don't know what the difference is, or when to choose a .NET Standard library project and when to choose a .NET Core library project. I have read that .NET Standard is…
Álvaro García
  • 15,452
  • 25
  • 82
  • 152
254
votes
18 answers

How to unapply a migration in ASP.NET Core with EF Core

When I run PM> Remove-Migration -context BloggingContext in VS2015 with an ASP.NET Core project using EF Core I get the following error: System.InvalidOperationException: The migration '20160703192724_MyFirstMigration' has already been applied to…
nam
  • 15,516
  • 23
  • 104
  • 228
237
votes
7 answers

How to run .NET Core console app from the command line

I have a .NET Core console app and have run dotnet publish. However, I can't figure out how to run the application from the command line. Any hints?
devlife
  • 13,287
  • 23
  • 70
  • 126
233
votes
3 answers

How to get HttpContext.Current in ASP.NET Core?

We are currently rewriting/converting our ASP.NET WebForms application using ASP.NET Core. Trying to avoid re-engineering as much as possible. There is a section where we use HttpContext in a class library to check the current state. How can I…
HaBo
  • 12,509
  • 34
  • 102
  • 191
1
2 3
99 100