Click here to Skip to main content
15,892,737 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to run the windows form application on another system which don't have any visual studio. basically on the client machine.

What I have tried:

i tried publishing the windows form application and even tried to run application using debug folder. but none of the two method worked. i can see the application running in the task bar. but from there also application stops after few seconds.
Posted
Updated 26-Jun-19 3:18am
Comments
F-ES Sitecore 26-Jun-19 7:08am    
Create an installer for your application to ensure the target has everything your app needs. Google for many suggestions, but remember there are non-distributable things the target machine will still need such as the right version of .net, SQL Server if you use that and so on.
MukulMohal 27-Jun-19 2:29am    
i tried it but i am getting an error while making an installer in
'Flash.ocx' should be excluded because its source file 'C:\Windows\System32\Macromed\Flash\Flash.ocx' is under Windows System File Protection.


and
File 'log4net.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'
ZurdoDev 26-Jun-19 7:21am    
There's no way we can know what you did wrong.
CHill60 26-Jun-19 7:25am    
If you can see it running in the task bar but it then "stops" try looking at the Event Log to see if there are any helpful messages.
Try putting in some Logging in your application so that you can trace what it is doing
MukulMohal 26-Jun-19 7:45am    
no there is no message in the event viewer

You can't necessarily just compile a program and copy the EXE file to a different computer - and C# program needs the whole of the .NET framework as a minimum, and the correct version of the framework as well (some are included with Windows, but not the most recent ones.
In addition your code may require access to DLL files which need to be included or installed in the right place, and (depending on how you write the app) connection strings and / or configuration files may need to be changed.

We can't do any of that for you, but creating an installation program is a good start, but if your app stops after a few seconds, then you need to start thinking about why - and it's likely to be connection string / config file related.

Start by adding logging to your app to find out how far it gets and where it dies: a basic text file that you append lines to at different points in your app is a simple starter (I'd suggest using File.AppendText). You then review the file after the app closes When you know the rough area that it fails in you can "focus" your logging information to narrow down how far it gets. When you have a good idea which code it's failing in, you can start looking at why, but not before.
 
Share this answer
 
I hope, i understand you correctly...

In a short: you can't!

Note, that every single WinForm project (especially written in .NET) is dedicated to use with Windows due to .net framework specification.
A cross-platform (or multiplatform) project is able to write using .NET Core. See: Choose between .NET Core and .NET Framework for server apps | Microsoft Docs[^]
 
Share this answer
 
Investigate using ClickOnce to install your app.

video: [^]

[^], [^], [^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900