Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7563651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:43:05+00:00 2026-05-30T13:43:05+00:00

I have code in a .dll that a game in unity3d uses to connect

  • 0

I have code in a .dll that a game in unity3d uses to connect to the server. and for some reason when the code in unity3d uses the code in the .dll it says object refernce no set to an instance of an object. Why is it throwing this error? im declaring everything before using it.

Edit* The reason im posting this is i cant find anything that would be causing this error nothing is null so please help and not complain iv tried searching but i cant find anything that shows what would be throwing the error.

code in .dll

    public void Start(string IP,int Port)
    {

        try
        {
            keyHandeler.create();
            TcpClient socket = new TcpClient();
            socket.Connect(IP, Port);
            st = socket.GetStream();
            Connection(true);
        }
        catch { Connection(false); }
    }

code in unity3d

    Client server = new Client();
    void Start () 
    {
         server.Start(IP, Port); // throws the object reference not set to an instance of an object
         // other stuff after this but it never reaches them
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T13:43:06+00:00Added an answer on May 30, 2026 at 1:43 pm

    set breakpoint on server.Start(IP, Port); and see if Server is null or not.

    If its not null the Something is happening at keyHandeler.create(); or socket.Connect(IP, Port);.

    Do you have access to DLL code? if yes they try to debug it by setting the break points and see if any object is null.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an external DLL that returns an AnsiString. I have set my code
I have a bit of code for a dll that is needed by two
I have a DLL that's compiled, and I don't have the source code for
I have a .NET assembly DLL that is created on-the-fly from pre-compiled code in
I have a program that simulates mouse click. Code is something like this: [DllImport(user32.dll,
I have a one-function DLL that exports GetHash(). However, the source code for this
Background I have a BLL DLL that uses NHibernate. I share the same BLL
I'm having some problems with concurrency when using DLLImport, I have a Dll that
I have a DLL that I don't have source code to, but I want
I have code that reads the Windows Event Log. It uses OpenEventLog, ReadEventLog and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.