Trace line exception Lightswitch app C#

Hi,
I am developping a web lightswitch application using C#. I am trying in the production environment to trace the line of code where an exception is fired. Nothing has worked for me. Can anyone help ?
Thanks 

HI firsni,
If you want to get line number from Exception using C#, you can refer to code snippet below.
try
throw new Exception();
catch (Exception ex)
// Get stack trace for the exception with source file information
var st = new StackTrace(ex, true);
// Get the top stack frame
var frame = st.GetFrame(0);
// Get the line number from the stack frame
var line = frame.GetFileLineNumber();
Hope it helps.
Best regards,
Angie
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Force code execute when user closes OOB lightswitch app using the windows close red X

    I've created a lightswitch app using Forms Authentication.  If the user closes the application using the window close red 'X', I need to update a custom user profile table.  Is this possible?

    I use this code and it works!
    I handle the closing event of the user and I break it, execute my code ed after closing the application.
    Under you see the code that I use in my application.vb :
    Public Class Uscita
    ' Dichiara un evento per la classe
    Public Event Event1()
    ' Definisce un metodo per richiamare l'evento
    Sub CausaEvento()
    RaiseEvent Event1()
    End Sub
    End Class
    Protected Sub EsceAPP()
    Dim Obj As New Uscita
    AddHandler Obj.Event1, AddressOf Me.EventoUscita
    ' Provoca l'esecuzione dell'evento
    Obj.CausaEvento()
    End Sub
    Sub Eventouscita()
    Dispatchers.Main.BeginInvoke(Sub()
    RemoveHandler _mainWindowClose.Closing, AddressOf MainWindow_Closing
    System.Windows.Application.Current.MainWindow.Close()
    End Sub)
    End Sub
    Private Sub Application_loggedin()
    Try
    Dispatchers.Main.BeginInvoke(Sub()
    _mainWindowClose = System.Windows.Application.Current.MainWindow
    AddHandler _mainWindowClose.Closing, AddressOf MainWindow_Closing
    End Sub)
    Catch ex As Exception
    MessageBox.Show(ex.Message)
    End Try
    End Sub
    Private Sub MainWindow_Closing(ByVal sender As Object, ByVal e As ClosingEventArgs)
    If MessageBox.Show("Vuoi Veramente uscire?", "Conferma", MessageBoxOption.OkCancel) = Windows.MessageBoxResult.Cancel Then
    'Elimina l'uscita utente
    e.Cancel = True
    Else
    'Interrompe momentaneamente l'uscita dell'utente per eseguire l'aggiornamento della tabella utenti loggati
    e.Cancel = True
    'Aggiorna la tabella utenti loggati ed esce dall'applicativo
    Me.Details.Dispatcher.BeginInvoke(Sub()
    Dim ws = CreateDataWorkspace()
    Dim query = ws.ApplicationData.UtentiLoggatis.Where(Function(c) c.UserName = Me.User.FullName).FirstOrDefault
    query.OnLineImage = MyImageHelper.GetImageByName("RedLight.png")
    query.OnLIne = "OFF"
    query.Logout = Now
    ws.ApplicationData.SaveChanges()
    'Chiama la routine per uscire dall'applicazione
    EsceAPP()
    End Sub)
    End If
    End Sub

  • While updating my iphone 4s to ios6, I had to restore it. Now every time I connect to itunes, I get the "Set Up Your iPhone" window with the set up as new iphone and restore from backup options. After the restore, I got everything except my apps back.

    While updating my iphone 4s to ios6, I had to restore it. Now every time I connect to itunes, I get the "Set Up Your iPhone" window with the set up as new iphone and restore from backup options. After the restore, I got everything except my apps and music back. Do I need to set the phone up as new again?

    Hi Vidbrent,
    If you are having issues updating or restoring your iPhone, you may find the following article helpful:
    Apple Support: If you can't update or restore your iOS device
    http://support.apple.com/kb/ht1808
    Regards,
    - Brenden

  • Hello everyone, Very recently itunes on my windows computer does not let me access any items in my Library except for "Apps" and "Ringtones". When I click on any other items it flashes the redcircle meaning forbidden".

    Hello everyone, Very recently itunes on my windows computer does not let me access any items in my Library except for "Apps" and "Ringtones". When I click on any other items it flashes the redcircle meaning forbidden".
    When I connect my iPhone or iPad I can see every items on them but not on the iTunes Library.
    They sync fine with iTunes.
    I browse all the menus in iTunes but cannot find any clues to what I have done for it to happen. It worked fine previously.
    Thanks for any suggestion.

    You should really read the manual.
    "How do you restore from backup? "
    Restore.  When given the choice, choose to use backup.
    "And how can I check to see if the pics and videos are on my computer somewhere first??"
    They would only be where you put them.  What program did you use to import them?  Pics/vids taken with ipod are not part of the sync process at all.  You should be importing them just as you would with any digital camera.
    If you did not import them, then they are not on your computer.

  • How to restrict separate payment document for each line item in APP

    HI Experts
    PLs let me know how to restrict separate payment document for each line item in APP
    Thanks
    Sneha
    Edited by: Sneha R on Apr 14, 2009 4:18 PM

    Sneha,
    If your query was to group items for payment ,in FBZP  co code data for payment method there are 2 options 1.group payment for marked items 2.payment per due date.
    Also in the Vendor master there is a flag which will ensure that each item is paid individually,if this is what you were looking for  ( FK02 change vendor).
    In case you want to group items to be paid together Payment Grouping Key can be assigned in Vendor Master .
    Shony

  • I have a new 27 inch i Mac which works well except the App store app will not open, and when it is attempting to, my network crashes. What do I need to do? Mark

    I have a new 27 inch i Mac which works well, except the App store app will not open, and when it is attempting to, my network crashes. What do I need to do? Mark

    Hi,
    Bootup holding CMD+r, or the Option/alt key to boot from the Restore partition & use Disk Utility from there to Repair the Disk, then Repair Permissions.
    If after reboot that doesn't help...
    Open Console in Applications>Utilities & see if there are any clues or repeating messages when this happens.

  • To trace the exceptions.

    i want trace the exceptions like invalid cursor state exception instead of sql exception.how to ?is there any numberings.

    If I understand the question....
    "invalid cursor state" comes from outside of java. There is no implicit way to get a trace. For certain external sources to jdbc there are ways to trace results there. For example in ODBC there is a trace log.

  • TS1702 How do I change the Apple ID in an installed APP?  I have changed the apple ID in all the other apps due to security reasons. All changes were effective except the APPS ID.Where do I go to change the Apple ID?

    How do I change the Apple ID in an installed APP?  I have changed the apple ID in all the other apps due to security reasons. All changes were effective except the APPS ID.Where do I go to change the Apple ID for the APPS store?  Thanks in advance.

    You do not.  Apps and any content purchased from the iTunes store are eternally tied to the Apple ID they were purchased with.

  • Exception HR 0x00000560 /HR eip 000000013F873112 /eip module d:\office\source\search\libs\utild\localgroupscache.cxx /module line 50 /line /Exception

    I've got an issue on our Microsoft Search Server 2010. When crawls have completed, there are some but not all the correct results. I've triple checked the NTFS
    permissions and they seem correct/solid.
    Rather than
    continuing to work on our production server, I've now installed a new VM specifically installed with SQL and MSS 2010 (With all patches, etc.). I've targeted a specific folder (with subfolders) that I managed to identify, but the same error persists
    with the new server
    The only error that I can find in the logs is : <Exception><HR>0x00000560</HR><eip>000000013F873112</eip><module>d:\office\source\search\libs\utild\localgroupscache.cxx</module><line>50</line></Exception>
    The error seems to repeat the same number of times as the quantity of files in the folders.
    . Our AD functional level is set to "Windows Server 2008" -> which I'm now upgrading to R2
    . All services are configured to use the Domain\Administrator account (I know this is wrong, but is just for testing)
    . I've added the account to "Pre-Windows 2000 Compatible Access" and "Windows Authorizatrion Access" groups
    . Added GPO to change "User Configuration\Administrative Templates\Windows Components\Attachment Manager"
    to "low"
    Any help would be very useful!

    Error seems to be specific to
    0x00000560, The specified local group does not exist.
    http://www.symantec.com/business/support/index?page=content&id=TECH12638
    Is the sharepoint account present in local admin wss_wpg, etc groups on sharepoint server.
    Try disable firewall and antivirus

  • I can't sign into iClouds, iMessages and other apple utilities except mac app store.

    I can't sign into any apple utilities except mac app store. I guess it is happening as i have a very poor internet connection. Please Help

    What is the full text of the message that you are getting ?
    Messages about countries usually refer to the country that you have on your iTunes account. You have your correct billing address on your account, and you are in that country ? If you can't log into your account directly on your phone to view/correct your address details (e.g. via Settings > iTunes & App Store), then can you do it via the Store > View Account menu option on your computer's iTunes or via http://appleid.apple.com ?

  • I updated to iOS 7 but now that I am using my iphone, all my apps are gone. everything else has been recovered from i could except my apps. I have my apps backed up but i cant get them restored.

    I updated to iOS 7 but now that I am using my iphone, all my apps are gone. everything else has been recovered from i could except my apps. I have my apps backed up but i cant get them restored.

    Right click on the .exe file and select run as admin. This will allow it to run all the processes it needs and should help it work. If the problem is not fixed you should try waiting till a new update, that often fixes ios issues.
    On other problem could be a hardware issue, try a new cable and use it in a different USB socket.

  • How to get errors and/or air.trace() from installed air app?

    I'm trying to debug an installed air app that behaves
    differently once installed than when run with adl. However, i can't
    figure out any way to get errors or air.trace() information. I am
    on OS X (10.5.6). Any tips?
    I imagine this should be easy since debugging an installed
    app is pretty much a necessity for development.

    You can enable logging to a text file using settings in the
    mm.cfg file. See
    http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_19323
    Note that ALL trace output will go to the log.
    Other things you can do are:
    1. Run the installed app with adl -- just pass the installed
    app descriptor to adl on the command line
    2. Supply a publisher id to adl. This removes one difference
    between installed/ not installed apps and may be enough if the
    behavior issue has to do with local connections or other matters
    involving the publisher id.
    3. Use the adl -nodebug flag. This removes another difference
    between installed/uninstalled apps. You won't see uncaught
    exceptions, but trace statements are still reported.

  • Unclear Deployment Exception in App Server PE 9

    Hello,
    try to deploy a J2EE application EDMProjectEAR in Sun App Server PE9 with Netbeans 5.5 The application uses entity and session beans and JSF components. No JMS at all. The deployment process fails mention that some queue is not set correctly (according to my knowledge). The whole stack trace of deployment exception below. Any hints what can be the reason? Is that really related to JMS components?
    Any support would be great.
    Thanks!
    Best regards, Maik
    com.sun.enterprise.deployment.backend.IASDeploymentException: Error loading deployment descriptors for module [EDMProjectEAR] -- This ejb has no message destination refernce by the name queue
         at com.sun.enterprise.deployment.backend.Deployer.loadDescriptors(Deployer.java:362)
         at com.sun.enterprise.deployment.backend.AppDeployerBase.loadDescriptors(AppDeployerBase.java:327)
         at com.sun.enterprise.deployment.backend.AppDeployer.explodeArchive(AppDeployer.java:332)
         at com.sun.enterprise.deployment.backend.AppDeployer.deploy(AppDeployer.java:182)
         at com.sun.enterprise.deployment.backend.AppDeployer.doRequestFinish(AppDeployer.java:129)
         at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:169)
         at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:95)
         at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:871)
         at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:266)
         at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:739)
         at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:174)
         at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:210)
    Caused by: java.lang.IllegalArgumentException: This ejb has no message destination refernce by the name queue
         at com.sun.enterprise.deployment.WebBundleDescriptor.getMessageDestinationReferenceByName(WebBundleDescriptor.java:796)
         at com.sun.enterprise.deployment.node.runtime.MessageDestinationRefNode.setElementValue(MessageDestinationRefNode.java:86)
         at com.sun.enterprise.deployment.node.SaxParserHandler.endElement(SaxParserHandler.java:408)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:633)
         at com.sun.org.apache.xerces.internal.impl.dtd.XMLNSDTDValidator.endNamespaceScope(XMLNSDTDValidator.java:260)
         at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:2059)
         at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:932)
         at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:719)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
         at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
         at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
         at com.sun.enterprise.deployment.io.DeploymentDescriptorFile.read(DeploymentDescriptorFile.java:279)
         at com.sun.enterprise.deployment.archivist.Archivist.readRuntimeDeploymentDescriptor(Archivist.java:514)
         at com.sun.enterprise.deployment.archivist.ApplicationArchivist.readRuntimeDeploymentDescriptor(ApplicationArchivist.java:387)
         at com.sun.enterprise.deployment.backend.Deployer.loadDescriptors(Deployer.java:320)
         ... 11 more

    Maik,
    If this is still a problem, could you please post the descriptors from the EAR?
    Are you using any annotations?
    - Tim

  • How to pass command-line options to app using the "open" command?

    I am using jedit, and since I'm doing a lot of stuff in a shell, I'd really like to launch it from the command line as though I'd opened from finder, so I wrote a script that contains this:
    open -a /Applications/Jedit.app "$@" &
    This works well for everything except NEW files, where I get this error:
    2007-02-16 19:29:48.072 open[1032] No such file: /Users/millerti/projects/ateon/new_file
    Is there a way I can override this?
    So, it occurred to me that I might try running jedit directly this way:
    /Applications/Jedit.app/Contents/MacOS/jedit -- "$@" &
    The trouble is that this suffers all sorts of weird problems. For instance, if there's already a jedit running, it launches another one (despite the fact that -server is default). Moreover, the file it opens, existing or not, is not the one I specify. If I'm in ~/mydir and I open ./myfile, jedit opens instead /Applications/myfile.
    Obviously, I'm doing something wrong. Can someone help me figure out what open is doing internally so that I can launch jedit compatible with how open does it so that I can both open existing files and create new ones the same way from the command line?
    BTW, I can make more complex script.
    Also, if this isn't the right forum for this, can someone tell me where would be a better place to get the question answered?
    And I'm not expecting to get jedit support here. This isn't a jedit problem because it's behaving correctly.
    Thanks.

    Applications rarely take command line arguments. I don't know anything about Jedit, whether that is an exception, but you are not sending an argument to Jedit with the open command. The file name on your command line is an argument to the open command. The open command says "open this file with the specified application". The application doesn't see the argument. It sees the file exactly as if it were opened from the Finder. That's why naming a non-existent file doesn't work.
    What if you open Jedit with no file, create a new document in the application. (Again, I am not familiar with Jedit.)

  • Capturing trace of exception

    Suppose following stored procedure:
    PROCEDURE TEST_PRC
    IS
    BEGIN
    RAISE VALUE_ERROR;
    END;
    If I call this procedure in Sql*Plus, I get:
    BEGIN test_prc; END;
    ERROR in line 1:
    .ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at "SCH_PERSONEN.TEST_PRC", line 4
    ORA-06512: at line 1
    I can see exactly on which line the exception was raised: line 4.
    I can see this linenumber also in Sql*Navigator or in de stacktrace of the SqlException in a Java-program.
    But how can I catch this information to store in a logtable ?
    When I change the stored procedure as follows, I get only the number of the line where format_call_stack is called.
    But I want the number of the line where the exception is raised !!!
    PROCEDURE TEST_PRC
    IS
    BEGIN
    RAISE VALUE_ERROR;
    EXCEPTION
    WHEN VALUE_ERROR THEN
    DBMS_OUTPUT.put_line(SUBSTR(DBMS_UTILITY.format_error_stack || DBMS_UTILITY.format_call_stack, 1, 255));
    END;
    The output in Sql*Plus is:
    ORA-06502: PL/SQL: numeric or value error
    ----- PL/SQL Call Stack -----
    object line object
    handle number name
    2ae87f14 7 procedure SCH_PERSONEN.TEST_PRC
    291f19b4 1 anonymous block

    Start at the top and work your way back. If the error was in a class you did not write, read thru the trace until you get to the class you wrote and figure out what might be wrong there that could have caused the problem. Other than that, Norweed is right in saying it is a case by case basis.

