Tuesday, March 13, 2012

Signing a LightSwitch application with test certificate for development purposes

When you deploy a LS app in house on the intranet to run on the client desktop and you do not have a certificate, then the next time you upgrade your application, the clients will not update automatically, but require the user to uninstall the app, then browse to the url for the published app and install it again.
This is the message you would get when launching the app from the desktop icon:
An error occurred while checking for updates. make sure you are running the latest version of the application by uninstalling it from Add/Remove programs in the Control Panel, and then re-installing the application.
Details: Cannot update application, the installed application and update candidate differ in certificate/signature state.
Conclusion: LS desktop apps need a certificate to automatically update after deployment of a new version. Alternatively we can deploy the app to run in the browser.
John Papa's blog explains how to manually create a certificate

Create root certificate

Run VS2010 command prompt
makecert -n "CN=JDH Root Certificate Authority" -r -a sha1 -sv c:\Development\Certificate\TestOOBRootCA.pvk c:\Development\Certificate\TestOOBRootCA.cer -sr LocalMachine -sky signature
clip_image002
Enter password (2x)
Click OK
clip_image004
Re-enter password
OK

“Succeeded“

Create child certificate from root certificate

Run VS2010 command prompt
makecert -sv c:\Development\Certificate\TestOOBCodeSigningCA.pvk -iv c:\Development\Certificate\TestOOBRootCA.pvk -n "CN=JDH Test OOB child Code Signing CA" -ic c:\Development\Certificate\TestOOBRootCA.cer c:\Development\Certificate\TestOOBCodeSigningCA.cer
clip_image002[1]
Use the same password

clip_image006

Use the same password
Issuer password
Use the same password

“Succeeded“

Generate PFX file

This file contains pwd and private key in one file for convenience.
pvk2pfx -pvk c:\Development\Certificate\TestOOBCodeSigningCA.pvk -spc c:\Development\Certificate\TestOOBCodeSigningCA.cer -pfx c:\Development\Certificate\TestOOBCodeSigningCA.pfx -po password
Warning: the word password in the command line above, should be replaced by another password, you will need this password when you use this certificate in the LightSwitch Publish Application wizard.
image
enter the password used for creating the root and child certificate.
“Succeeded“
These are the files up to now
clip_image002[6]
The 5 last files are the ones from my example that count, (I have already added a 2nd child cert Test2... )

Use the certificate in LS deployment

In Visual Studio 2010, publish the LS application, menu Build – Publish…
LightSwitch Publish Application wizard starts.
image
image
image
Service Url: http://<myserver>
User Name: a windows user account that has admin rights on the webserver, this account will be used by the deployment agent to do the web installation on the server.
Allow untrusted certificate: you cannot check this box, once you have entered url and name. (to be investigated later what purpose this server).
Other connections
image
Click ‘Browse for a certificate…’
Browse to the folder with the PFX certificate and select the file c:\Development\Certificate\TestOOBCodeSigningCA.pfx
image
enter the password from the Generate PFX file command (not from the root or child certificate)
image
Remark: the expiration date is 2040, and not 2013 as it would have been, if the test certificate was created by the wizard ‘Create a test certificate..’
Remark: next time you deploy a LS application this certificate will be available in this computer’s store. So next time you can click ‘Select a certificate in this computer’s store’.
Finally, In the Publish summary of the wizard, click on publish.
Visual Studio Output window finishes with: ========== Publish: 1 succeeded, 0 failed, 0 skipped ==========
Now browse to the server on which the app was deployed. http://<Myserver>/<MyApp>
The installation page appears with an installation button, click on the button ‘Install MyApp’
image
Click on Install
The application gets installed, a shortcut is added to the desktop and at the end of the installation the app starts.
So far so good. Now what will happen when an update to application is deployed?

Deploy an update of the application

IN VS201 added a new screen, build and deploy with same parameters. Successfully published.
When clicking on the desktop icon on the client to start the app, the application pops up
image
close this window and start the app again. The new screen is available in the LS app menu.

5 comments:

Anonymous said...

