I couldn't find any answer online so I try it here: What is the difference between the DNX (.NET Execution Environment) and the .NET Core?
I know that the DNX is the SDK and also used to execute code and the .NET Core contains the CoreFX (Libraries) and the CoreCLR (the common language runtime).
But I still don't get what it is precisely about between DNX and the .NET Core.
My understanding is that .NET Core is the core Common Language Runtime and various .NET libraries used in .NET applications. This would be things like Microsoft.AspNet.Server.Kestrel, Microsoft.AspNet.Mvc, Microsoft.AspNet.Tooling.Razor, etc.).
DNX is the .NET executioner, which is responsible for running your .NET application. Basically, you would install one or more DNX (clr, coreclr, mono) versions. Then you would build your application and type something like dnx run or dnx web from the command-line to run your application.
There is also DNVM (the .NET version manager), which is the tool used to maintain (install, upgrade, uninstall, etc.) versions of DNX. You would do this by entering commands like dnvm upgrade, dnvm install <dnx_version>, dnvm uninstall <dnx_version>, dnvm use <dnx_version>, etc.
And then there is DNU (the .NET Utilities manager), which manages the dependencies your application relies on located in your project.json file every time you add/remove new dependencies in your project.json file, dnu restore would need to be run in order to update the dependencies your application relies before running dnx run or dnx web.
I've heard that dnx, dnvm, dnu will all be under dotnet soon as .NET 5 is now being called .NET Core 1.0
Related
When running a simple dotnet --version on a fresh computer with the Windows Hosting Bundle 3.1 installed, you may get this error message:
It was not possible to find any installed .NET Core SDKs Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from: https://aka.ms/dotnet-download
what is causing this issue ?
PS: I created this question because all other questions dealing with this error message are within the scope of docker or other specific programs and not .NET generally.
This may happen if you have installed the ASP.NET Core Runtime (<=> Windows Hosting Bundle) but not the .NET Core Runtime itself. The tricky part is that the former still install the dotnet command but not the libraries that make it work.
So, contrarily to what may be assumed according to this, the Windows Hosting Bundle does not install the .NET SDK (at least for v3.1) which has to be installed explicitly too in order to make the dotnet command work.
I'm in the process of moving to .NET Core. In the mean time, I have two sets of apps - some using .NET Core 3.1 and the rest the full .NET Framework 4.6.2.
Also, I'm trying to make a build script to build all apps with one command.
But dotnet publish does not work for full .NET Framework projects.
How can I use dotnet publish command to build full .NET Framework applications?
dontnet commands only works for .NET Core projects, so It is working as intended!
Our continuous integration is a standard setup in which we have a build server which produces a build and then deploys that build to the application servers. Inevitably, we upgrade the .NET Core SDK's on the build servers before we upgrade the .NET Core runtimes on our application servers.
Are versions of the .NET Core runtime forward compatible such that I can always run builds from the latest SDKs on older runtimes? For example, what happens I build with SDK 2.1.500 and run it on Runtime 2.1.3? This is what we're doing in production and nothing seems to have blown up yet but I'm wondering if this is something we should avoid.
I have two dotnet core projects. One of them uses dotnet 1.0 (Preview 2 build 3131 and 3133) and other uses dotnet 1.1.1. As far as I know, I cannot run a project.json & xproj based projects with dotnet 1.1.1 and I also cannot run csproj based projects with dotnet 1.0.
I can migrate the legacy dotnet core project to csproj. But I am looking for a solution that I can work on both projects in Windows or Linux.
I checked using docker when compiling projects in Visual Studio and could not find any sufficient resource.
Thanks.
First, you seem to be confusing the version of .Net Core, with the version of .Net Core SDK.
The version of .Net Core (e.g. 1.0.4 or 1.1.1) is not directly related the the difference between project.json and csproj. That is the version of the runtime itself. You can easily switch between different versions of .Net Core on the same machine, just by editing your project file.
The version of .Net Core SDK (e.g. Preview 2 build 3131 or 1.0.3) is what decides what project format you can use. SDK Preview 2 only supports project.json, SDK 1.0.x only supports csproj. You can have multiple versions of SDK installed on the same machine, and thus have support for both project formats at the same time. But if you want to do that, you need to specify the version of SDK for each project using global.json.
As for Visual Studio, VS 2015 only supports project.json and VS 2017 only supports csproj (but should be able to migrate project.json projects).
That being said, I don't see any reason why you should keep using project.json, .Net Core SDK 1.0.x, which supports csproj, works fine on both Linux and Windows.
The csproj based tooling works with both .NET Core 1.0 and 1.1. There also is a tooling preview2 (project.json/xproj) build that has .NET Core 1.1 support (1.0.0-preview2-1-003177).
The point is that the versioning of the tools is independent of the the version of the .net core runtime at the moment, though the upcoming 2.0 releases will be csproj only, with both runtime and tooling having a 2.0 version.
I'm compiling an application that targets the dnxcore50 only.
I'm attempting to reference a nuget package that I know works fine when run against dnx451. When I do dnx . run I get:
System.InvalidOperationException: Failed to resolve the following dependencies for target framework 'DNXCore,Version=v5.0':
it also suggests a dnu restore but the package is there
It does not work for this package clearly so under what circumstances will it (if any) ?
In order for it to work must the package manager build a version compiled against dnxcore50?
update
this chart makes things a bit clearer (copied from here)
No. dnxcore50 indicates you're running on DNX on top of .NET Core. The only assemblies you can load in .NET Core are those that target a compatible profile, in this case e.g. dnxcore50, dotnet, or one of the compatible portable profiles.
If you have an assembly compiled against the full .NET Framework (via net45, net451, etc.), it won't run when on .NET Core as the same APIs aren't available.