Portable means the program runs immediately and doesn't ask to be added in "Programs and Features" of Windows.
I only know in Visual Studio C# 2015 to press Build->Publish, and publish the program to a setup.exe file with a folder near, and when I run setup.exe it adds itself to Programs and Features...
The program is a Windows Forms Application program.
Change the build configuration to: Release
Build the solution.
Zip the files in the bin\Release folder.
Unzip on another PC.
Run the exe file.
It should work too if you just give the .exe file from the release folder to the user.
Related
So currently I have a project in Visual Studio that runs perfectly. When I build the project and create the .exe build in my Debug folder I can run it without any problems. However, when I try to share my .exe build with other co-workers the project doesn't run and crashes. At first the project described that the dependencies weren't able to be located. I then added the dependencies to the folder where the .exe program was located and it still doesn't work.
So what is the best way to create a .exe program that I can hand out to people? And is there a way to test the program in an "outside" environment on my computer? Is there a way to create a .exe program that's not located in my debug folder?
Give them the whole debug folder with the exe. It should work. To have less files and optimization from the compiler use release instead of debug mode. Give them the release folder in this case.
If you want even less files install the nuget package fody costura which will pack all .dll into the exe
If you want to create an installer, check out click once deployment.
(I am using Visual Studio 2017.)
I started a small console application. A Discord C# bot. So I always launched this program with Visual Studio. After finishing it, I wanted to put the .exe file on a server, to keep this bot stay online all day long.
In the directory, there isn't any .exe file.
So I started the application again and saw this console is opened from a different path:
"C:\Program Files\dotnet" and this .exe is called "dotnet.exe"
When I want to start this .exe file manually, it closes instantly (maybe because of the missing line of code Console.ReadLine(); I don't know).
What should I change in Visual Studios settings to have an .exe file in my correct directory for my console application?
The attached picture shows my bin directory, where the .exe file should normally be. There is a .dll file, but I need the .exe file...
Updated answer:
When this answer was written, back in 2017, .NET Core only output dll files, this has since changed. This can now be achieved with this property in the application's csproj:
<OutputType>Exe</OutputType>
There are also additional deployment methods like the single-file deployment.
Original answer:
There is no exe file because you created a .NET Core application.
You have two options:
If you want an EXE, you need to target the .NET Framework.
If you don't want to change your code, then you need to install .NET Core on the server and run dotnet pathToDll on a command line
I have a project in Visual Studio 2010 that requires me to run it as an administrator. I have added the app.manifest file to the project and made the appropriate modifications there. I'm currently running this project under debug configuration. Unfortunately, when I open VS 2010 as an administrator and try to build the project, among other things it complains that it can't find the .exe file for the project (but the .exe file actually exists!).
Furthermore if I run this project as a non-administrator I'm able to build the project. Why is VS claiming that the .exe file does not exist?
Try deleting the files in
"your_solution_folder"\bin\debug
and
"your_solution_folder"\obj\debug
Try deleting .suo, clean and rebuild solution.
I was using the subst command to create a virtual drive that was the drive for the project. I had to run the command prompt as an administrator and execute the subst command and when I ran VS as an administrator after doing that everything built.
I have a solution in Visual Studio 2010, with seven projects. I have added a Installshield LE Setup project and when I add my main projects Primary-Output and then add a shortcut for the Primary-Output on the desktop, in the Installshield assistant.
Now when I install my application it creates a shortcut on the desktop, as expected. But when I run my application; it has a built-in logging class that generates a few log files. Now when I click the shortcut on the desktop to run the application, it creates my log files on the desktop, as well as where they are supposed to be created, which is the applications directory.
Why does installshield do this, because it's my understanding that it should only link to the .exe in the applications install folder, not think that it's launching the application from it's install folder.
I have gotten this to work by manually adding my output files to the setup project, but this is not ideal, as I would love to be able to configure this and then when I need to build a new installer, just build project and it's done.
If anybody can recommend a better installer that fits my needs, that would be great.
Installer Requirements
shortcut on desktop for application
shortcut on desktop for a url shortcut
shortcut in startup folder for application
eula
Something that is simple to get a setup project created, as I have a deadline and was only given 1 day to build and package a release build for a client.
Sounds like your app is creating log files wherever it's launched from, which isn't really Installshield's fault. You should really be writing to somewhere like the LocalApplicationData folder: http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx
I have completed my program and would like to send that program in its compiled state to other pc's.
I understand that in the Debug folder there is the programName.exe file, which when I open it on the PC I created it with - it opens.
But if I send that .exe file to other pc's, it crashes or simply doesnt run!
Is there a way for others to see and use my program without installing visual studio?
I have asked this question before on another programming website with not much help, this is the link that they showed me, which i then followed:
http://www.dreamincode.net/forums/topic/58021-deploying-a-c%23-application-visual-studio-setup-project/#-application-visual-studio-setup-project/
The installer installs the program, but there is no files with it to open!
Other machines won't need to have Visual Studio installed - but they will need the appropriate version of .NET, depending on what you built against. If you target the "client" profile, the .NET distribution is fairly small.
You could build a setup project which kicks off the .NET framework installation if necessary, but it's likely to be quite a lot of work - in many cases it's probably simpler just to tell people what they need to install first, particularly if this is for personal use or friends/family.
There are most likely other DLLs that your project is dependent on that do not get copied over when only transporting that .exe file. You COULD just copy those over as well.
However, the best practice is to add a new Project under Setup for a Installer. It should detect those dependencies. Then the other users will just have to run the setup.exe that gets created (but you have to include the other folders and files that get generated). Open up the File System Editor tab of the Installer project. Then inside the Application Folder, I right click on "Primary output from [Main Project] (Active)", then select "Create Shortcut to ..." and drop the Shortcut into the Program Files and User Desktop folders on the left.
For something simple, the other DLLs should be fine.
Create the MSI Installer project for your application.
Copy your project output as input of MSI Installer.
.Exe is depends on .msi file, so when you click the .exe must verify the msi file existed in same directory.
Verify the .Net framework and Installation 3.0 before run the .exe or .Msi file.
The easiest approach would be:
1: Right click on your Solution Explorer and add a new project. The new project would be a Setup project, which would be under Other Projects -> Setup and Deployment -> Visual Studio installer and then choose Setup Project from the right side.
2: Add all your bin folder files to Application folder and then build your solution.
3: It will create a file with .msi extension. You can distribute that to anyone you want and they wouldn't need any VS.