Question on deploying winform project - c#

I want to seperate one project from my main winform project, then "publish" it or something so that i will be able to click a button and the application will run, instead of running visual C# expresss and then run the project.
How do I achieve that?

It's not really clear what you mean, but just building your Windows Forms application will create a .exe file - you can copy that (along with any DLLs it requires) to another machine which has the appropriate .NET framework on, and then just double-click on the executable to launch it. (You can copy it to elsewhere on the same machine as well, of course.)
You certainly can create "setup" projects to bundle everything into an installer, but for simple needs copying a file would be fine. You don't need to launch it through Visual Studio.

When you compile your application as Windows app, it is executable out of VS environment. Just change the properites of the project.
And what do you mean click a button? From desktop, you need to double/single click the application from its directory to launch it.
Again qs is not clear.

Related

How to release a project with dlls and packages used in it in Visual Studio C# to use it on another PC?

I've just finished my Windows Forms App project in Visual Studio using C#. I know I need to release it. To do so I need to go from Debug mode to Release above in VS and then just click on F6. After that I have a folder with an exe file in it. But in my project I use a dll library which was copied on my PC and registered by regsvr32.exe in cmd. Next in VS I went to Solution Explorer and added the library in References by writing the path to it. I also use two packages which were installed by NuGet Package Manager.
My program is developed to use it by my coworkers so I have to distribute it to them. The problem is that I don't know how to prepare my app for it.
I'm reading lots of different articles about the release step but I'm getting more confused. People usually write that I can just copy the exe file in the release folder and use it in another PC after installing .Net there. But in my project there are also the three libraries and without them my program won't work in another PC. I can copy and register the first library on other computers but what about the last two? How to set up them correctly?
About the first library, I put it in a folder created by me manually in the C directory of my computer. The release folder is in another place. And when registering this library in cmd and then adding it to References, I specified the path to it. It means if the path has been changed, it won't be possible to use the library in the project. I tried some times. It's not convenient and when placing the app in another PC without VS where I can specify the path, my program won't probably work. So it would be very convenient to place this library next to the release folder and after putting it in another PC, the path to the library wouldn't cause any problems.
To sum up, I'm looking for the way to easily and conveniently distribute my program to users. Of course, I want to put my app and the libraries together in a PC, not to set up them separately and then tune them separately to make the program work there. Might there a way to release it as an app with all the libraries connected to it?
I feel it must be easy but I'm not so experienced. I'm sorry for that.
It is recommended that you use ClickOnce deployment:
ClickOnce deployment is a Microsoft technology that allows you to easily deploy your Windows Forms App along with all its dependencies. With ClickOnce deployment, you can publish your application to a web server or a file share and users can install it by simply clicking on a link. ClickOnce will automatically download and install all the required DLLs and packages on the user's computer.
Of course, there are some third-party packaging software that I can't recommend. If ClickOnce doesn't help you, I'll think of other ways.

clickonce update of visual studio not working

