Error starting exe after posting: “This program may not be installed correctly”

Why, after publishing my project, I can’t start my exe (the one you find in the Debug folder) without receiving this error message after closing your project? - Thus, not using my published project, and still just using exe

I created a test project to check if this is true, and this happens every time.

  • Create a new Windows project.
  • Build it.
  • Go to the debug folder.
  • Copy exe to your desktop
  • Run the program

  • This opens the empty form.

  • Now close it.
  • And again the error message appears.

How do you get rid of this? I read that you should add material to your manifest, etc., But surely there should be an easier way? I am using Visual Studio 2008 on a 64-bit Windows 7 machine.

EDIT:

I found a solution to the problem. The reason for this is because I had the name “installer” or “setup” in my project name, can you believe it ... something like that can affect a project like this.

I found that this question was answered How to prevent the error messages "This program may not be installed correctly" in Vista It is for this reason that the program did this.

+4
source share
4 answers

This happened because the name "Installer" or "Setup" was specified in the project. Creating a project with a name without these words in solving the problem. (A very strange problem)

Link to a similar question and answer here

+9
source

Add a manifest for your application with this content:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> <application> <!--The ID below indicates application support for Windows Vista --> <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/> <!--The ID below indicates application support for Windows 7 --> <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/> </application> </compatibility> </assembly> 
+3
source

It seems like Windows seems like your program is an installer. MSDN has a page. Does this question help you find the answer?

0
source

Disabling UAC works in Windows 7. You do not need to rename the application.

  • Press the start button and enter "uac"
  • Open "User Account Management Settings"
  • Drag the slider all the way
  • Reboot the computer.
  • Open the .NET application again

But if you cannot disable UAC (for example, on business machines), the best way is to rename your application to remove "setup" or "installer" from the [AssemblyTitle] field in the manifest.

0
source

All Articles