My Local Fileshare ClickOnce Update Is Not Working, Help? - c#

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

Related

Where is Visual Studio storing Publish Profiles?

I have a corrupted Publish profile.
I need to delete it. My other computer is fine, so I know it is local.
I have tried:
Clean checkout of codebase from Git (so nothing is local in my code directories).
Deleting C:/Users/<user>/AppData/Local/VisualStudio
Deleting C:/Users/<user>/AppData/Roaming/VisualStudio
Full text search of Profile Name 'MunicipalAgenda' through Registry
Full Text search through machine.
Creation of a new Windows User for Visual Studio Development.
Despite all of this, VS.NET is hanging onto that corrupted Publish profile.
Honestly I am at wits' end, and my next drastic step is to do a fresh reinstall of Windows 10. Please help before it comes to that!!!
Normally any publish profile store in particular project.
For that you have to look at following location.
Go to that project.
Project has special folder call Properties
Inside that there is a folder called PublishProfiles ( Something similar)
I also had some difficulty in getting my profile deletions to stick ... Visual Studio (2017) doesn't seem to be able to do it from Solution Explorer.
My latest attempt is to go to Source Control Explorer, open up the /Properties/PublishProfiles folder, and delete and commit the unwanted profiles from there. So far so good :)

Click once deployment not updating after Assembly info changed

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.

publish winforms application without install

I've been creating winforms application for a while now, but i've never really published one to other people before.
Recently I started doing this but every time I publish my build, the user requires to de-install his current installation and install the new one.
Is there any way to remove this, so I'll only have to send a .exe file which they can use without any form of installing?
I've attempted to send the .exe file in the bin/debug/ but this only seems to work on computers where Visual Studio is installed.
Go to your solution and set the CopyLocal to true for all projects, this will ensure that the ..\Bin folder contains all the necessary assemblies for your program. Then just zip up the ..\Bin folder, get it onto the client machine, and then unzip it.
Hope this helps!
1) Change from Debug to Release in Solution Configurations
2) Right click on your project and click rebuild
3) Go to your bin=>Release=> app.publish for your exe version
4) Copy over any required .dll files,any .config files and any other resource/image files you need from bin=>Release to bin=>Release=> app.publish.
Your app.publish folder should now contain all the files required to run your form, and can be copied or zipped up and send to anyone who needs to use it !
You can try using ClickOnce as an installation method. It even has a built-in auto-update, so you can publish your application to a web server, and all existing installations will download latests version automatically.
To configure ClickOnce go to corresponding tab in your project settings.

Process of ClickOnce and prerequisites

I have an application I want to build and deploy via ClickOnce. But we want this to be a process that can be run outside of VS through scripts, for either test, business UAT or production environment.
Each separate environment requires a different .config file to be used and a different web server to be deployed on and for update location.
The application also has prerequisites of .NET runtime 3.5 and Crystal reports.
I have looked into using MAGE to create application and deployment manifests, and if I do a code BUILD, then use MAGE afterwards as per each environment, as well as having the script copy over the correct .config file, this creates what I think are the correct manifests for each environment at the time of running the script.
But what I'm struggling to do is include the prerequisites. If done through VS, you can specify a setup.exe package which gets built with the pre-reqs and deployed alongside the application and when you click on the download link, it installs the pre-reqs from setup.exe and then the application.
But how can I do this manually outside VS? I can build the setup.exe through VS with the right URl location but then how do I link the setup.exe to the application as a pre-req using MAGE to generate the manifests?
The problems we have are 1) The users do not have admin rights to download and install packages, only to install things via clickonce so the pre-reqs have to be installed under the click once security umbrella.
Thanks
ClickOnce and prereqs cause lots of confusion. The setup.exe that Visual Studio generates has nothing to do with ClickOnce. The only minor link between the two is that the setup.exe will launch the ClickOnce application once it finishes. That's it. So thinking users will be able to install your prereqs "under the clickonce security umbrella" is a mistake. If they are not an admin and a prereq install requires admin privileges, they won't be able to install it.
My advice would be to generate your setup.exe one time. You shouldn't need to keep doing it unless your prereqs keep changing. Use Visual Studio, generate the setup one time, then use Mage for the rest.
Edit
In general you make the setup.exe available and depend on the user to know if they need to run it or not. If they already have the prereqs and run the setup.exe, nothing bad happens. It sees that everything is installed then launches the app.
Usually you're going to direct users to run the setup.exe. The next time they want to launch the app they should use the start menu shortcut (assuming you didn't go with "Online Only"). I've found this to be the least confusing set of instructions for users.
Remember how Visual Studio does extra, non-ClickOnce stuff when you publish (like the setup.exe)? It also creates a simple html page that has links to both the ClickOnce manifest and the setup.exe and an explanation. It also has some javascript that checks the UserAgent string to determine if they have the .NET Framework installed. Again, this isn't ClickOnce. It's just something nice Visual Studio does for you. If you like it, use it. I kind of like skipping it and going with the run setup.exe to install then launch from the start menu.
codeConcussion is right, you can't ever actually have the prerequisites instill directly from ClickOnce. You should just generate it once and then you have it ready for your external ClickOnce tool.
There is an option other than Mage. You could use my companies tool, ClickOnceMore, as your ClickOnce build software. It's been designed for people who want to use ClickOnce but don't want to build with Visual Studio.
It can hook into the setup.exe generated from Visual Studio (details here) so should satisfy all your needs.
Why do you want to build setup manually if everything can be done via clickonce ?
You can select "Download pre-requisites from same location" option from prerequisites form if you want to include .netfx or crystalreports, download bootstrap packages for .netfx3.5 & crystalreports and add to folder (for windows 7) "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages" . The deployment project will automatically include netfx & other packages along with setup.exe.
hope this helps.

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