C# Moved exe not working?

Hello,

I'm new to programming and I'm currently using Visual Studio 2022 to code a small program. I'm almost done, but when I move the created EXE to my desktop, for example, it no longer works. I would really like to have this feature because I'd like to send this program to friends.

Many thanks in advance

(1 votes)
Loading...

Similar Posts

Subscribe
Notify of
9 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Suiram1
10 months ago

If you use .NET, the .exe is also always a .dll file. This dll has to be located wherever the .exe is. Consider that the one on the PC you want to run the program also the .NET version must be installed for which it was compiled.

An exception is .NET Framework. It is preinstalled anywhere on Windows and only the .exe file is enough to run, but you should not use .NET Framework anymore because this is out of support.

Suiram1
10 months ago
Reply to  imexyy

Here’s a short guide:

  1. In VS2022 make a right-click on the project and Publish… Select
  2. Add publication profile Select
  3. Folder Select
  4. Again Folder Select
  5. Select the path to save and click Finish
  6. Close click
  7. On View all settings Go
  8. For Target runtime the value win-x64 Select
  9. For File publication options the option Create single file Select.
  10. On Save Go
  11. And last click on the post.

Everything is created in the path you have given. However, it may take some time until VS2022 is finished, so be patient.

.NET must still be installed.

Suiram1
10 months ago

However, there must be a difference when calling because a dll has no entry point. I can take a look at this. Do you have the .exe/.dll from an internet site or from where do you have it?

Suiram1
10 months ago

Is there the .exe on the Internet and if so at what address? And if not then you can outsource the content to a .dll and reincompile the dll in the app.

Suiram1
10 months ago

a .exe introduced into the code

What do you mean? Does this relate to your previous question? If you think that you (as in the previous question) use functions from the .exe in your application, I should first know how this has been implemented. To do this, it would also be helpful to know what the built-in .exe does to somehow simplify it, as it is a bit uncommon to call a function from a .exe from another .exe. Anyway, a little more context would be good.

I don’t want to interrupt

You’re not disturbing. I have too much time.