Wednesday, October 10, 2018

How to deploy a standalone .net forms website as an application

The Story (for coders only)…

I need an application to manage background services on a website I run.

These services are still in debug/development mode so I create them as Windows Forms applications rather than true “windows services”.

This works well as I can breakdown the tasks and build single applications to do e.g. clean up tasks or schedule Tweets with them. 

Each application has a thread, and if one is misbehaving it doesn’t take down the whole system.  I can Debug/Step through applications in Visual Studio and see where they going wrong, then restart them easily enough.

So I currently have an “Orchestrator” application that controls all these background service apps.

Current System

The server is set to autologin using sysinternals autologon.  Then I add a scheduled task to fire up this Orchestrator application.

The Orchestrator then queries the server to see the runstate of each application in it’s list. If one is not running it will fire up the background service.  I can easily change the required state in the Orchestrator and if one if running it will kill it.

I wrote the existing one in VB.net forms… Not something I do very often, working mainly with web technologies like MVC,  JSON dumping Webservices and Javascript clientside to test my service code.

It is a bit of pig.  It doesn’t use a database (I didn’t want a runaway DB from breaking my application), so all the config is stored in a JSON file - which is cool, but the datagrid is a pain and I’d much prefer to work with ashx-es.

Just for fun here is the old Orchestrator application screen shot.


The background services are in the DGV labelled 1.  When I click on a row the application’s details appear in 2.     Logging for the currently viewed application in Listbox 3  (this is transmitted to the Orchestrator via UDP)

Label 4 shows the Launching/Killing activity of the application and the controls in 5 allow me to configure the running properties of each background service.

New system

I want to control the application using a webbrowser and build the GUI using web technologies not all this VB forms stuff I’m not familiar with.

But how to do that!  After a lot of searching around and wild good chases  I found this article about Cassini.   I’m not that bothered about Framework 4.0,  it is only going to run on my server, and I can send a keep-alive pulse to prevent it going to sleep – permanently.

So here is how to deploy a standalone .net forms website as an application.

Create a Forms application targetting .net version 4


Then create a new web project in the solution explorer


Add a start index.aspx page.


Search Nuget for CassiniDev-AnyCPU.dll


Install it into the Form application

In the form application add the Imports CassiniDev statement then put the following code


Change the path to the path of the website project you added.  In my case it was \OrchestratorWebManager

You will need to build the website so it functions when you run the solution.


Run the Form application and there you go!


So… now the fun part.. migrating useable code from the old application to this new very basic forms project and the internal website.

Thursday, October 4, 2018

Cannot login to Windows 10 safe mode password incorrect

If you have to login to Windows 10 in safe mode and it tells you your password is incorrect.

Try using a previous password!

Yeah.. mad as that is... That is the case with me.... Oh dear Microsoft... 

Sunday, September 30, 2018

How to change Organisation Owner to different account in VSO

Visual Studio Online (now know as AzureDumpO or something too) is free for 5 users.  It get's expensive the moment you start to pay.

You can create a new VSO account with an email address from the project you making, and then add yourself into the project.  You've "lost" a seat however with the email address from the project.

"Organization admin cannot be downgraded to stakeholder license" is what you get if you try to downgrade that account to Stakeholder.

You can get round it by going into VSO as the user who owns the account (user@projectsite.com)

Click Users.. Security.. Project Collection Administrators.. Members..

Then add yourself in there.



Once you've done this logout and login as yourself.

Then hit the clog, and Settings.. Adding yourself as the Organisation Owner.


You can now downgrade the user@projectsite.com to stakeholder.

Not you should go back into the Project Collection Administrators and add the account back in there (it will tell you they don't have code access... that fine) so you don't get locked out.

On site Build Agents

If you use On-site build agents to deploy code it appears you can stilll use a PAT generated with what now a stakeholder account.

Thursday, September 20, 2018

5 point plan for Microsoft Success

I'm a lifelong Microsoft user: From early beginnings with GWBasic..  thenVB3&4 at university, classic ASP, did an NT4 MCSE and most recently VB.net MVC..

IE was a disaster, so was Windows Mobile & now Windows Phone.
I lost Office when the damn ribbon appeared.

Visual Studio/Visual Studio Online/VB.net MVC are what keep me in the MS World.  (I also have Ubuntu installations...)

Here are 5 points that if implemented would make life a lot simpler again; and probably make Microsoft even more money:

1) Dump the "Store" and let .exes run directly on WP10

Like you can on Windows Desktop.  Sure there might be the odd virus or other problem.  But it's no different from the Desktop OS.

2) Put the bloody toolbars back on Office. In fact put the toolbars and buttons and everything else back where was on Windows XP, for me "intuitive" means "guess" & "digging about".   I'm happy to have everything in menu that I can scroll through and buttons that are obviously clickable.

3) Make Bing work better.  It is terrible...

4) Show the Url/Location all the time on Edge - I don't want it "disappearing" and having to find it.

4a) On that note:  Don't force people to try to use Edge.  If it's better people will use it - sly tricks and nasty popups just make me more determined NOT to use it.

5) Please give me MSN messenger back. Skype is utterly useless, slow to unusable, bugs and errors all over it.



Saturday, September 8, 2018

European version of Mount Rushmore

Andorra is getting good a creating unique events and locations to attract visitors.  We have the Caldea Spa, the summer time free Cirque du Soleil show, and most recently the art/structure of the rock of Quer viewpoint.

I still think that Andorra should specialise in something; like the Swiss are synonymous with clocks, watches and banking... but that's the subject of a different blog post.

As an additional "attractor" we should commission an artist to carve out a face into a mountain in the same way that Mount Rushmore was.  This would be the "European version" of this famous work of art.


There are lots of locations suitable, but there is one particular rock face that I walk by very often on my way home. It is overlooking the village of Erts.


This is a large, must be 20/30 metres high face - that to my untrained eye, does look suitable.  You can't really get the full effect from my photo - try Google Maps to see it better.

But who should feature on the rock face?


Well Charlemagne of course!  The "father" of Andorra - he features in the National Anthem, and is deeply ingrained in the Andorran consciousness.


Wednesday, May 16, 2018

Vb.net CMS

I've just acquired the domain name vbnetcms.com

Which is timely because I'm about to start writing one.

I've got several sites that need basic CMS functionality.

If you want to be kept informed then leave a comment below and tick the "notify me" checkbox.

What site you want to put the CMS onto? What flavour of VB.net you use? Anything interesting!

Friday, April 6, 2018

How much is a website visitor worth?

Good Question.

Over on http://www.bedandbreakfasts.co.uk we get about 6K visitors a day, and revenues approximately 1,000 GBP: Giving a value to each visitor at GBP 0.1667 – visitors on this site have a high commercial value because they are looking for Bed and Breakfast, and likely have their credit-cards out, and ready for action. 
Lower values are likely on “information only” sites that rely on adsense and other click-based revenue.  http://mdtravelhealth.com used to get about 30K visitors a month and make 100 USD.  This gives a per/user value of 0.0033 – many multiples lower than the high-value site. 
If you want to look for your site’s value: I’d reckon it’s somewhere between these two – depending on why the visitor came to your site.