A
A
Andrey Kalashnik2022-02-02 02:05:22
.NET
Andrey Kalashnik, 2022-02-02 02:05:22

How to fix "To run this application, you must install .NET Core" error?

I wrote a console application in C#, compiled it (in VS it's called "Publish"), but when I run it on other computers I get the error "To run this application, you must install .NET Core". In the build settings, I changed the opening type to "Standalone", the class, the error disappeared, but now my exe weighs not 1.5 MB, but 60 MB.
What are the ways to bypass installing .NET Core? At the same time, get an ekzeshnik with adequate weight?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
rPman, 2022-02-02
@DuxaKievski

Develop an application with an older version of .net
For example, 3rd is even on win7 by default, and in 10-ke - 4.6 version, here is a list of OS revisions and versions of .net built into them
ps machines on which for some reason the latest .net is not installed something strange, now some installers even write in .net, i.e. on such a machine without .net stupidly nothing will start
Machines must be administered by someone, let him set it up as it should,
and if linux is installed there, will you apply the windows installer to your exe-shnik?

V
Vasily Bannikov, 2022-02-02
@vabka

There are several options:
1. Use .net 6 - it can drag along not the entire runtime, but only what is needed for work.
At least Hello World could fit in 12mb (single file + self contained + assembly trimming)
2. Deliver the program along with a script that will check if the .net runtime is installed and install it itself by downloading from the Internet
3. Score and leave as is (shove it into the archive)
4. Use the .NET Framework that comes with Windows out of the box, but IMHO - this is a step backwards in all respects, and you should not do this.
UPD: Hello world still weighs 12 megabytes

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question