Keith
Keith

Reputation: 1321

ClickOnce application publishing fails when an end-user is in progress of installing required .NET runtime

Trying to publish, I got this error repeatedly:

Unable to add 'setup.exe' to the Web site. The file 'setup.exe' already exists in this Web site.

I'm running VS2013, publishing an "available online only" application, as I've had weird issues in the past where updates cause the user to get "ApplicationName - 1" duplicated installs when using the "offline" option.

This works fine. However, I'm creating this project with .NET 4.5.2, which means all of my end-users will have to update. This is fine as well, as I'm including the runtime in the Application Files of my project.

Doing some test runs, I stumbled across a huge problem/annoyance: When the user runs the setup.exe in the published folder, the installer for .NET update runs, but during this update, I can't publish as the file is apparently in use. This wasn't a problem in the past with VS2010.

Is there any workaround to this? Imagine someone leaving the .NET installer up on their screen for a long period of time during the day when I'm trying to publish an update. It's quite problematic.

p.s. This answer does not apply, as it's not an actual permissions issue: Clickonce publish - "The file 'default.htm' already exists in this Web site"

Upvotes: 3

Views: 2541

Answers (2)

Carol
Carol

Reputation: 1

If you just want to remove the offending person's lock, right click on My Computer on your desktop, right click on Computer Management in the tree and select 'Connect to a different computer'. Enter the name of the server where your setup file is locate. Expand Shared Folders => Open Files. Locate the lock against the setup file, right click on it and select Close open File.

Upvotes: 0

Rolo
Rolo

Reputation: 3423

First thing, I think this "problem" was there always even with VS2010, it just never happen before.

Now the workarounds:

  1. Disable Web Site/Web App before publish your update.
  2. Always publish to an intermediate folder before publish to PROD.

Upvotes: 1

Related Questions