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. remoting : object reference not set to an instance of an object ???

remoting : object reference not set to an instance of an object ???

Scheduled Pinned Locked Moved C#
question
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.
  • Y Offline
    Y Offline
    youssef
    wrote on last edited by
    #1

    I create a client remoting. I set a method with the frontcontroller from a client. When I executing the method this message appear : "object reference not set to an instance of an object " Best regards youssef

    H 1 Reply Last reply
    0
    • Y youssef

      I create a client remoting. I set a method with the frontcontroller from a client. When I executing the method this message appear : "object reference not set to an instance of an object " Best regards youssef

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      That means you're trying to invoke a member on a null reference. This could be practically any problem, like not setting a variable to an instance of a class, the remote instance is not being created and proxied to your client, and the list goes on and on. The best way to find the problem is to debug your code and find where the NullReferenceException occurs.

      Microsoft MVP, Visual C# My Articles

      Y 1 Reply Last reply
      0
      • H Heath Stewart

        That means you're trying to invoke a member on a null reference. This could be practically any problem, like not setting a variable to an instance of a class, the remote instance is not being created and proxied to your client, and the list goes on and on. The best way to find the problem is to debug your code and find where the NullReferenceException occurs.

        Microsoft MVP, Visual C# My Articles

        Y Offline
        Y Offline
        youssef
        wrote on last edited by
        #3

        I put some breakpoint. But when I run in debug mode, an error occur the file.config doesn't exist. Can you help me how can I do for execute the software in debug mode in remoting Best regards youssef

        H 1 Reply Last reply
        0
        • Y youssef

          I put some breakpoint. But when I run in debug mode, an error occur the file.config doesn't exist. Can you help me how can I do for execute the software in debug mode in remoting Best regards youssef

          H Offline
          H Offline
          Heath Stewart
          wrote on last edited by
          #4

          If you're file doesn't exist, then either you hap-hazardly hard-coded the file path (never a good idea) or it doesn't exist in the directory you think it should. Typically, in .NET Remoting you just use the application's .config file (in the same directory as the application with the same name + .config appended, like an app called MyApp.exe would have a file called MyApp.exe.config in the same directory) and then you'd call RemotingConfiguration.Configure passing the AppDomain.CurrentDomain.SetupInformation.ConfigurationFile so that you can keep everything in the same .config file. This is true for both the client and server. If you don't want to do it this way, then you need to code your app so that it can find the file no matter where it is, like using Application.StartupPath in the client application to use the directory where the .exe is located, and then use Path.Combine to combine that with file.config using the platform-dependent directory separator character. To debug your application, just click the Debug->Start menu. There is more information in the Visual Studio help.

          Microsoft MVP, Visual C# My Articles

          Y 1 Reply Last reply
          0
          • H Heath Stewart

            If you're file doesn't exist, then either you hap-hazardly hard-coded the file path (never a good idea) or it doesn't exist in the directory you think it should. Typically, in .NET Remoting you just use the application's .config file (in the same directory as the application with the same name + .config appended, like an app called MyApp.exe would have a file called MyApp.exe.config in the same directory) and then you'd call RemotingConfiguration.Configure passing the AppDomain.CurrentDomain.SetupInformation.ConfigurationFile so that you can keep everything in the same .config file. This is true for both the client and server. If you don't want to do it this way, then you need to code your app so that it can find the file no matter where it is, like using Application.StartupPath in the client application to use the directory where the .exe is located, and then use Path.Combine to combine that with file.config using the platform-dependent directory separator character. To debug your application, just click the Debug->Start menu. There is more information in the Visual Studio help.

            Microsoft MVP, Visual C# My Articles

            Y Offline
            Y Offline
            youssef
            wrote on last edited by
            #5

            ok thanks a lot. The error is a nullexecption in my client. Now all are working. Best Regards youssef

            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