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.
Related
I've just finished my Windows Forms App project in Visual Studio using C#. I know I need to release it. To do so I need to go from Debug mode to Release above in VS and then just click on F6. After that I have a folder with an exe file in it. But in my project I use a dll library which was copied on my PC and registered by regsvr32.exe in cmd. Next in VS I went to Solution Explorer and added the library in References by writing the path to it. I also use two packages which were installed by NuGet Package Manager.
My program is developed to use it by my coworkers so I have to distribute it to them. The problem is that I don't know how to prepare my app for it.
I'm reading lots of different articles about the release step but I'm getting more confused. People usually write that I can just copy the exe file in the release folder and use it in another PC after installing .Net there. But in my project there are also the three libraries and without them my program won't work in another PC. I can copy and register the first library on other computers but what about the last two? How to set up them correctly?
About the first library, I put it in a folder created by me manually in the C directory of my computer. The release folder is in another place. And when registering this library in cmd and then adding it to References, I specified the path to it. It means if the path has been changed, it won't be possible to use the library in the project. I tried some times. It's not convenient and when placing the app in another PC without VS where I can specify the path, my program won't probably work. So it would be very convenient to place this library next to the release folder and after putting it in another PC, the path to the library wouldn't cause any problems.
To sum up, I'm looking for the way to easily and conveniently distribute my program to users. Of course, I want to put my app and the libraries together in a PC, not to set up them separately and then tune them separately to make the program work there. Might there a way to release it as an app with all the libraries connected to it?
I feel it must be easy but I'm not so experienced. I'm sorry for that.
It is recommended that you use ClickOnce deployment:
ClickOnce deployment is a Microsoft technology that allows you to easily deploy your Windows Forms App along with all its dependencies. With ClickOnce deployment, you can publish your application to a web server or a file share and users can install it by simply clicking on a link. ClickOnce will automatically download and install all the required DLLs and packages on the user's computer.
Of course, there are some third-party packaging software that I can't recommend. If ClickOnce doesn't help you, I'll think of other ways.
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.
Here's an error I get when I try to install my application from the publish location:
I have my application (and a DLL used by it) linked to version 1.61.4111... of QWhale.Common which is a 3rd party DLL. I have been used this version since about 4 updates ago and never had this problem. I have no idea which part of my application or DLL could be trying to link to the older version. The only thing I did different on this version is that I moved my application's project folders to a new location in my computer.
Where should I start trying to find where this problem is coming from? Did you ever have this problem before?
As Yahia commented, this can be a licensing issue but if you've been using this assembly for a while and if you've been compiling it with your application, there is a chance that a setting associated with the file could have changed with your projects settings.
Assuming you are using Visual Studio, I recommend opening your Projects properties window and navigating to the Publish tab and opening the Application Files Dialog.
From there, find the referenced, 3rd party assemblies make try setting the Publish Status to Include and the DownloadGroup to (Required).
Save your changes and republish your application.
I downloaded setup.exe, and then begin to install and it immediately crashes.
On win7 it worked fine. On XP it doesn't work.
Error text:
Unable to install or run the
application. The application requires
that assemble stdole Version
7.0.3300.0 be installed in the Global Assembly Cache (GAC) first.
You'll need to include stdole.dll as a required file in your Publish settings in Visual Studio. Once you publish your app again, it should then include that file in your app when it's installed.
More info can be found here.
This happened to a few people that i had to install a click once application i developed. Basically something happened in their installation of .NET and the needed .DLL's were not moved to the GAC. It's very simple to fix, basically You need to copy stdole.dll from C:\Program Files\Microsoft.NET\Primary Interop Assemblies\ to C:\Windows\Assembly ... that should fix your issue. Including them in the application isn't the best idea, this will fix it for ALL click once applications rather then just that one you are currently building.
P.S. Dragging the files to the location will work, you might get an error if you try to copy it.
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