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
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With