Click once deployment not updating after Assembly info changed - c#

So up until this point I have been using an updater I wrote for deployment across my company network. Enough people have asked me to switch to a clickonce updater so I am looking into it now. These are the steps I took to implement it.
Removed my update logic from the solution
Published my app and pointed the update path to a fully qualified shared network location
Installed my app
Ran my app
Changed the Assembly version and file version in the solution
Published the new version to the update path
Attempted to start app but didn't get a prompt to update.
What am I missing?

There are a couple of steps you may have missed:
Did you enable "The application should check for updates" and " Before the application starts" in the ClickOnce update settings (in the Publish tab in Visual Studio)?
Did you update the ClickOnce 'Publish Version' before publishing your new version (it's also in the Publish tab in VS)?

So the Answer is I was pretty simple but it should be documented on Stack for clarity.
Everything I am about to post is here. http://msdn.microsoft.com/en-us/library/1zyc39fb(v=vs.80).aspx
The problem that I was having was that I kept publishing to the same location when in reality after you do your initial publish, you need to ONLY publish to the update location.
For example:
What I was doing:
Version 1 is published to c:\ver1\ With and update location of c:\ver1Update\
Version 2 is published to c:\ver1\ With nothing put into c:\ver1Update\
The correct way to do it (at least to make it update):
Version 1 is published to c:\ver1\ with an update location of c:\ver1Update\
Version 2 is published to c:\ver1Update\ with an update location of c:\ver1Update\
This was the fundamental difference and allowed it to update
This can all be done by right click on your project and selecting properties. Then clicking on the publish tab.
Hopefully this helps someone else confused in the future about this process.

Related

clickonce update of visual studio not working

I publish my application from project properties of visual studio and i set the update-path to one of my local drivers E:\WebSiteupdate. The update must run before application starts but i do not really know what should i put on E:\WebSiteupdate to update the application.
here what i used to do for update:
another publish from new application
copy all of new publish folder in E:\WebSiteupdate
but nothing happened and still show old program
what kind of files should i put on update path for update application?
Clickonce's auto updates are meant to update installed applications. That has nothing to do with the project run from VS. When you set Update location, each time the app launches it will check for a newer build/publish in that location. If there is a different build, it will automatically update your installed app. To answer your question what kind of files...? Its is the same contents that you get while you publish your app.
To try this:
Set your Upload location(Project properties --> Updates...) to a path accessible from your pc.
Publish your app to a different location lets say D:\Publish\
Install the app in your pc. There should be D:\Publish\setup.exe. Double-clicking that will install. This will put a shortcut menu in the start menu.
Make any minor change in the UI of your project (in VS).
After clearing the contents in D:\Publish do another publish.
Clear the contents from the Update location and copy over the contents from D:\Publish.
Now (don't do another install) close (if already open) and open the app again (shortcut should be present in Start menu)
The app should update automatically before opening. This is how we are expected to give app updates to the clients. Further, if you like to automate this I found the below link by deadlydog very helpful: http://blog.danskingdom.com/continuously-deploy-your-clickonce-application-from-your-build-server/

Windows Service not updating when code changes

Hi i'm new in Windows Service c#. i followed tutorials and it works perfectly after installation.
Now my problem is when i modify the fonctionnality of the service (modifying c# code), and i uninstall & install the windows service, the functionnality remains that of the first installation.
I even restarted the PC and the functionnality and the functionality has not changed
Is there someone who had this problem?
I also had the same problem.If you are using visual studio installer, just delete the .msi and setup.exe from "XXX\Release" folder and rebuild visual studio installer project. It will recreate both files with updated code changes.
Right click solution > rebuild. Then run your service again.
In order run the updated service in Windows which is created in c# follow below steps
First of all stop that service in windows service manager (services.msc)
Then go to build menu in Visual Studio and click on Rebuild Solution
Then go to services and start the service again.
In this way the updated service will run if it is build successfully and the service is created accurately otherwise you will get Service Failure alert in Windows with specific error code.
I had the same issue and the solution I tried is different from the marked answer.
Right click the setup project (you get a popup window). Click Configuration Manager button at top right, from Active solution configuration dropdown, check whether the selected value is Release. If it is Release then Release folder is updated on building the project; else Debug folder.
Hope this will help a few having such an issue.

Update Prompt for ClickOnce using Visual Studio

Just had 2 questions.
1) I am writing a simple program in C# just to test out how to set up updating, However the program automatically updates ( I am using ClickOnce) and I was wondering is there any way to prompt the user to update?
2) I am publishing my project to a localhost, and I have published it about five times (v 1_0_0_1 - 1_0_0_5) and the folders are stored as such, however, when I publish, it changes ALL of the different versions, not just the latest one. I am trying to allow version control where I can allow a user to go back to a previous version.
Thanks in advance!!!
After the user installs your app for the first time, every time after that when the application is started it will check for an update. If there is an update it will ask the user if they want to update to that version.
This happens by default and you can even prevent them from opening the application if they select not to update. (Preventing the program from opening if the user does not update is not the default configuration but can be set in the publishing wizard or properties of the application)
Also you should know that publishing the application will not cause you to lose or overwrite all of your previous deployed versions. They are all still there under root/Application Files. You will see the latest version though because the app will look at the manafest file and that will tell the app which version to run. If you wanted to push out a later version you would change the manifest to point to that version.
However, a single user will not be able to choose which version they want. Once they choose to update they will be on that version until you push out a different one. This is for security and compatibility so that your users are on the same version once they choose to update and you don't have a bunch of different people running different versions whenever they feel like it!

My Local Fileshare ClickOnce Update Is Not Working, Help?

I have a C# application that I'm trying to get to update automatically via ClickOnce. After publishing newer versions of software, I see the new versions in my publish folder, but when I open the application, it checks for updates, and does nothing (even though there are new files in the publish folder).
What do I need in place for updates to be made automatically?
Edit
What version of Visual Studio are you using?
Visual Studio 2008
Are you deploying the upgrades to the same location as the old version?
They are being published to the same location (not sure about deployed)
Is the installation URL the same? Have you incremented the version number?
Yes
In the Updates dialog reached by clicking the Updates button in the Publish page, do you have "The application should check for updates" checked?
Yes
Do you have "Before the application starts" selected?
Yes
How are you deploying the files?
Not sure
Are you copying them over to the file share or publishing the directly?
Publishing directly
What version of Visual Studio are you using?
Are you deploying the upgrades to the same location as the old version?
Is the installation URL the same? Have you incremented the version number?
In the Updates dialog reached by clicking the Updates button in the Publish page, do you have "The application should check for updates" checked?
Do you have "Before the application starts" selected?
How are you deploying the files?
Are you copying them over to the file share or publishing the directly?
If you are copying them over there, are you also copying the deployment manifest (whatever.application) for that version to the top of the deployment folder structure?
This is the file that indicates which version should be installed. If you are using VS2008/2010, there is a copy of each version's deployment manifest in each versioned folder (yourapp_a_b_c_d) that you can copy to the root if you are deploying manually.
This is where it gets a bit trial and error, since it seems like you're correctly configured. So it must be something to do with your environment.
Is the publish URL different from that which you initially installed it?
This is particularly pertinent if you're talking about this behaviour on your local dev machine whereby you probably first ran from a different location. Such that it'll keep looking for updates in the initial activation path. Suggest trying a full uninstall/reinstall and see if it persists... You could test by looking at ApplicationDeployment.CurrentDeployment.ActivationUri.
If worst comes to absolute worst, then maybe manually check and run updates?
Useful links:
http://msdn.microsoft.com/en-us/library/s22azw1e.aspx
http://bloggingabout.net/blogs/dennis/archive/2007/11/05/manual-check-for-updates-with-clickonce.aspx

clickonce same publish version but assembly version different, update not happening

I have deployed a clickonce application, in my application i have 10 external dlls. Since the code inside my dll files keeps changing and it's tough to redistribute i went with clickonce deployment strategy. But i wanted to know a thing, if i make a change to one of the dll files and upgrade it's assembly version from 1.0.0.0 to 1.0.0.1, but do not change the publish version, it still is 1.0.0.0. Also i have set the update setting to be before application loads. I re ran the setup deployment but it did not run the updated assembly. What is wrong?
I'm using VS2008 and C#.NET 2.0
ClickOnce only cares about publish version for the whole project. Increment this in your "My Project" Publish tab and publish again.
I want to add to Tom's answer.
He is correct, ClickOnce only cares about the publish version for the project. However, once your application is started on a client's machine and it recognizes it's not the latest version, it starts comparing the file hashes from the application manifest (the application manifest is the one without the ".application" extension...go figure). Therefore, it only downloads files that have changed; yes, a recompile with no code changes is still a change.
And one final note. The download progress bar that appears when a client is downloading the latest version always shows the entire size of your application. However, rest assured that it is only downloading the changed files. I've done testing with a bandwidth monitor to confirm it.

Categories

Resources