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

2

37

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?

Thimbu answered 8/2, 2011 at 2:49 Comment(2)
Does it work if you create a new empty project from scratch?Lyndalynde
Do a build and watch the output window to see where the binaries are being created...Marashio
A
45

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.

Akela answered 8/2, 2011 at 3:39 Comment(2)
@Cody Gray thanx for edit.. i didn't knew about those <kbd> tagsAkela
Cheers Cody. That was it exactly. I didn't see that drop down and it was set to DEBUG which is why the RELEASE folder wasn't being populated.Thimbu
T
9

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.

Teletype answered 16/10, 2013 at 15:47 Comment(2)
In my case, the output folder for god knows what reason was not set properly in the project propertiesGuerra
In my situation in the config mgr., debug was selected at the project level even though release was selected as the active config at the solution level. I had to switch all the projects to release.Mert

© 2022 - 2024 — McMap. All rights reserved.