I am developing windows forms application in C#. It always produced .exe in \bin\release. But now it is not creating .exe file for this specific project. There is no error and even warning. I also checked the the build output folder and is the same. I tried build and rebuild solution. if I open other project and run it creates exe.
build options:
configuration= active release,
platform= active any cpu,
output folder= \bin\release,
generate serialization assembly= auto,
Related
I changed jobs this year, so due to that i switched from Java to C#.In both jobs I work/worked on a large application that is deployed to a server and exposes various webservices.
With the Java job, an ant build process created a .ear file that contained a .war file and other objects. This .ear file was deployed by copying it into a directory within a JBoss/tomcat server. I understood the process fairly well.
With the C# job, I press a green triangle "play" button in Visual Studio and the application is compiled and somehow deployed to IIS, and Visual Studio then starts up a web browser pointing to the application's URL. I don't completely understand what is happening under the hood during this process. We have a build server that creates production builds that go out to production servers, but I don't understand a) what artifacts are produced by the build process, and b) how are those build artifacts deployed to IIS.
I would like to understand the process well enough to manually drive builds and deployments, re-automate the process, and also troubleshoot and modify our existing build and deploy process. I can drive a build with msbuild, but what does that produce, and how would I get it deployed onto another machine's IIS installation?
What happens when you hit Run (the green triangle) is probably not the best example, because it is using a specialized form of IIS (sometimes called Cassini) hosted within Visual Studio with a debugger attached.
To get a clearer picture of what happens when deploying, use the Publish tool to deploy to a folder on your desktop. In that folder you will see what is essentially the web root. Your project, minus any code files, and a bin directory with the compiled binaries.
Typically only static files such as html, css, and png, etc. will be deployed, while any code files won't. By default Visual Studio "knows" which files to build into the binary, and which to simply copy to the output folder (and which to ignore). But you can change this in cases where you need to override that behavior, or you have a file type VS doesn't know about. In your solution explorer, right click on a file, select properties. In the properties window for that file you'll see "build action", which shows what VS will do with that file.
Hope that helps.
Just add a note.
So,
If you are working with ASP.NET Website, it should enough to manually copy it to publish folder
If you are working with ASP.NET Web Application, so before publish it should be compiled. All compile operations is performed by MSBuild - command line utility to buld .net projects. But how MSBuild can understand, what it should build and in what way? Easy - there special files with instructions for MSBuild - is solution files (example howto build project from command line "C:\...\MSBuild.exe" /maxcpucount:10 MyAwesomeSolution.sln). Solution file contains references to project files (and build order for projects, etc), project files contains references to files, which included in project (and type of project - library/console/web app/etc, and framework version, and action for each file - build/content/resource, etc). If some file does not included to project, it will be ignored.
So, when you press green button, firstly VS will run MSBuild to build your solution. Inside solution should be written, which project will be used as starting point and what should be done before/after build. Inside project there information, howto debug project (via IIS, IIS express or smthg else).
So, when we working with some CI server, to compile our solution is enough to run MSBuild on CI server with path to solution. Ofcource, to publish compiled solution via CI, additional scripts should be written (to cpy files, etc).
Also, if you want to publish you website to some location, you can create "publish profile". It allows you to publis your website to IIS, FTP, etc, but you have to press "publish" button manually (right click on web project => publish)
I have a console application built in visual studio 2010.
When I actually build the project I am getting .exe file under \bin\Debug\MyProj.exe.
When I Paste and run this .exe from other location it is expecting other files too.
Any thoughts how can I make this as Stand alone exe file.
There should be other DLL's in the Debug library. You need those to run your exe.
If there are no DLL's there, make sure you set the 'Copy local' property of the required references to True, and build again.
If you want to make a standalone program, you should create a new Setup project in your solution. Include the Primary Output from your application project, and the setup should include the required DLL's automatically. Once you build the setup project, you can install your application as a standalone software.
You usually distribute application with bunch of DLLs, that's nothing bad.
But if you really want to make it a single exe, you can look here - same question is answered Embed .net dll in c# .exe . (Valid if your DLLs are also .Net assemblies)
Edit: If you need to easily distribute app to not-very-computer-friendly users, consider also trying ClickOnce. It's roughly something like Java Web start - only disadvantage is that you can't get "Windows Logo" certificate from Microsoft for projects distributed that way.
I don't have Visual Studio 2010 to experiment with, but in Visual Studio 2019 this worked:
Project Properties->Configuration Properties->Advanced->Use of MFC->Use MFC in a Static Library
In VS2012, I've created an Wix3.6 setup project for an application. The installer output type is set to Executable Package (.exe) on the Properties tab. The setup project compiles and produces an .exe as expected.
Double-clicking the .exe produces the message:
This app can't run on your PC.
Executing the .exe as Administrator and granting elevation, the machine says:
Windows cannot find 'C:\abc\xyz.exe'. Make sure you typed the name correctly, and then try again.
Googling reveals the error message is likely architecture related.
Facts:
Machine is Windows 8, 64-bit.
The setup project is set to an x86 platform.
The same setup project produces a working x86 .msi
Any ideas about incorrect settings, references or configurations to look for?
A bit late but I came across this myself and this is my solution.
Basically, this scenario can be created by trying to change a WIX setup project from 'MSI' output to 'EXE' in the project settings. A WIX setup project can only generate an MSI from it's Product.wxs. A WIX-generated EXE is actually created with a bootstrapper project, containining a Bundle.wxs, which then in turn can bundle your MSI(s) internally into a bootstrapped EXE.
So to solve this change your setup project back to MSI output, then create an additional bootstrap project (with EXE output) and add your build MSI output from the setup project in the "Chained packages" section of the Bundle XML.
So I made a C# program, and its great and all (its a Windows Form Application). The issue with it, is I don't know how to use it outside of the debug mode form. How do I publish it? My target goal is to create a two folders, put a shortcut to the application in one, along with the other folder which will contain the application and all outside programs (some of the buttons link to batch files). Then I'd want to be able to put it in a RAR compressed file, and upload it online for others to download it.
How do I publish it so that happens? How do I take it out of debug mode?
Go into your project folder, then navigate to /bin/Release. If there's an EXE file with the title of your project in there, copy it somewhere (along with any DLLs that you may have linked) and there's your program. If it's not there, first try Build -> Compile Solution in Visual Studio. If it's still not there, navigate instead to /bin/Debug and do the same thing. Then, copy all your batch files into another folder, put them into the same folder, and RAR it.
P.S. Try not to use RAR, few people can extract them. Use ZIP or SEA (self-extracting archive) if at all possible.
First off, you need to build your application in Release mode, in Visual Studio simply change the drop down near the top of the window to "Release." This will create a bin/Release directory where your sources are located. The folder will contain an EXE for your application and DLLs you need to include. It could (and probably will) include some debugging *.PDB files that you do not want to include -- as those include debugging information.
Copy the contents of that directory somewhere and RAR it up.
Building in x86 Mode
(You should only do this if you have a specific reason to)
If your application uses 3rd party DLLs that are not 64-bit compatible, you may need to do a release build in x86 mode. To do that, click the "Any CPU" drop down and click "New Configuration" (or something like that) and follow the steps to add x86. Then build with the x86 -- Release setting. That will output x86 binaries to a bin/x86/Release folder where your sources are located.
The Preferred Soltuion
Most users are going to prefer some form of automatic installer instead of a simple RAR or ZIP. Visual Studio (Standard/Pro) can create self installing MSIs that do all the work for you. A basic overview is here. You can add shortcuts/etc using the wizards Visual Studio provides.
If you need an even more robust installer you could check out solutions such as InnoSetup or NSIS
To build your application in Release mode instead of Debug, go to the Build menu and select Configuration Manager.
Change the Active soluction configuration to Release. Now, when you build your solution, it will put the executable in the /bin/Release folder.
If you need to automatically perform certain actions once the solution is built, like packaging into a RAR or ZIP archive and copying the distributable to another folder, then check out post-build actions.
After Visual Studio 2010 , Microsoft remove Make setup utility facility from the visual studio and,we have to downlorad that plugin seperatly from
Get InstallShield Limited Edition for Visual Studio
You Have to fill the application
After intalation, goto
Visual Studio-->New Project-->Other Project type-->Setup and Development
You will see follwing screen
Now you can goto InstallShield setup utility and change the things as you requirement.
add all file in debug folder of your project in follwing interface and build solution,
Final setup will locate in your setup folder-->Express\CD_ROM\DiskImages\DISK1**
hope this will help you
I developed a program in Visual Studio 2010 Express edition. I want to create an installation/setup file for the program. The Express edition only allows me to create a “One Click Installer”. The program requires a dll file that must be in the same directory as the exe file of the program to work. However, I am unable to import the dll file as a reference as it generates an error. Therefore, the One Click installation file does not install the program correctly.
Is it possible to force the One click installer to copy that file to the installation directory during the installation process? If not, what other options do I have to create an installation/setup file for my project?
Thanks
It is called ClickOnce. Project + Add Existing Item and select that DLL. That adds it to your project. Select it and look in the Properties window. Build Action should be set to "Content", that makes ClickOnce publish it. Copy to Output Directory should be set to "Copy if newer", that ensures that the DLL is copied to your build output directory. What you did by hand previously.