cannot run my app after publishing it RRS feed

  • Question

  • Hi,

    I want to publish my app to azure, but for debug reasons I try to publish to the desktop.

    Publishing of my app to Desktop works, but I cannot run my app. after the Login the program tries to start the default Screen (ProjektListDetail Screen) the "_Created"-method will not be reached.

    It breaks with an error:

    It says something like:

    "Error during execution of the screen.

    Error details: a call target has caused an exception."

    when I click "Close Screen" the following appears:

    it says something like:

    "invalid operation: the distributor was closed"

    Please can anybody point me to the right direction what could be wrong?

    many thanks in advance


    • Edited by OlimilO Sunday, September 22, 2013 5:03 PM
    Sunday, September 22, 2013 5:02 PM

All replies

  • Oliver, do you get this error when you debug (F5) the application?  I want to confirm if you are running into this error only in the published app.  Did you write any code in screen methods?  Please let me know so that I can help investigate.
    Monday, September 23, 2013 3:22 AM
  • Hi Ravi,

    I have Visual Studio 2012 with LS-Project-v3 with SL-Client. Yes I run into this error *only* in the published app, not in Visual Studio during debug-F5. My start-screen is "ProjekteListe" and Yes I have code in it, (I fear you asking about) If you look at it you could get the idea it could have something to do with it, but I have checked that "ProjekteListe_Created" never will be reached, I get ShowMessageBox("1") and "2" but "3" never comes.

    So I really assume it has nothing to do with my code. I more assume it has something to do with some warnings about some refererences that will not be found. I completely do not understand why the warnings arise:


    I thought I have fixed it, but the warnings will come back like a bumerang

     more about that in the next post . . .

    here is my code anyway:

    Public Class ProjekteListe
        Private _duringStart As Boolean
        Private Sub ProjekteListe_InitializeDataWorkspace(saveChangesTo As List(Of IDataService))
            _duringStart = True
        End Sub
        Private Sub ProjekteListe_Created()
            Dim gtb As GTCBenutzer
            gtb = Me.DataWorkspace.ApplicationData.CurGTCBenutzer 'GTCBenutzers.FirstOrDefault
            If gtb Is Nothing Then
                'es gibt noch überhaupt keinen User
                'dann hier jetzt erst mal einen anlegen
                gtb = CreateNewUser()
            End If
            'gibt es den aktuellen User schon?            
            gtb = Me.DataWorkspace.ApplicationData.CurGTCBenutzer
            If gtb Is Nothing Then
                'dann hier jetzt erst mal einen anlegen
                gtb = CreateNewUser()
            End If
            gtb = Me.DataWorkspace.ApplicationData.CurGTCBenutzer
            Dim s As GTComSetting
            's = Me.DataWorkspace.ApplicationData.MyGTComSetting
            s = Me.DataWorkspace.ApplicationData.GTComSettings.SingleOrDefault
            If s Is Nothing Then
                'das Folgende darf nur Einmal und zwar nur beim Erstenmal erfolgen:
                s = DataWorkspace.ApplicationData.GTComSettings.AddNew
            End If
            'jetzt das zuletzt bearbeitete Projekt aufrufen
            If gtb.CurProjektId.HasValue Then
                '_duringStart = True
                Me.Projekte.SelectedItem = Me.DataWorkspace.ApplicationData.Projekte_Single(gtb.CurProjektId)
            End If
            If gtb.CurBaustelleId.HasValue Then
                Me.Baustellen.SelectedItem = Me.DataWorkspace.ApplicationData.Baustellen_Single(gtb.CurBaustelleId)
            End If
            If s.LogLogins Then
                Dim dws As DataWorkspace = Application.CreateDataWorkspace
                Dim ll As GTCLoggedLogin = dws.ApplicationData.GTCLoggedLogins.AddNew()
                'End If
            End If
            _duringStart = False 'wird in InitializeDataworkspace auf true gesetzt
        End Sub
        Private Function CreateNewUser() As GTCBenutzer
            Dim gtb As GTCBenutzer
            gtb = Me.DataWorkspace.ApplicationData.GTCBenutzers.AddNew
            gtb.Name = Me.Application.User.FullName
            gtb.UserName = Me.Application.User.Name
            gtb.AlarmEmailadresse = "new@user.com"
            gtb.AlarmTelefonnummer = "-"
            Return gtb
        End Function
        Private Sub Projekte_SelectionChanged()
            If _duringStart Then Exit Sub
            Dim dws As DataWorkspace : dws = Me.Application.CreateDataWorkspace
            Dim gtb As GTCBenutzer = dws.ApplicationData.CurGTCBenutzer : If gtb Is Nothing Then Exit Sub
            Dim prj As Projekt = Me.Projekte.SelectedItem : If prj Is Nothing Then Exit Sub
            If (Not gtb.CurProjektId.HasValue) Or (gtb.CurProjektId <> prj.Id) Then
                gtb.CurProjektId = prj.Id
            End If
        End Sub
        Private Sub Baustellen_SelectionChanged()
            If _duringStart Then Exit Sub
            Dim dws As DataWorkspace : dws = Me.Application.CreateDataWorkspace
            Dim gtb As GTCBenutzer = dws.ApplicationData.CurGTCBenutzer : If gtb Is Nothing Then Exit Sub
            Dim bst As Baustelle = Me.Baustellen.SelectedItem : If bst Is Nothing Then Exit Sub
            If (Not gtb.CurBaustelleId.HasValue) Or (gtb.CurBaustelleId <> bst.Id) Then
                gtb.CurBaustelleId = bst.Id
            End If
        End Sub
        Private Sub BaustellenAddAndEditNew_Execute()
            ' Erstellen Sie hier Ihren Code.
        End Sub
        Private Sub ProjekteListe_Activated()
            ' Erstellen Sie hier Ihren Code.
        End Sub
    End Class

    thanks for your help.

    Monday, September 23, 2013 9:43 AM
  • If I start Visual Studio and I open my LS-Project,

    I get two warnings from the Client project:

    The referenced component "AlertMarker" was not found

    The referenced component "CustomLightswitchControls_MF" was not found

    I Switch to "File View", I expand "Client" "References" I simply click on the desired reference and the warning disappears.

    I totally do not understrand this behaviour, why does it even appear and where does it come from?

    I click the save all-button, I close Visual Studio, I start Visual Studio again, I open my project and the warning appears again, how to resolve this?
    • Edited by OlimilO Monday, September 23, 2013 10:27 AM
    Monday, September 23, 2013 10:23 AM
  • Thanks for the details.  I tried a similar scenario where I created a LightSwitch project, added a Reference to a Custom Control, published and launched the app.  It worked fine.

    About the warning (yellow triangle), VB project system does a forced refresh on selection. This removes the warning as you noticed.  I think that is expected and may not be related to the runtime error.

    Let us try to investigate the runtime error.  Please could you set the following debug options:

    1. Turn on all exceptions
    2. Turn off Just My Code

    and start runtime (F5).  This will helps us identify any initialization error that is happening in the client.

    If that does not work then you can get trace info from the published app.  You can do this as follows:

    1. Enable trace in Web.config (please see)
    2. Locate the port number for the running desktop application (please see)

    Hopefully we can find something useful in the trace.

    Monday, September 23, 2013 7:42 PM