Upgrade to LS 2012 from LS 2011 successful, but fail to run because Invalid Exports

Answered Upgrade to LS 2012 from LS 2011 successful, but fail to run because Invalid Exports

  • Wednesday, September 12, 2012 2:50 PM
     
     

    We have a fairly complex Lightswitch 2011 V1 application.  SQL Server 2008 R2 database has around 300 tables.  We have a custom Theme, Shell and Controls extension that we use.    We make extensive use of the Custom Shell with specialized Toolbar, side and footer panel area.

    After following all the links about how to upgrade the Lightswitch V1 to V2 and comparing a freshly created Lightswitch 2012 application and the various references, I was finally able to get my converted project to finally compile without any errors.

    I have upgraded all the extensions to work with VS 2012 and have successfully installed all the extensions into VS 2012.

    We only use RIA Services.


    Now that I'm compiling, I am not able to get the application to run in the browser.

    When I look at the Output window, I see the errors below:

    How can I simpilfy the debugging in order to determine the cause of this issue?  Is there maybe a type-mismatch between the Lightswitch core assemblies causing the export of the types to fail?

    My environment:

    Windows 7 Professsional 64
    VS 2010 SP1
    VS 2012 Beta was originally installed (I uninstalled everything and the installed VS 2012 RTM version)
    Installed VS 2012 (Microsoft Visual Studio Ultimate 2012 Version 11.0.50727.1 RTMREL

    System.ComponentModel.Composition Warning: 1 : The ComposablePartDefinition 'Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.ConcurrencyExceptionHandler' has been rejected. The composition remains unchanged. The changes were rejected because of the following error(s): The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.

    1) No valid exports were found that match the constraint '((exportDefinition.ContractName == "Microsoft.LightSwitch.Client.IConcurrencyErrorHandler") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "Microsoft.LightSwitch.Client.IConcurrencyErrorHandler".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))', invalid exports may have been rejected.

    Resulting in: Cannot set import 'Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.ConcurrencyExceptionHandler.concurrencyErrorHandler (ContractName="Microsoft.LightSwitch.Client.IConcurrencyErrorHandler")' on part 'Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.ConcurrencyExceptionHandler'.
    Element: Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.ConcurrencyExceptionHandler.concurrencyErrorHandler (ContractName="Microsoft.LightSwitch.Client.IConcurrencyErrorHandler") -->  Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.ConcurrencyExceptionHandler -->  TypeCatalog (Types='Microsoft.LightSwitch.Runtime.Shell.Implementation.UserSettingsService, Microsoft.LightSwitch.Runtime.Shell.Implementation.Standard.ActiveScreenMonitor, ...').

    System.ComponentModel.Composition Warning: 1 : The ComposablePartDefinition 'Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.DefaultScreenErrorHandler' has been rejected. The composition remains unchanged. The changes were rejected because of the following error(s): The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.

    1) No valid exports were found that match the constraint '((exportDefinition.ContractName == "Microsoft.LightSwitch.Runtime.Shell.Internal.IRuntimeMessageBoxService") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "Microsoft.LightSwitch.Runtime.Shell.Internal.IRuntimeMessageBoxService".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))', invalid exports may have been rejected.

    Resulting in: Cannot set import 'Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.ScreenErrorHandlerBase.MessageBoxService (ContractName="Microsoft.LightSwitch.Runtime.Shell.Internal.IRuntimeMessageBoxService")' on part 'Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.DefaultScreenErrorHandler'.
    Element: Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.ScreenErrorHandlerBase.MessageBoxService (ContractName="Microsoft.LightSwitch.Runtime.Shell.Internal.IRuntimeMessageBoxService") -->  Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.DefaultScreenErrorHandler -->  TypeCatalog (Types='Microsoft.LightSwitch.Runtime.Shell.Implementation.UserSettingsService, Microsoft.LightSwitch.Runtime.Shell.Implementation.Standard.ActiveScreenMonitor, ...').

    System.ComponentModel.Composition Warning: 1 : The ComposablePartDefinition 'Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.ScreenExecutableErrorHandler' has been rejected. The composition remains unchanged. The changes were rejected because of the following error(s): The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.

    1) No valid exports were found that match the constraint '((exportDefinition.ContractName == "Microsoft.LightSwitch.Runtime.Shell.Internal.IRuntimeMessageBoxService") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "Microsoft.LightSwitch.Runtime.Shell.Internal.IRuntimeMessageBoxService".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))', invalid exports may have been rejected.

    Resulting in: Cannot set import 'Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.ScreenErrorHandlerBase.MessageBoxService (ContractName="Microsoft.LightSwitch.Runtime.Shell.Internal.IRuntimeMessageBoxService")' on part 'Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.ScreenExecutableErrorHandler'.
    Element: Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.ScreenErrorHandlerBase.MessageBoxService (ContractName="Microsoft.LightSwitch.Runtime.Shell.Internal.IRuntimeMessageBoxService") -->  Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.ScreenExecutableErrorHandler -->  TypeCatalog (Types='Microsoft.LightSwitch.Runtime.Shell.Implementation.UserSettingsService, Microsoft.LightSwitch.Runtime.Shell.Implementation.Standard.ActiveScreenMonitor, ...').

    System.ComponentModel.Composition Warning: 1 : The ComposablePartDefinition 'Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.VisualCollectionErrorHandler' has been rejected. The composition remains unchanged. The changes were rejected because of the following error(s): The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.

    1) No valid exports were found that match the constraint '((exportDefinition.ContractName == "Microsoft.LightSwitch.Runtime.Shell.Internal.IRuntimeMessageBoxService") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "Microsoft.LightSwitch.Runtime.Shell.Internal.IRuntimeMessageBoxService".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))', invalid exports may have been rejected.

    Resulting in: Cannot set import 'Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.ScreenErrorHandlerBase.MessageBoxService (ContractName="Microsoft.LightSwitch.Runtime.Shell.Internal.IRuntimeMessageBoxService")' on part 'Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.VisualCollectionErrorHandler'.
    Element: Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.ScreenErrorHandlerBase.MessageBoxService (ContractName="Microsoft.LightSwitch.Runtime.Shell.Internal.IRuntimeMessageBoxService") -->  Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.VisualCollectionErrorHandler -->  TypeCatalog (Types='Microsoft.LightSwitch.Runtime.Shell.Implementation.UserSettingsService, Microsoft.LightSwitch.Runtime.Shell.Implementation.Standard.ActiveScreenMonitor, ...').

    System.ComponentModel.Composition Warning: 1 : The ComposablePartDefinition 'Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.ApplicationErrorHandler' has been rejected. The composition remains unchanged. The changes were rejected because of the following error(s): The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.

    1) No valid exports were found that match the constraint '((exportDefinition.ContractName == "Microsoft.LightSwitch.Client.IClientMessageAlertService") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "Microsoft.LightSwitch.Client.IClientMessageAlertService".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))', invalid exports may have been rejected.

    Resulting in: Cannot set import 'Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.ApplicationErrorHandler.MessageAlertService (ContractName="Microsoft.LightSwitch.Client.IClientMessageAlertService")' on part 'Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.ApplicationErrorHandler'.
    Element: Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.ApplicationErrorHandler.MessageAlertService (ContractName="Microsoft.LightSwitch.Client.IClientMessageAlertService") -->  Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.ApplicationErrorHandler -->  TypeCatalog (Types='Microsoft.LightSwitch.Runtime.Shell.Implementation.UserSettingsService, Microsoft.LightSwitch.Runtime.Shell.Implementation.Standard.ActiveScreenMonitor, ...').

    System.ComponentModel.Composition Warning: 1 : The ComposablePartDefinition 'Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.RuntimeMessageBoxProvider' has been rejected. The composition remains unchanged. The changes were rejected because of the following error(s): The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.

    1) No valid exports were found that match the constraint '((exportDefinition.ContractName == "Microsoft.LightSwitch.Runtime.Shell.View.IScreenViewService") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "Microsoft.LightSwitch.Runtime.Shell.View.IScreenViewService".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))', invalid exports may have been rejected.

    Resulting in: Cannot set import 'Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.RuntimeMessageBoxProvider.ScreenViewManager (ContractName="Microsoft.LightSwitch.Runtime.Shell.View.IScreenViewService")' on part 'Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.RuntimeMessageBoxProvider'.
    Element: Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.RuntimeMessageBoxProvider.ScreenViewManager (ContractName="Microsoft.LightSwitch.Runtime.Shell.View.IScreenViewService") -->  Microsoft.LightSwitch.Runtime.Shell.Internal.Implementation.RuntimeMessageBoxProvider -->  TypeCatalog (Types='Microsoft.LightSwitch.Runtime.Shell.Implementation.UserSettingsService, Microsoft.LightSwitch.Runtime.Shell.Implementation.Standard.ActiveScreenMonitor, ...').


    Thank you very much for any guidance you can provide.

    Chris

