Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to catch a security exception within Remoting.Config(...)

How to catch a security exception within Remoting.Config(...)

Scheduled Pinned Locked Moved C#
securitytutorialquestion
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • 2 Offline
    2 Offline
    2bee
    wrote on last edited by
    #1

    Hello, well, i have been checking this over and over again, but i am still unable to catch this exception: System.Security.Principal.IdentityNotMappedException. This exception is thrown when i use an incorrect authorizedGroup attribute within my application config. Surely it's right that i get an exception when i specify a group that doesn't exist but at least i should be able to catch it, shouldnt i?

    try
    {
    
      RemotingConfiguration.Configure(".\\MyApp.exe.config", false);
    
    }
    catch (Exception)
    {}
     
     
    app.config
     
    <channels>
      <channel ref="ipc" portName="MyAppPort" authorizedGroup="IIS_WPG">
        <serverProviders>
          <
    

    However i assume that i can't catch this excpetion because RemotingConfiguration is running in another (application?)context. Furthermore my application is doing fine. The only thing that bothers me is that cannot catch this exception when a nonexistent group is specified. If someone has an idea how to catch this exception, then please let me know. I would really really appreciate it. best regards Tobias :-D

    E 1 Reply Last reply
    0
    • 2 2bee

      Hello, well, i have been checking this over and over again, but i am still unable to catch this exception: System.Security.Principal.IdentityNotMappedException. This exception is thrown when i use an incorrect authorizedGroup attribute within my application config. Surely it's right that i get an exception when i specify a group that doesn't exist but at least i should be able to catch it, shouldnt i?

      try
      {
      
        RemotingConfiguration.Configure(".\\MyApp.exe.config", false);
      
      }
      catch (Exception)
      {}
       
       
      app.config
       
      <channels>
        <channel ref="ipc" portName="MyAppPort" authorizedGroup="IIS_WPG">
          <serverProviders>
            <
      

      However i assume that i can't catch this excpetion because RemotingConfiguration is running in another (application?)context. Furthermore my application is doing fine. The only thing that bothers me is that cannot catch this exception when a nonexistent group is specified. If someone has an idea how to catch this exception, then please let me know. I would really really appreciate it. best regards Tobias :-D

      E Offline
      E Offline
      Ennis Ray Lynch Jr
      wrote on last edited by
      #2

      That could reveal where the buck stops so to speak. A man said to the universe: "Sir I exist!" "However," replied the Universe, "The fact has not created in me A sense of obligation." -- Stephen Crane

      2 1 Reply Last reply
      0
      • E Ennis Ray Lynch Jr

        That could reveal where the buck stops so to speak. A man said to the universe: "Sir I exist!" "However," replied the Universe, "The fact has not created in me A sense of obligation." -- Stephen Crane

        2 Offline
        2 Offline
        2bee
        wrote on last edited by
        #3

        hi, Hmm, i did this a thousand times but it doesn't point specifically to my application! Obviously RemotingConfiguration.Configure is running in a different thread but how to catch the exception in it? e voila: Unbehandelte Ausnahme: System.Security.Principal.IdentityNotMappedException: Man che oder alle Identitätsverweise konnten nicht übersetzt werden. bei System.Security.Principal.NTAccount.Translate(IdentityReferenceCollection sourceAccounts, Type targetType, Boolean forceSuccess) bei System.Security.Principal.NTAccount.Translate(Type targetType) bei System.Runtime.Remoting.Channels.Ipc.IpcServerChannel.Listen() bei System.Threading.ThreadHelper.ThreadStart_Context(Object state) bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) bei System.Threading.ThreadHelper.ThreadStart() Further, this exception says that the system was unable to resolve the specified account. However i am fully aware of that and did intenionally use a wrong group. I just want to know how to catch this security exception that is raised by the CLR. regards Tobias

        E 1 Reply Last reply
        0
        • 2 2bee

          hi, Hmm, i did this a thousand times but it doesn't point specifically to my application! Obviously RemotingConfiguration.Configure is running in a different thread but how to catch the exception in it? e voila: Unbehandelte Ausnahme: System.Security.Principal.IdentityNotMappedException: Man che oder alle Identitätsverweise konnten nicht übersetzt werden. bei System.Security.Principal.NTAccount.Translate(IdentityReferenceCollection sourceAccounts, Type targetType, Boolean forceSuccess) bei System.Security.Principal.NTAccount.Translate(Type targetType) bei System.Runtime.Remoting.Channels.Ipc.IpcServerChannel.Listen() bei System.Threading.ThreadHelper.ThreadStart_Context(Object state) bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) bei System.Threading.ThreadHelper.ThreadStart() Further, this exception says that the system was unable to resolve the specified account. However i am fully aware of that and did intenionally use a wrong group. I just want to know how to catch this security exception that is raised by the CLR. regards Tobias

          E Offline
          E Offline
          Ennis Ray Lynch Jr
          wrote on last edited by
          #4

          I don't know if that is it or not < A man said to the universe: "Sir I exist!" "However," replied the Universe, "The fact has not created in me A sense of obligation." -- Stephen Crane

          2 1 Reply Last reply
          0
          • E Ennis Ray Lynch Jr

            I don't know if that is it or not < A man said to the universe: "Sir I exist!" "However," replied the Universe, "The fact has not created in me A sense of obligation." -- Stephen Crane

            2 Offline
            2 Offline
            2bee
            wrote on last edited by
            #5

            Ennis Ray Lynch, Jr. wrote:

            I don't know if that is it or not <

            Nope, that is quite alright. As i said, there is nothing wrong neihter with the program nor with its configuration. I just need to know how i could catch a security exception that is raised during the remoting configuration. I mean my entire application works perfect, unless i specify a group that doesn't exist. It is quite logic that the remoting configuration fails when i specify a nonexistent group but why is it impossible to catch this security exception? Anyway, thanks for your efforts. Tobias

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups