Declaring LightSwitch Publish Wizard Bankruptcy


Sometimes if you attempt to publish the same LightSwitch project to different targets (e.g. first publishing to IIS then publishing to Azure) you can get some weird errors in the publish wizard.  If you have switched your publish targets or if you have manually updated/removed settings from your .lsproj or .lsproj.user file, you can do what I refer to as “declaring publish wizard bankruptcy” to start with a clean slate (i.e. the following will wipe out all previous state the publish wizard was keeping track of):

  1. Close Visual Studio
  2. Make a backup copy of your entire solution directory (I’d rather be safe than sorry)
  3. Delete your .lsproj.user file
  4. Open your .lsproj file in a text editor and remove any of the following settings you see in the first <PropertyGroup> section:
<AdministratorFullName>
<AdministratorUserName>                          
<AllowUntrustedCertificate>                      
<DeployDatabase>                                 
<AddAdministrator>                               
<BootstrapperComponentsUrl>
<DefaultInstallLocation>                         
<DeploySchema>                                   
<PublishNewDatabase>                             
<PublishUrl>                                     
<PublishSite>                                    
<RemotePublish>                                  
<UseLightSwitchWebDeploymentProvider>            
<AzureAllowUpgrade>                              
<AzureAppendTimestampToDeploymentLabel>          
<AzureDeploymentLabel>                           
<AzureWebSite>
<AzureWebSpace>
<AzureHostedService>
<AzureHostedServiceLabel>                        
<AzureStorageService>
<SslCertificateThumbprint>
<LightSwitchPublishVersion>                      
<PublishServiceOnly>                             
<AzureCredentials>
<RequireSecureConnection>                        
<AllowAllWindowsUsers>                           
<DefaultDatabaseName>                            

 

5.  Save this file

6.  Open your project in VS

7.  Attempt to publish, re-specifying all your settings.

 

So if you ever can’t get publish to work (after it has already worked) try these steps to see if it helps.  Otherwise, I will see you on the forums Smile

http://social.msdn.microsoft.com/Forums/en-US/category/vslightswitch

Comments (9)

  1. yannduran says:

    I hope I never need it, but great information!

  2. Glenn Wilson says:

    Thanks for this, great one to keep filed away.

  3. Patrick Hawkins says:

    This worked for me. Thank you!

  4. Joe Kopp says:

    Maybe it's not Microsoft's intended usage for Lightswitch, but I would like to have publish profiles for easy switching between different publish locations (e.g. Production / Development). Always manually changing the settings is error prone. Does anyone know about such an extension?

  5. Jan Van der Haegen says:

    Hey Joe Kopp,

    if you ever get this message, you can vote for this idea on MS.Connect visualstudio.uservoice.com/…/2663131-allow-saving-multiple-publishing-configurations-

  6. Thanks for pointing that out Jan.  I will raise awareness of that entry with the rest of the team so we can take the feedback into account for future consideration.

  7. Richard Walker says:

    Today you are my hero! Thank you soooo much!

  8. François says:

    Note taht you would also have that message if you use multi-html clients. You have to comment one of them on the lsxtproj file.

  9. BEM says:

    This post saved my bacon today.  Thanks!

Skip to main content