Share via


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

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

Comments

  • Anonymous
    December 05, 2012
    I hope I never need it, but great information!

  • Anonymous
    December 06, 2012
    Thanks for this, great one to keep filed away.

  • Anonymous
    December 11, 2012
    This worked for me. Thank you!

  • Anonymous
    January 05, 2013
    The comment has been removed

  • Anonymous
    January 12, 2013
    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-

  • Anonymous
    January 13, 2013
    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.

  • Anonymous
    April 10, 2014
    Today you are my hero! Thank you soooo much!

  • Anonymous
    June 17, 2014
    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.

  • Anonymous
    March 25, 2015
    This post saved my bacon today.  Thanks!