Showing posts with label C#. Show all posts
Showing posts with label C#. Show all posts

Monday, 5 December 2011

How To: Publish a ClickOnce application in Visual Studio 2010

Ever wanted an easy way to deploy an application and then publish updates/patches to it with no fuss? If so then look no further than ClickOnce applications. Here's the simple steps you need to do to get your app out there!

Pre-requisite


You need to run Visual Studio 2010 as Administrator. For instructions on how to see this please see Run Visual Studio as Administrator.

Step 1


Right click on your project file, and choose Publish... from the options. You will be presented with the following screen:


You can publish to a file path, or a server or to a website. In this instance I'll just choose the default and press Next >.

Step 2


The next stage in the wizard asks you whether you want allow the user to run the program offline (i.e. they run it locally from their own machines) or whether you want it to run from the publish location.



In my example I'm publishing my MediaPlayer, so I want people to run it from their local machine without a connection to the Internet needed.  Press Next >.

Step 3


The final stage in the wizard is to press finish on the confirmation screen. This just shows a summary of the previous steps.


Press Finish.

Step 4


Once you have clicked Finish your application will be published. In my example I am shown the web page where the application has been published to. Now, anyone who wants to install the app just needs to click Install.


Note that it shows the pre-requisites required, and also handles the Version numbering for you - pretty neat!

Publishing updates

So you have deployed your application and you need to circulate a fix? Worried you will need to uninstall/install the application everywhere again? Fear not, you just follow the steps above again and it will release the new version to everyone the next time they launch the application.


The user  then just presses ok, it downloads the new version and away you go - job done!

Version Numbering


If you want more control over the version numbering, then you can also do this. Simply right click on your project and choose Properties. Now navigate to the Publish tab and you will see the Publish Version numbering down the bottom. Now you also have an easy way to version your software.



Each time you publish you can automatically increment the version number too.

Tuesday, 29 November 2011

Are programming reference books a thing of the past?

Something that struck me while working today was the C# reference book which currently acts as a monitor stand on my desk. Pro C# 2008 and the .NET 3.5 Platform (Windows.Net) by Troelsen is no doubt a very good book, but it has served no use other than to help my posture! In saying that, this book is at least more useful than the ones gathering dust on my bookshelves at home.

So it does beg the question - are these types of book a thing of the past? Do we really need them? My response would be no - I have not needed one in 2 years so the likelihood of needing one is very low. Whenever I need to know something it is far quicker for me to use Google which will list examples of its use which can even be copied and pasted than it is to open up a book, check its index or contents. The same can be applied to finding out information outside of programming.

What are the implications of this? Does it lead to a poorer understanding of the material, and ultimately poorer code? Probably. When using classes or controls or components it is easy to dive in and use it, rather than to look at how it should be used, what the consequences are, what the better options are. Perhaps if you had to take more time to find out the information, you would make a more informed choice.

A good example of this can actually be found in my post yesterday about the MediaElement control (WPF MediaPlayer with Last.fm interaction). When using it I did a quick Google, found some examples and was able to create something in a matter of hours. However, my final product kinda defeated my original goal which was to replace Media Player with a lightweight alternative, as it transpired that the MediaElement actually uses Media Player behind the scenes.

Does this mean I have learned my lesson? No! Personally I don't have the patience to search through books when the information is at my fingertips, and I can run through examples within a couple of seconds. For me, this type of reference book has become a thing of the past.

Covid-19 impact on mobile applications - a quick case study

Amidst everything that's been going on over the last few months, checking on how my apps have been doing has been low down my priorities...