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:

  1. If you run your application from within the IDE, your current configuration is switched to debug.
  2. 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.