I publish my application from project properties of visual studio and i set the update-path to one of my local drivers E:\WebSiteupdate. The update must run before application starts but i do not really know what should i put on E:\WebSiteupdate to update the application.
here what i used to do for update:
another publish from new application
copy all of new publish folder in E:\WebSiteupdate
but nothing happened and still show old program
what kind of files should i put on update path for update application?
Clickonce's auto updates are meant to update installed applications. That has nothing to do with the project run from VS. When you set Update location, each time the app launches it will check for a newer build/publish in that location. If there is a different build, it will automatically update your installed app. To answer your question what kind of files...? Its is the same contents that you get while you publish your app.
To try this:
Set your Upload location(Project properties --> Updates...) to a path accessible from your pc.
Publish your app to a different location lets say D:\Publish\
Install the app in your pc. There should be D:\Publish\setup.exe. Double-clicking that will install. This will put a shortcut menu in the start menu.
Make any minor change in the UI of your project (in VS).
After clearing the contents in D:\Publish do another publish.
Clear the contents from the Update location and copy over the contents from D:\Publish.
Now (don't do another install) close (if already open) and open the app again (shortcut should be present in Start menu)
The app should update automatically before opening. This is how we are expected to give app updates to the clients. Further, if you like to automate this I found the below link by deadlydog very helpful: http://blog.danskingdom.com/continuously-deploy-your-clickonce-application-from-your-build-server/

Publishing C# console application

I have developed a C# console application using VS2010. Now i would like to make it into a setup.exe. Is it possible to have this setup.exe as a standalone file to run my program? Meaning how can i achieve in obtaining setup.exe that when i click on that file it will run my console without even opening VS and without the need of my project folder on the workstation.
I have tried numerous time doing myself but failed up till now.
Some advice please.
Thanks,
10e5x
You can publish it. Go to your solution explorer. Right click on it. publish the application. After finishing the publishing wizard, you can get the set up file in publish folder.
or
you can simply copy the exe file directly from the Bin folder and paste it wherever you want.
Hope this is helpful.
Follow the Steps
1) Firslty build the code
2) Then go to your projects folder
3) Open Debug/Bin
4) Inside Bin you can see the exe file. That file you can copy on any work station and run your console application.
Please do remember be confirm in which .NET version ur program is compiled. If suppose you compiled your program in .NET version 3.5 and running your program in .NET version 2 . It will not work
Thanks

Installer - How to get exe to run stand alone

I have created a winforms project, and created an installer for it.
When installed i can run the exe from the install location, however if i create an entry in my install package to add the project output (the exe) to the users programmes menu or desktop then it fails
Does anyone know why this might be?
Thanks for your time
If this is a VS Deployment project, you don't add the project output directly, you create a shortcut from within the File System Viewer pointing to the primary output (which you will probably find in the 'Application Folder' in the shortcut dialog). You can then assign the shortcut a name and icon etc.
You need both the EXE and the MSI.

Compile to stand alone exe for C# app in Visual Studio 2010

Similar to this question
Compile to a stand-alone executable (.exe) in Visual Studio
But nothing there works for me.
I've written an app that is very simple in C#. I want this to compile to a stand alone exe file, but I can't seem to find the proper settings to do this. Everything compiles into a publish folder and there is only the setup/install files.
Thanks!
You just compile it. In the bin\Release (or bin\Debug) folder, the .exe will be in there.
If you're asking how to make an executable which does not rely on the .NET framework at all, then that's a lot harder and you'll need to purchase something like RemoteSoft's Salamader. In general, it's not really worth the bother: Windows Vista comes with .NET framework 2.0 pre-installed already so if you're worried about that, you can just target the 2.0 framework (then only XP users would have to install the framework).
I am using visual studio 2010 to make a program on SMSC Server. What you have to do is go to build-->publish. you will be asked be asked to few simple things and the location where you want to store your application, browse the location where you want to put it.
I hope this is what you are looking for
Are you sure you selected Console Application? I'm running VS 2010 and with the vanilla settings a C# console app builds to \bin\debug. Try to create a new Console Application project, with the language set to C#. Build the project, and go to Project/[Console Application 1]Properties. In the Build tab, what is the Output path? It should default to bin\debug, unless you have some restricted settings on your workstation,etc. Also review the build output window and see if any errors are being thrown - in which case nothing will be built to the output folder, of course...
You can use the files from debug folder,however if you look at app debug informations with some inspection software,you can clearly see "Symbols File Name" which can reveals not wanted informations in path to the original exe file.
Press the start button in visual studio. Then go to the location where your solution is stored and open the folder of your main project then the bin folder. If your application was running in debug mode then go to the debug folder. If running in release mode then go to the release folder. You should find your exe there.
You can get single file EXE after build the console application
your Application folder - > bin folder -> there will have lot of files
there is need 2 files must and other referenced dlls
1. IMG_PDF_CONVERSION [this is my application name, take your application name]
2. IMG_PDF_CONVERSION.exe [this is supporting configure file]
3. your refered dll's
then you can move that 3(exe, configure file, refered dll's) dll to any folder that's it
if you click on 1st IMG_PDF_CONVERSION it will execute the application cool way
any calcification please ask your queries.

Categories

Resources