-1

I just developed a small application for my company. It's a WPF - C# - Application using .Net 4.7.2. I finished my program and it worked pretty fine (local machine), so i decided to check running it on the terminal server of the company. Same result there ;)

So i decided to just compile the project for Debug and Release exe files and copied the whole project directory on a shared folder. I did this, because when I have to commit some changes for my project I don't want to run to every singel user and give him a new exe file or tell them to download this. Instead of this I just want to give them a file shortcut so I can commit my changes and everyone use the new program instant.

Now I got following problem:

When I put the exe file into the copied project folder, there is an error message... enter image description here

When I move the exe file to desktop again same error. When I just copy exe file from local machine to server desktop there also is no problem. Instead of copying the whole project to the shared folder, I just put my exe there and now all works fine... ? Why does putting the exe file in the project folder seem to damage the file? All in all it's just another path? Or is it because there are other config and .dll files inside the path??

So there is no urgend problem. At least it works. But because I'm new to programming I would love to figer out the problem to understand.

Sorry for bad english and I hope everything was understandable ^^ Micha

michi.wtr
  • 17
  • 4
  • Take a look at this for a single exe: https://learn.microsoft.com/en-us/dotnet/core/deploying/single-file/overview?tabs=cli - otherwise you need the .net framework installed (in which case the required files will be in the GAC - a special folder that gets checked for files), or in the exe's local folder (as the exe checks here for its depenencies). – JohnLBevan May 03 '23 at 21:20
  • 1
    Your organisation needs some proper Application management. Something that isn't you _updating the Executeable on a network share_. I am not sure what can or will go wrong here. But if nobody else does it a certain way, you can bet there are some really good reasons against it. The kind you will hit sooner rather then later. – Christopher May 03 '23 at 21:37

1 Answers1

1

You need to deploy the application, it is not just about copy and paste files. And if you check the information below and run all the steps to set it up you will need to Include what needs to be deployed along with the executable, in the error case the .net framework.

I strongly suggest to deploy via ClickOnce. Advantages of it:

  • Integration with the Start menu and Programs control panel.
  • Versioning, rollback, and uninstallation.
  • Online install mode, which always launches an application from the deployment location.
  • Automatic updating when new versions are released.
  • Registration of file extensions.

Refer to this Microsoft article to get a better understanding of clickonce.

Refer to this article in order ro deploy your WPF application using clickonce.

jmvcollaborator
  • 2,141
  • 1
  • 6
  • 17