All Replies

  • Thursday, December 13, 2012 6:34 PM
     
     

    Hey Chris

    I'm seeing the same errors (though I am trying to run as a desktop application). Were you able to figure this out?

    Thanks,

    Jaspreet

  • Thursday, December 13, 2012 9:06 PM
     
     

    Jaspreet,

    sorry to hear that you are hitting an issue.  Are you also upgrading a V1 application to VS 2012 and hitting the issues described above?

    Can you provide more details on your scenario?  Are there custom extentions being used?


    Robert Schoen (Microsoft Visual Studio LightSwitch Team)


  • Thursday, December 20, 2012 8:33 PM
     
     Answered

    Hi Robert,

    Sorry I missed this reply from you.

    In my case I was not trying to upgrade from V1 to VS2012, but it turns out that it was a fault installation of WCF RIA services that was causing the issue. The solution was not as simple as re-installing because it kept failing to uninstall or repair or reinstall. In the end, I found a link where the reg keys that were involved were mentioned and I manually removed all of them, and deleted the files and then reinstalled. That worked, but unfortunately I cannot find that link which mentioned the reg keys anymore. 

    Once I was successfully able to install WCF RIA services, everything worked for me. 

    Thanks

    Jaspreet

  • Thursday, December 20, 2012 8:48 PM
     
     

    Jaspreet,

    thanks for the followup info - very helpful! 

    Cheers!


    Robert Schoen (Microsoft Visual Studio LightSwitch Team)