0

I intend to build simple Winform application just to allow user to automate their file creation and store the last filled form in a file to keep it for next run. thus, I'm not interested in creating installer for this simple Winform application. I expected to only compile it to .exe and let it run on other computers.

I develop the application using VS2019 community with target .net 4.6.1 It won't run on computer with Windows 10 with only .net framework 4.8

We are not able to install framework 4.6.1 since it says an earlier version of .net framework is already installed.

Should I recompile my application with target .net framework 4.8?

Can't I compile my application to run on any computer which at least has 4.6.1 or newer? without installer.

(I don't really understand the .net framework backward compatibility truly mean)

my application uses:

  • library of user32.dll for SetForegroundWindow function

  • to create .ini file

evry1falls
  • 194
  • 4
  • 15
  • the link you provide, result an error - 404 - page not found. Ah, it is the tailin square bracket ] cousing the error. – Haitham Sungkar Jun 04 '20 at 18:22
  • Sorry. again Short answer **YES** recompile your application in .net4.8 . OR, you can read this article about [Side-By-Side execution] https://learn.microsoft.com/en-us/dotnet/framework/deployment/side-by-side-execution – evry1falls Jun 04 '20 at 19:13
  • I did download .net 4.8 framework SDK and choose it as application target. Guess what, it still wont run. when we double clicked on the .exe it seems opening but might be crash before showing its windows form. unfortunately the **crash without any message appear.** is there a way to let window always show message box for any program crash? – Haitham Sungkar Jun 05 '20 at 02:39
  • Well, have you checked the target PC for : 1- whether it's a 32bit or a 64bit against your Project Build ? 2- Whether your project needs Admin Privileges to run on target PC or not ? 3- Whether you've installed the correct .net framework 4.8, read [this] https://learn.microsoft.com/en-us/dotnet/framework/install/guide-for-developers 4- Whether you've properly packed your Dependencies in your EXE build ? ........... There are still many concerns yet. Just check those first before we talk CODE. – evry1falls Jun 05 '20 at 04:34

1 Answers1

0

Finally it works. Even compiled to target .NET 4.6.1 still work on .NET 4.8 computer actually. The issue is because my application is targeting to another application using interope COM interface, while the license is not sufficient for the user to allow COM interface. we notice it when we finally create a pure simple windows form, then step-by-step compiling while adding each feature.

Sorry Every Body for this silly case. And my special apologize to evry1falls for spending your time.

I'm thinking to change this Question or delete it. because it is not the issue at all

The Actual Issue is: I created Windows Form Application starting from a blank Project. And I don't know that the .NET Unhandled Exception is not activated by default. When created from Windows Form Project Template, the Unhandled Exception message shown.

I created another Question about it: Here