uggs para los ni帽os el becerro de gato el gato retropi茅 push es realmente un vintage-dise帽o de damas entrenadores que era considerado abrasador para la d茅cada de 1950.Lana alta en negro--esto puede ser una novela bota independientemente de esta colecci贸n esta es una manera 12 madura y consiste en mucho la misma mirada su 煤nico tradicional pero magn铆fico contraste pompones atar de las l铆deres dentro de su eje de arranque.
[url=http://www.brandymount.co.uk/aspnet_client/comprar-ugg.html]ugg botas[/url]
, [url=http://www.brandymount.co.uk/aspnet_client/ugg-Australia.html]ugg baratas[/url]
, [url=http://www.brandymount.co.uk/images/ugg-baratas.html]ugg Australia[/url]

Conseguir una f谩cil y uno de los centros tiene atracci贸n! Estas botas se pueden comprar en todas las capacidades.Reconocer imitaci贸n uggs en relaci贸n a su precio.Hist贸ricamente, dado su alto precio, la gente compra evit贸, pero definitivamente se han dado cuenta de ello las inversiones eran iguales.
[url=http://www.brandymount.co.uk/images/ugg-boots.html]ugg Australia[/url]
, [url=http://www.brandymount.co.uk/New%20Images/ugg-botas.html]ugg online[/url]
, [url=http://www.brandymount.co.uk/New%20Images/ugg-comprar-ugg.html]ugg online[/url]

Para las mujeres: para las damas se convierte a nadie en el planeta, hay generalmente una muy una variedad atractiva de la UGG Botas en negro en la asociaci贸n tradicional.De horario 1 podr铆a nosotros para recibir el tradicional en altura y breve, pero tambi茅n hay una nada m谩s gente para la compra de que los consumidores puede no quiere ignorar:
[url=http://www.brandymount.co.uk/sounds/ugg-online.html]ugg Australia[/url]
, [url=http://www.brandymount.co.uk/sounds/ugg-ugg-online.html]comprar ugg[/url]
Porque se crean cerca de diploma natural, usted est谩 seguro ya es vital mens uggs no calentar谩 puntera durante el invierno no suelen llevan meses, pero y tambi茅n fresco en los meses de verano para ser positivo botas con el calor.Ligera, poco a poco se convirtieron en llega a ser una tendencia cuando usando su aceptaci贸n trajo justo cuando termin贸 separado usado realzar los surfistas.

ninest123 said...

louis vuitton outlet, sac longchamp, ralph lauren pas cher, replica watches, louboutin outlet, louboutin shoes, christian louboutin outlet, prada outlet, ugg boots, longchamp pas cher, tiffany and co, louis vuitton, louboutin, air jordan pas cher, tory burch outlet, cheap oakley sunglasses, nike outlet, polo ralph lauren outlet, ray ban sunglasses, polo ralph lauren outlet, louis vuitton outlet, nike air max, replica watches, louis vuitton, air max, longchamp outlet, michael kors, oakley sunglasses, chanel handbags, nike free, nike roshe run, oakley sunglasses, burberry, tiffany jewelry, ray ban sunglasses, kate spade outlet, prada handbags, oakley sunglasses, nike air max, louis vuitton, louboutin pas cher, uggs on sale, ray ban sunglasses, oakley sunglasses, longchamp, jordan shoes, gucci outlet, ugg boots, nike free, longchamp outlet

ninest123 said...

vanessa bruno, coach outlet, nike free run uk, michael kors, michael kors outlet, coach outlet, replica handbags, new balance pas cher, michael kors outlet, hollister pas cher, michael kors, converse pas cher, nike air max, tn pas cher, ray ban pas cher, michael kors, abercrombie and fitch, lululemon, ralph lauren uk, vans pas cher, michael kors, michael kors outlet, mulberry, nike air max, kate spade handbags, nike air max, hermes, ugg boots, hollister, nike roshe, lacoste pas cher, oakley pas cher, nike blazer, ugg boots, true religion jeans, michael kors outlet, sac guess, air force, true religion outlet, hogan, ray ban uk, coach purses, timberland, north face, burberry, michael kors outlet, true religion jeans, burberry outlet online, north face, true religion jeans

ninest123 said...

lancel, celine handbags, jimmy choo shoes, bottega veneta, nike roshe, asics running shoes, gucci, giuseppe zanotti, nike huarache, mcm handbags, herve leger, hollister, hollister, new balance, ray ban, p90x workout, soccer shoes, babyliss, longchamp, mac cosmetics, nike trainers, chi flat iron, mont blanc, vans, vans shoes, ghd, iphone cases, nike air max, hollister, ferragamo shoes, ralph lauren, louboutin, nike air max, beats by dre, valentino shoes, converse outlet, lululemon, north face outlet, instyler, soccer jerseys, birkin bag, insanity workout, baseball bats, north face outlet, abercrombie and fitch, timberland boots, reebok shoes, nfl jerseys, oakley, wedding dresses

ninest123 said...

hollister, louis vuitton, canada goose outlet, moncler, pandora jewelry, swarovski, louis vuitton, bottes ugg, coach outlet, moncler, supra shoes, montre pas cher, moncler, ugg,uggs,uggs canada, ugg,ugg australia,ugg italia, canada goose, links of london, pandora jewelry, karen millen, doudoune canada goose, juicy couture outlet, moncler, pandora charms, marc jacobs, swarovski crystal, moncler, ugg pas cher, thomas sabo, louis vuitton, moncler outlet, moncler, canada goose, canada goose uk, canada goose outlet, ugg boots uk, juicy couture outlet, wedding dresses, moncler, canada goose, toms shoes, louis vuitton, replica watches, sac louis vuitton pas cher, pandora charms, canada goose