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. Visual Basic
  4. Dot Net Remoting

Dot Net Remoting

Scheduled Pinned Locked Moved Visual Basic
securityhelpcsharpsysadmin
12 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.
  • P Offline
    P Offline
    PJ_12345
    wrote on last edited by
    #1

    Hi I have a VB.Net 2005 Remoting Project. A service that is exposing the dot net remoting object on the server and a windows application as a client. But when I run the client form any pc I get the following error "A remote side security requirement was not fulfilled during authentication. Try increasing the ProtectionLevel and/or Impersonationlevel." If any one can help Thanks in Advance :confused:

    D 1 Reply Last reply
    0
    • P PJ_12345

      Hi I have a VB.Net 2005 Remoting Project. A service that is exposing the dot net remoting object on the server and a windows application as a client. But when I run the client form any pc I get the following error "A remote side security requirement was not fulfilled during authentication. Try increasing the ProtectionLevel and/or Impersonationlevel." If any one can help Thanks in Advance :confused:

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Is the server object exposed in a service? Is the service running?? Is the server running on a seperate machine from your client?? What account is it running under?? Are both machines in the same domain or they in a workgroup configuration?? Is the server running on Windows XP?? If so, does this machine have simple file sharing turned OFF??

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      P 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Is the server object exposed in a service? Is the service running?? Is the server running on a seperate machine from your client?? What account is it running under?? Are both machines in the same domain or they in a workgroup configuration?? Is the server running on Windows XP?? If so, does this machine have simple file sharing turned OFF??

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

        P Offline
        P Offline
        PJ_12345
        wrote on last edited by
        #3

        Hi Dave The Service is running,one can access the port and Ip form another machine using telnet. The service is running on a seprate machine to the client. The Machines are on the same network so in other words they are connecting directly to each other. Simple file Sharing is turned off on the client and on the server. Thanks in Advance :confused:

        D 1 Reply Last reply
        0
        • P PJ_12345

          Hi Dave The Service is running,one can access the port and Ip form another machine using telnet. The service is running on a seprate machine to the client. The Machines are on the same network so in other words they are connecting directly to each other. Simple file Sharing is turned off on the client and on the server. Thanks in Advance :confused:

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Are the machines in a domain enivronment or workgroup?? What user account in the service running under?? What user account is client code running under??

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007

          P 4 Replies Last reply
          0
          • D Dave Kreskowiak

            Are the machines in a domain enivronment or workgroup?? What user account in the service running under?? What user account is client code running under??

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007

            P Offline
            P Offline
            PJ_12345
            wrote on last edited by
            #5

            The Client and the server Service is both running on the administrator account. The network setup is a work group.

            1 Reply Last reply
            0
            • D Dave Kreskowiak

              Are the machines in a domain enivronment or workgroup?? What user account in the service running under?? What user account is client code running under??

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007

              P Offline
              P Offline
              PJ_12345
              wrote on last edited by
              #6

              Hi Dave I have played around with the TcpChannel Properties but the problem I am running into now is the following error: The server has rejected the client credentials. Thanks in advance

              D 1 Reply Last reply
              0
              • D Dave Kreskowiak

                Are the machines in a domain enivronment or workgroup?? What user account in the service running under?? What user account is client code running under??

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007

                P Offline
                P Offline
                PJ_12345
                wrote on last edited by
                #7

                Hi Dave Sorry about all the questions But if the remoting server is sitting on a domain and the client pc wants to connect through the internet is it possible. Tanks in advance :(

                1 Reply Last reply
                0
                • D Dave Kreskowiak

                  Are the machines in a domain enivronment or workgroup?? What user account in the service running under?? What user account is client code running under??

                  A guide to posting questions on CodeProject[^]
                  Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                       2006, 2007

                  P Offline
                  P Offline
                  PJ_12345
                  wrote on last edited by
                  #8

                  Hi Dave Can one get dot net remoting to work on a workgroup and a domain with out changing the code. Thanks in advance

                  1 Reply Last reply
                  0
                  • P PJ_12345

                    Hi Dave I have played around with the TcpChannel Properties but the problem I am running into now is the following error: The server has rejected the client credentials. Thanks in advance

                    D Offline
                    D Offline
                    Dave Kreskowiak
                    wrote on last edited by
                    #9

                    Under remoting, the code on the server instantiates an object using the context of the CLIENT, not the server. Your user account that your logged in under on the client machine becomes part of your context. This context is a security boundry. In a workgroup environment, the account you're using on the client, even though it has the exact same name, is different from the account on the server. Each machine maintains it's own list of user accounts and does not trust the accounts of another machine. In a domain, the machines in it all trust the same list of user accounts. So, in your setup, the Administrator account on your client workstation is NOT trusted by the server instantiating your remote object, thus the object can't be created. The server tries to create the object using the clients account and gets denied because the client account has no permission on the server. So, what does the remoting config in your app.config files look like, both server AND client?? Remember to check the little box that says "Ignore HTML tags..." before you click "Post Message".

                    A guide to posting questions on CodeProject[^]
                    Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                         2006, 2007

                    P 1 Reply Last reply
                    0
                    • D Dave Kreskowiak

                      Under remoting, the code on the server instantiates an object using the context of the CLIENT, not the server. Your user account that your logged in under on the client machine becomes part of your context. This context is a security boundry. In a workgroup environment, the account you're using on the client, even though it has the exact same name, is different from the account on the server. Each machine maintains it's own list of user accounts and does not trust the accounts of another machine. In a domain, the machines in it all trust the same list of user accounts. So, in your setup, the Administrator account on your client workstation is NOT trusted by the server instantiating your remote object, thus the object can't be created. The server tries to create the object using the clients account and gets denied because the client account has no permission on the server. So, what does the remoting config in your app.config files look like, both server AND client?? Remember to check the little box that says "Ignore HTML tags..." before you click "Post Message".

                      A guide to posting questions on CodeProject[^]
                      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                           2006, 2007

                      P Offline
                      P Offline
                      PJ_12345
                      wrote on last edited by
                      #10

                      Hi Dave The system I am working on doesn't use a configuration file But here is the code ================================================================ Server : This code is run onstart of the service ================================================================ Protected Overrides Sub OnStart(ByVal args() As String) ' Add code here to start your service. This method should set things ' in motion so your service can do its work. RemotingConfiguration.ApplicationName = "Indicium" Dim ChannelProps As New Dictionary(Of String, Object) ChannelProps.Add("port", "50000") ChannelProps.Add("secure", "false") ChannelProps.Add("name", "Server") Dim cProv As New BinaryClientFormatterSinkProvider Dim sProv As New BinaryServerFormatterSinkProvider sProv.TypeFilterLevel = Runtime.Serialization.Formatters.TypeFilterLevel.Full Dim myChannel As New TcpChannel(ChannelProps, cProv, sProv) ChannelServices.RegisterChannel(myChannel, True) RemotingConfiguration.RegisterWellKnownServiceType(GetType(RemotingGateway), _ "Indicium", WellKnownObjectMode.SingleCall) RemotingConfiguration.RegisterWellKnownServiceType(GetType(KVGenerator), _ "KVGenerator", WellKnownObjectMode.SingleCall) RemotingConfiguration.RegisterWellKnownServiceType(GetType(Importers.BankImporter.Gateway), _ "BankImporter", WellKnownObjectMode.SingleCall) RemotingConfiguration.RegisterWellKnownServiceType(GetType(Stats.clsGateway), _ "Stats", WellKnownObjectMode.SingleCall) RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.RemoteOnly SSIDataInterface.ClientPlug.Init("", "", "") End Sub ====================================================================== Client ====================================================================== Dim serverIP As String = _MyConfig.serverIP Dim serverPort As String = _MyConfig.serverPort _serverAddress = "tcp://" & serverIP & ":" & serverPort Dim serverURI As String = _serverAddress & "/Indicium" ' Create a connection to the Indicium Server... Dim ChannelProps As New Dictionary(Of String, Object) ChannelProps.Add("name", "Client") ChannelProps.Add("port", serverPort) ChannelProps.Add("secure", "false") ChannelProps.Add("username", "Petrus") ChannelProps.Add("pas

                      D 1 Reply Last reply
                      0
                      • P PJ_12345

                        Hi Dave The system I am working on doesn't use a configuration file But here is the code ================================================================ Server : This code is run onstart of the service ================================================================ Protected Overrides Sub OnStart(ByVal args() As String) ' Add code here to start your service. This method should set things ' in motion so your service can do its work. RemotingConfiguration.ApplicationName = "Indicium" Dim ChannelProps As New Dictionary(Of String, Object) ChannelProps.Add("port", "50000") ChannelProps.Add("secure", "false") ChannelProps.Add("name", "Server") Dim cProv As New BinaryClientFormatterSinkProvider Dim sProv As New BinaryServerFormatterSinkProvider sProv.TypeFilterLevel = Runtime.Serialization.Formatters.TypeFilterLevel.Full Dim myChannel As New TcpChannel(ChannelProps, cProv, sProv) ChannelServices.RegisterChannel(myChannel, True) RemotingConfiguration.RegisterWellKnownServiceType(GetType(RemotingGateway), _ "Indicium", WellKnownObjectMode.SingleCall) RemotingConfiguration.RegisterWellKnownServiceType(GetType(KVGenerator), _ "KVGenerator", WellKnownObjectMode.SingleCall) RemotingConfiguration.RegisterWellKnownServiceType(GetType(Importers.BankImporter.Gateway), _ "BankImporter", WellKnownObjectMode.SingleCall) RemotingConfiguration.RegisterWellKnownServiceType(GetType(Stats.clsGateway), _ "Stats", WellKnownObjectMode.SingleCall) RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.RemoteOnly SSIDataInterface.ClientPlug.Init("", "", "") End Sub ====================================================================== Client ====================================================================== Dim serverIP As String = _MyConfig.serverIP Dim serverPort As String = _MyConfig.serverPort _serverAddress = "tcp://" & serverIP & ":" & serverPort Dim serverURI As String = _serverAddress & "/Indicium" ' Create a connection to the Indicium Server... Dim ChannelProps As New Dictionary(Of String, Object) ChannelProps.Add("name", "Client") ChannelProps.Add("port", serverPort) ChannelProps.Add("secure", "false") ChannelProps.Add("username", "Petrus") ChannelProps.Add("pas

                        D Offline
                        D Offline
                        Dave Kreskowiak
                        wrote on last edited by
                        #11

                        I always use a config file for remoting. It saves having to make changes, compile, and reploy if something has to change. In your ChannelProps dictionary, you're specifying the port and secure properties as strings. Remove the quotes and let them be the types they actually are.

                        Dim props As New HashTable()
                        props("port") = 50000
                        props("secure") = False
                        

                        You can get rid of the username and password properties. They're not valid properties for a server-side TcpChannel. You can also get rid of the MsgBox in your OnStart code when you call RegisterChannel. You'll never see it if it does pop up. Replace this with either writing to your own log file or one of the Event Logs.

                        A guide to posting questions on CodeProject[^]
                        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                             2006, 2007

                        P 1 Reply Last reply
                        0
                        • D Dave Kreskowiak

                          I always use a config file for remoting. It saves having to make changes, compile, and reploy if something has to change. In your ChannelProps dictionary, you're specifying the port and secure properties as strings. Remove the quotes and let them be the types they actually are.

                          Dim props As New HashTable()
                          props("port") = 50000
                          props("secure") = False
                          

                          You can get rid of the username and password properties. They're not valid properties for a server-side TcpChannel. You can also get rid of the MsgBox in your OnStart code when you call RegisterChannel. You'll never see it if it does pop up. Replace this with either writing to your own log file or one of the Event Logs.

                          A guide to posting questions on CodeProject[^]
                          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                               2006, 2007

                          P Offline
                          P Offline
                          PJ_12345
                          wrote on last edited by
                          #12

                          Dear Dave The error I am Exsperiancing now is No Connection could be made becase the target machine actively refused it Is this type of setup possible for WorkGroup And if so what needs to be changed on the configuration for this to work. Thanks in advance :confused:

                          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