Maybe you are looking for

  • Cannot upgrade to snow leopard

    I have a late 2007 iMac (2GHz core 2 Duo). Since I purchased it, it has run Tiger, then Leopard flawlessly. I recently bought a Magic Trackpad which required me to upgrade to Snow Leopard. Unfortunately, 10.6 seems to kernel panic almost as soon as i

  • I now understand frustration - problem signing in to iTunes Store

    Hi there, After many unsuccessful attempts to sign in through Store I decided to sign up through the site - success! But... Now when I try to log in to Store, I get told that "This Apple ID has not been used with iTunes Store... Please review..." - w

  • Livecache Error in SCM5.0 - Database Instance Not Found

    Hi, I installed SCM5.0 SR2 IDES version on Windows 2003. I selected Livecache in SAP System option when installing SCM5.0. After complete installation, I executed MAxDb exe file to install the MaxDb. I get this error when I try to access LCA Monitor

  • How i can add data to the dev ?

    hello  , we have  dev / qa / prod . the problem is that the "dev" don’t have enough data and we need to pass the development to the qa for any simple test  . is it possible to insert data just to the tables without erase or make damage to the existin

  • Changing CSS dynamically

    Hi, Can I change at runtime a given definition in of a style ? In example, I have the following defined: Button     paddingTop: 1;     paddingBottom: 1;     padding-left: 1;     padding-right: 1;     fillAlphas: 0.4, 0.8, 0.2, 1.0;     fillColors: #F