need some help with null pointer exception in Xamarin

denismu321

New member
Joined
Oct 1, 2017
Messages
4
Programming Experience
3-5
Hi there ,
I just have a question concerning some program I want to write.
I cannot get it to work it always says :
"System.NullReferenceException: Object reference not set to an instance of an object."

Here is some code samples :

using System;
using System.Collections.Generic;
using Steam4NET;
using steamLogin;
using System.Text;
using System.Runtime.Serialization;

namespace steamLogin
{

class functions
{

static void Main()
{
TSteamError err = new TSteamError();
int logged=0;
ISteam003 steam = new ISteam003();
steam.IsLoggedIn(ref logged,ref err);
}
}
}

I cannot call any function without getting a null pointer exception.
Is this because some startup functions have not been called ,or are the functions essentially empty ones ?
Well I do not really understand what is wrong, so I looked for help here.

Thank you in advance.
 
Have you looked at the stack trace for the exception? What line of your code is it thrown on? Is it thrown by your code or a method called by your code? What reference is null?
 
thanks for answering so soon.
Here I get the Error message the program is throwing :

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Steam4NET.ISteam003.ChangePassword(String cszCurrentPassphrase, String cszNewPassphrase, TSteamError& pError)
at steamLogin.functions.Main() in C:\Users\muhic\OneDrive\Dokumente\Projects\steamLogin\steamLogin\testing.cs:line 36

and I cannot figure out, what value causes the null exception.
Thanks for any help in advance.

I have included the lib files in the project as well as the dll.
 
Sorry the error message I provided is not exactly the same for the program sample I showed, but it is basically the same as with all other functions I tried in Steam4NET.
 
Hi ,thanks for the help ,but I think my problem is one of Steam4NET instead of a c# problem in general.
But anyway thank you for your time.
 
Back
Top Bottom