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