MyApplication has encountered a problem... when not Administrator!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Pieter

    MyApplication has encountered a problem... when not Administrator!

    Hi,

    Something strange is happing with my Windowf Forms application (VB.NET
    2005): The users had all local Administrator-rights on there pc. We changed
    it to the 'normal' users, and now they can't run our V.NET application
    anymore!

    The application starts (you can see the screen and caption etc), and than
    they get the well known error "MyApplicat ion has encountered a problem and
    needs to close" with the "send error report"-button etc.

    When we change their rights back to PowerUser ou Administrator, it works
    again...

    Does anybody get any idea why this happens? And how to find a solution? Do
    they need some special rights on something?
    They all have Office 2003, some of them are on W2K, others on XP (and they
    all have the problem)...

    Thanks a lot in advance,

    Pieter


  • Carlos J. Quintero [VB MVP]

    #2
    Re: MyApplication has encountered a problem... when not Administrator!

    Hi Pieter,

    Some ideas:

    - Do you have exception handlers to trap exceptions?

    - Develop and debug as a non-admin. See these resources about developing as
    non-admin :

    MZ-Tools has a single goal: To make your everyday programming life easier. As an add-in to several Integrated Development Environment (IDEs) from Microsoft, MZ-Tools adds new menus and toolbars to them that provide many new productivity features.


    --

    Best regards,

    Carlos J. Quintero

    MZ-Tools: Productivity add-ins for Visual Studio
    You can code, design and document much faster:
    MZ-Tools has a single goal: To make your everyday programming life easier. As an add-in to several Integrated Development Environment (IDEs) from Microsoft, MZ-Tools adds new menus and toolbars to them that provide many new productivity features.




    "Pieter" <pietercoucke@h otmail.com> escribió en el mensaje
    news:%23VH918hN GHA.344@TK2MSFT NGP11.phx.gbl.. .[color=blue]
    > Hi,
    >
    > Something strange is happing with my Windowf Forms application (VB.NET
    > 2005): The users had all local Administrator-rights on there pc. We
    > changed it to the 'normal' users, and now they can't run our V.NET
    > application anymore!
    >
    > The application starts (you can see the screen and caption etc), and than
    > they get the well known error "MyApplicat ion has encountered a problem and
    > needs to close" with the "send error report"-button etc.
    >
    > When we change their rights back to PowerUser ou Administrator, it works
    > again...
    >
    > Does anybody get any idea why this happens? And how to find a solution? Do
    > they need some special rights on something?
    > They all have Office 2003, some of them are on W2K, others on XP (and they
    > all have the problem)...
    >
    > Thanks a lot in advance,
    >
    > Pieter
    >
    >[/color]


    Comment

    • Pieter

      #3
      Re: MyApplication has encountered a problem... when not Administrator!

      Hi,

      I do have exception handlers, which write all the exception to a file, but
      there isn't any exception written to the file...
      Some strange thing also: I tried to see where the error happens, by writing
      every other line a small message to a file. And it never wrote one...
      like this:
      Private Sub frmMain_Load(By Val sender As Object, ByVal e As
      System.EventArg s) Handles Me.Load
      MessageSilent(" GlobalErrorHand ler")
      'error-handeler
      AddHandler System.Windows. Forms.Applicati on.ThreadExcept ion,
      AddressOf GlobalErrorHand ler

      MessageSilent(" Info.ProductNam e")
      Me.Text = My.Application. Info.ProductNam e & " - version " &
      My.Application. Info.Version.To String

      MessageSilent(" Test Connection")

      When I don't put the MessageSilent-log-writers in it, the Me.Text = .. is
      executed (because I can see it in the caption), but with the MessageSilent
      it doesn't change the caption...

      To be complete: this is the wholce MessageSilent-method:
      Public Sub MessageSilent(B yVal strMessage As String, Optional ByVal
      strCaption As String = "")
      Dim swFile As StreamWriter
      swFile = New StreamWriter(Ap plication.Start upPath & "\" &
      strErrorFile, True, System.Text.Enc oding.GetEncodi ng(1252))
      If strMessage.Leng th > 0 Then
      swFile.WriteLin e(Format(Now, "dd/MM/yyyy HH:mm:ss fffffff ") &
      "MessageSil ent: " & strCaption & " - " & strMessage)
      Else
      swFile.WriteLin e(Format(Now, "dd/MM/yyyy HH:mm:ss fffffff ") &
      "MessageSil ent: ")
      End If
      swFile.Flush()
      swFile.Close()
      End Sub



      "Carlos J. Quintero [VB MVP]" <carlosq@NOSPAM sogecable.com> wrote in message
      news:O3FFKFiNGH A.2472@TK2MSFTN GP11.phx.gbl...[color=blue]
      > Hi Pieter,
      >
      > Some ideas:
      >
      > - Do you have exception handlers to trap exceptions?
      >
      > - Develop and debug as a non-admin. See these resources about developing
      > as non-admin :
      >
      > http://www.mztools.com/resources_net...s.htm#NonAdmin
      >
      > --
      >
      > Best regards,
      >
      > Carlos J. Quintero
      >
      > MZ-Tools: Productivity add-ins for Visual Studio
      > You can code, design and document much faster:
      > http://www.mztools.com
      >[/color]


      Comment

      • johan.appelgren@gmail.com

        #4
        Re: MyApplication has encountered a problem... when not Administrator!

        Users do not have permission to write in the "c:\program files"
        directory. So if you have your application installed in the program
        files directory it will fail when you use the MessageSilent method.

        Where does your exception logger write its log file? Does your user
        have write permissions there?

        Comment

        • Pieter

          #5
          Re: MyApplication has encountered a problem... when not Administrator!

          It is indeed in the C:\Program Files\MyApplica tion\-directory...

          Where should I put such a log-file normally? are there other 'system'
          directory's in which they can't write neither? Documents and Settings?

          <johan.appelgre n@gmail.com> wrote in message
          news:1140444087 .018866.207050@ z14g2000cwz.goo glegroups.com.. .[color=blue]
          > Users do not have permission to write in the "c:\program files"
          > directory. So if you have your application installed in the program
          > files directory it will fail when you use the MessageSilent method.
          >
          > Where does your exception logger write its log file? Does your user
          > have write permissions there?
          >[/color]


          Comment

          • Pieter

            #6
            Re: MyApplication has encountered a problem... when not Administrator!

            This is the exception that is written in the eventlog (using DameWare):

            EventID: 5000
            Source: .NET Runtime 2.0 Error
            Description: EventType clr20r3, P1 ghost.exe, P2 0.0.3.8, P3 43eb40d3, P4
            mscorlib, P5 2.0.0.0, P6 4333ab80, P7 32f8, P8 15a, P9
            system.unauthor izedaccess, P10 NIL.


            Comment

            • Carlos J. Quintero [VB MVP]

              #7
              Re: MyApplication has encountered a problem... when not Administrator!

              You can write application data in folders inside C:\Document and
              settings\<user> .

              --

              Best regards,

              Carlos J. Quintero

              MZ-Tools: Productivity add-ins for Visual Studio
              You can code, design and document much faster:
              MZ-Tools has a single goal: To make your everyday programming life easier. As an add-in to several Integrated Development Environment (IDEs) from Microsoft, MZ-Tools adds new menus and toolbars to them that provide many new productivity features.



              "Pieter" <pietercoucke@h otmail.com> escribió en el mensaje
              news:e3VtkhiNGH A.3196@TK2MSFTN GP09.phx.gbl...[color=blue]
              > It is indeed in the C:\Program Files\MyApplica tion\-directory...
              >
              > Where should I put such a log-file normally? are there other 'system'
              > directory's in which they can't write neither? Documents and Settings?[/color]


              Comment

              • Pieter

                #8
                Re: MyApplication has encountered a problem... when not Administrator!

                I've tested it, and that's indeed the problem....
                Really a pitty that Microsoft doesn't throw a normal exception in such a
                case :-( It would have saved me some hours of searching.

                Thanks a lot Carlos and Johan for the help!!!

                Pieter


                Comment

                Working...