Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run a .net app without installing .net?

Tags:

c#

.net

exe

I made an app in visual studio that uses C# and .net. I want people to be able to use that app without installing .net is there some way that I can include .net with the exe

like image 919
wesley Avatar asked Oct 20 '25 03:10

wesley


2 Answers

If you have developed app using .NET Core 3.1+, then Publish self-contained app.

Example: To publish Windows 64-bit executable - dotnet publish -r win-x64

Note - To build and publish, of course, you would need .NET SDK. But once you have published a self-contained app and obtained the executable:

The user of your app isn't required to download and install .NET Core.

like image 54
Meer Avatar answered Oct 21 '25 17:10

Meer


C# is tightly bound to the .NET framework, and won't work without it - even "basic" datatypes like string are part of .NET rather than a part of the language. So "no, not really" is the answer here - a version of the framework is necessary in order to run your app. Now, there are things you can do but the simplest is to set the target framework version to one that is installed on your target OS already

If the OS includes it, your app should run without additional framework installation.

But there is a native compiler (since version 4.5), that should solve that problem of the framework.

You can also check this Compiling Apps with .NET Native

like image 27
JKC Avatar answered Oct 21 '25 17:10

JKC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!