ClickOnce and Visual C# Express
Oh, man - this is a real gotcha. If you're using Visual C# Express to create an application, and deploying it using ClickOnce, you need to be aware of this.
You probably realise that when you build your application, Visual Studio creates two folders underneath the "bin" folder: "debug" and "release". The idea is that the version of your application that has debugging information included is compiled into the "bin\debug" folder, whilst the streamlined version without debugging information goes into "bin\release".
You may have noticed, too, that Visual C# Express gives you no way to change which configuration you're currently running under.
So tonight I was deploying a new Comicster version, and noticed that it was deploying the debug version instead of the release version. Not a huge deal, but it does mean that the total size of the deployment files is slightly higher. So I had a poke around to determine why it was doing what it was doing.
It turns out that Microsoft, in an attempt to simplify the way users build their apps in C# Express, introduced a few strange rules:
- If you run your application from within the IDE, your current configuration is switched to debug.
- If you use Ctrl+Shift+B to rebuild your application, your current configuration is switched to release.
Got that? So - the moral of the story is:
Always rebuild using Ctrl+Shift+B before deploying using ClickOnce from Visual C# Express.

Comments
# crucible
21/03/2006 9:35 PM
Okay, that is seriously bizarre that you can't just select which release to deploy.
Or for that matter that it wouldn't rebuild and set up the release version - as it is obviously the release you're setting out to deploy.
You'd think it'd be a bit more intuitive on that.
# mabster
21/03/2006 10:21 PM
Indeed. And since you generally would have run your app immediately before deploying it (one last test), chances are you're deploying the debug version. Damn.
# crucible
21/03/2006 11:01 PM
My main issue with this is - I don't think you're exactly the type of oblivious developer I am at the moment... you're the sort of person who scans through release notes at least.
And you weren't aware of this.
So yeah, it's hard to believe the typical hobbyist developer would be aware of this.
Again, I'd think ClickOnce would have enough intelligence to demand an up-to-date Release candidate to send out - it almost seems in the realm of common sense.
I guess the answer is, become aware of every hidden, obsfucated, undocumented, and non-obvious "feature" of your software - or just expect things not to be the way you expect or want them to be... which is an issue.
# shc
24/09/2008 7:11 PM
"You may have noticed, too, that Visual C# Express gives you no way to change which configuration you're currently running under. "
Are you sure about this?
In Visual C# 2005 Express, I could select DEBUG or RELEASE. You just need to customize the toolbar.
Right click on your toolbar | CUSTOMIZE,
From DEBUG, scroll down to SOLUTION CONFIGURATION.
If you can't see it,
Goto TOOLS | OPTIONS, tick "SHOW ALL SETTINGS"
On tab "Projects and Solutions", make sure you tick
"Show Advanced build configurations"
Cheers...