Visual Studio 2010 Express, WPF, and ClickOnce: IsFirstRun

I’m using Visual Studio 2010 Express and SQL Server Compact Edition 3.5 to develop a WPF/XAML application with an embedded database, and I use ClickOnce to deploy the application.

I’m deploying to a location on my C: drive, and I have the option for the application to check for upgrades turned off.

The deployment variable, isFirstRun, is always false for me, when it should — apparently — be true.

My steps

1. Add the following code:

if (ApplicationDeployment.IsNetworkDeployed)
{
  if (ApplicationDeployment.CurrentDeployment.IsFirstRun)
  {
  MessageBox.Show(“IsFirstRun”);
  }

2. Build and publish the application via ClickOne

3. Run the application

4. See the install of the newer version of the application

5. Never see the Message Box.

Now, it’s my understanding of isFirstRun is that it should be true the first time a new version of the app is run/installed. I’m not seeing it.

I’ve posted this online on a Microsoft forum, but, so far, no answers.

Code and Solutionb

Included Files

Publish Tab

Explorer View

You can leave a response, or trackback from your own site.

Leave a Reply

AWSOM Powered