Programs compiled with Visual Studio can be targeted against a variety of .NET Frameworks. However, the many versions of Windows don't always have the most recent .NET versions installed.
Check which version of the .NET Framework your program is using by looking under the Application tab of your project properties. You should see a Target Framework drop down list, which will tell you what version of the framework other computers will need to have installed in order to run your program.
You have a few options to get your program working on other computers.
- 1. Compile the program with a different, lower framework. (e.g. .NET 2 is often available on Windows XP, while .NET 4 is uncommon on this OS.) This will only work if you aren't using any features from later versions of .NET.
- 2. Install the .NET framework you require on the client machine. Microsoft provides frameworks to download and install from http://www.microsoft.com/net/download
- 3. Try creating a Windows Installer using the Setup Project template. Add a new project to your solution from the Setup and Deployment category. After setting up this project, you should have an installer to run on other machines.
after all you need to create your database on which you installed exe. and reset your connectioString (.exe XML Config file) depending upon installer pc.
if you dont want to installed prerequisites while intsalling exe. try this >>right click on exeName>>properties>>prerequisites>>uncheck create setup and program to install prerequisite components.