Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are my binaries not placed in the /bin/release folder when I build a Windows Service in C#?

I am new to C# and VS 2010, and am following an online guide to creating a C# Windows Service in Visual Studio 2010.

When I try and build the application however, I don't get any files created under the /bin/release folder.

I do get files under the /bin/Debug folder.

I have tried all the build configurations e.g Active, DEBUG, Release, All but nothing changes.

I have tried closing the solution down and restarting etc.

I have also experienced this same problem on a number of other projects which have been C# console apps.

The /bin/release folder exists (as I had to create it by hand) and I have checked the output path in the properties tab to ensure the release configuration is targeted to that folder.

I asked our "C# guru" at work and he didn't have a clue. Does anyone know what could be causing this?

like image 491
Rob Avatar asked Feb 08 '11 02:02

Rob


People also ask

What should bin folder contain?

The /bin directory is found on Linux computers and stores all binary executables. This directory includes all the command line commands and other binary executables. 3. Bin is also an abbreviation sometimes used for the Windows Recycle Bin.

What is the difference between bin and obj folders?

In summary, in “obj” folder, we have compiled files for each source code file and in “bin” folder, we have a single unit which links all individually compiled code files.

Is it safe to delete bin and obj folders?

The bin and obj folders are usually safe to delete since they are automatically generated when the solution/project is being build by Visual Studio/MSBuild. This feature is off by default, but can easily be enabled in the settings.


2 Answers

Most likely, you are only configuring the Release build, not actually building the project in Release mode.

Simply select "Release" mode from the drop down box in the toolbar, as shown in pic below:

enter image description here

or you can do the same thing from your project's Properties:

enter image description here

Then when you will build the project (Ctrl+Shift+B), it will build in Release mode and place the output in the folder you have configured in Project properties. (Usually this is bin/release.)

If you still don't see files in the release folder then as suggested by Gishu in the comments, check the Output Window while the build is in progress to see where the binaries are actually being created.

like image 64
Shekhar_Pro Avatar answered Sep 17 '22 14:09

Shekhar_Pro


I witnessed the same problem.Even when I had the configuration as Release as shown above,VS will some how ignore it and as I can see from the output window,it puts it in the Debug folder.

Trick that worked for me: 1] Go to Build Tab on VS. 2] Click Configuration manager. 3] Under the drop down both at active solution configuration and the project specific configuration, select release. 4] Check the project properties just to make sure. Then build it.I the release folder the required files.

Accept the answer if it helps.

like image 41
Ravi Joisher Avatar answered Sep 16 '22 14:09

Ravi Joisher