1

I am quite interested about the recent .net developments, but I couldn't really follow everything in details. I'd like to know if it's now possible to embed the .net framework dlls directly in the application instead to ask the user to download the framework separately.

P.S.: for "recent .net developments", I meant the fact that it's all going open source, therefore I wonder if I can use the new open sourced version. If I got it correctly, I could even use the framework code directly, so the application shouldn't need to request the framework DLLs, should it?

sebas
  • 1,045
  • 12
  • 27
  • I deleted the part of the question that is off topic. – usr May 09 '15 at 18:55
  • Why do you think it matters if .NET is open-sourced or not for your case? Even if you had the code, how would you use it without actually installing the .NET framework? – Mark Segal May 09 '15 at 19:12
  • if and if I got correctly, the open sourced version should include all the code related to the fundamental distributable dlls, like most of the System.* namespaces. Therefore I don't see why the application should need the framework dlls at that point (since they implement the same code) – sebas May 09 '15 at 19:19
  • 1
    I believe @sebas is talkin about new CoreFX + CoreCLR, which are going to be just nuget packages as I understand. The problem is that they target ASP.NET application. – Alex Sikilinda May 09 '15 at 19:38
  • I believed the ASP.NET limitation was now removed with the new version? Not sure tho. – sebas May 09 '15 at 19:45

3 Answers3

2

I'd like to know if it's now possible to embed the .net framework dlls directly in the application instead to ask the user to download the framework separately.

Yes there is. .Net native makes it possible. You can run a .net application without .net installed.

.Net native achieves this by pre-compiling the application into native code.

Unfortunately, it works only for Windows store apps as of now. We may expect the desktop application support in near future.

Refer this and this blog post posted last year for more details.

Sriram Sakthivel
  • 72,067
  • 7
  • 111
  • 189
  • @sebas [There was a tool](http://www.remotesoft.com/linker/intro.html) which supported this. Check it out. Also related [question here](http://stackoverflow.com/questions/45702/how-to-compile-a-net-application-to-native-code) may help. – Sriram Sakthivel May 09 '15 at 19:59
  • when I wrote the first version of the application, I investigated all the possible "old solutions" to then switch to Mono. My question is more related to the new CoreFX source code. – sebas May 09 '15 at 20:31
  • Sorry. I don't know about the .net core – Sriram Sakthivel May 09 '15 at 20:33
  • CoreFX is actually supposed to be the framework code, or at least part of it: https://github.com/dotnet/corefx/tree/master/src – sebas May 09 '15 at 20:33
1

Not really. There is no update in the .NET framework that allows it to be embedded directly in a single executable.

However, every modern PC running Windows has the .NET framework. Even Vista comes with .NET 3 installed. And the .NET is updated via Windows Update.

The only OS you need to worry about not having the .NET is XP, which is long unsupported and gone.

Mark Segal
  • 5,427
  • 4
  • 31
  • 69
  • sorry I didn't mean to embed the dll in the executable, but more if I can ship them next to the executable. Our software must target even the old XP :/ also I am not sure if 3.0 is actually enough. – sebas May 09 '15 at 19:06
  • You could go through an installation process that will verify the .NET is installed, and if not, will install it. Or you can simply ship the .NET installation file (a single executable distributed by Microsoft) and silently install it (using the `/q` argument) – Mark Segal May 09 '15 at 19:11
  • the application is 6mb big, it's a game launcher. Shipping it with the .net installer would mean adding more precious MB. but I guess it can still be feasible. – sebas May 09 '15 at 19:12
  • How come your game *launcher* is 6MB? Anyway, you can't shrink the .NET framework. – Mark Segal May 09 '15 at 19:13
  • sorry for "launcher" I meant more a patcher. It must verify the game integrity and look for new updates. 6MB (the installer, therefore compressed) is the mimimum I could reach in a reasonable time using mono. I now want to write a new and more powerful version using the Microsoft .net, but I remember the first time I chose mono for the very same reason (not willing to ask the users to install the framework) – sebas May 09 '15 at 19:15
  • 1
    There is no way I am aware of to run .NET without the framework installed – Mark Segal May 09 '15 at 19:16
1

What kind of application are we talking about? Desktop? Web Applications?

CoreFX is just a modular version of the .NET Framework modular, but it won't "link" (similar to C++ development) any assemblies to the main executable.

CoreFX will allow multiple side-by-side applications, so when you update one application to new modules other CoreFX applications won't be affected by it.

But (at least for now) CoreFX is a targeted for cloud and server applications so far and do not have the full feature of the .NET 4.6 framework, nor does it have or support GUI framework (WPF, WinForms).

So if you're aiming for Web-applications, you can use it soon (it's not released yet. As of the time of writing, it will be released in 3 weeks on 20th July 2015). If you want Mobile or Desktop Applications you have to stick to the full .NET 4.6/4.5 Framework and then your app will require the appropriate .NET Framework to be installed on your PC before the application can be used.

i.e. you won't be able to use EntityFramework 6.x with CoreFx, as it depends on the full .NET framework implementation and EF 7.x do not support all Db providers yet and do not have all features of 6.x neither.

This won't change anytime soon. And if you use it, be aware of the limitations.

Check out this issue of corefx issue tracker addressing your exact question:

https://github.com/dotnet/corefx/issues/165

  1. Will you be able to create desktop programs in VS2015 that targets .NETCore 5 or .NETFramework 4.6 (they are separate correct?). Right now in VS2013 it seems you can only target .NETCore when creating windows store apps. I cannot seem to target .NETCore when creating desktop applications.

    .NET Core is currently focused on server-side scenarios, no GUI technologies like WinForms/WPF etc. .NET Framework 4.6 on the other hand contains everything, so you can create Desktop apps with it.

  2. Will .NETCore 5 need a runtime installation for .NETCore programs to work on the target computer (whether it would be windows, mac or linux), or will I be able to include the runtime as part of the program?

    .NET Core can be deployed alongside your application, so it doesn't need a runtime installed.

  3. Which brings me to another question, if a installation is required for .NETCore runtime, will the .net Framework 4.6 installer install .NETCore 5 with it (limited to Windows only)?

    See 2.

Tseng
  • 61,549
  • 15
  • 193
  • 205