API calls not returning

Backendless Version (3.x / 5.x, Online / Managed / Pro )

6.5.0, Online

Client SDK (REST / Android / Objective-C / Swift / JS )

.NET

Application ID

C109B652-F75A-3B69-FF44-DCE86BBE5800

Expected Behavior

Please describe the expected behavior of the issue, starting from the first action.

  1. I am going through the mission trying the different API’s. I can see in the dashboard that the API’s are executing, but I am not getting return values after the API calls are made. Is there a configuration or something I am missing?

Reproducible Test Case

        BackendlessUser user;
        
        try
        {
        
            String login = "james.bond@mi6.co.uk";
            String password = "supe3rs3cre3t";
            user = Backendless.UserService.Login(login, password);
            System.Console.WriteLine("User is logged in. ObjectId - " + user.ObjectId);
        
        }
        catch (BackendlessException exception)
        {
            Console.WriteLine("In catch");
        }

Whether this works or not, I should get something in the console, but I’m not getting anything.

Same with:
BackendlessUser newUser = new BackendlessUser();
newUser.SetProperty(“login”, “lauren”);
newUser.SetProperty(“email”, “l.r@mi6.co.uk”);
newUser.Password = “supe3rs3cre3t”;
newUser = Backendless.UserService.Register(newUser);

        System.Console.WriteLine("User registered. Assigned ID - " + newUser.ObjectId);
        Dictionary<string, object> props = newUser.Properties;

        foreach (KeyValuePair<string, object> pair in props)
            System.Console.WriteLine(String.Format("Property: {0} - {1}", pair.Key, pair.Value));

I see the new user in the database, but nothing is ever written tot he console. For the delete user mission, many coding options did not work, as there was the create user call first, but the call never returned to do the delete.

Please advise.

Hi Lauren,

Just to confirm, are you running the program as a console (command line) app?
Also, do you have the Backendless.InitApp call in your program?

Finally, what version of the Backendless SDK for .NET are you using?

Regards,
Mark

I am running the program via Visual Studio 2019. I have Backendless.InitApp(“C109B652-F75A-3B69-FF44-DCE86BBE5800”, “----”); in my App.xaml.cs file, and am successfully creating users and such. The Backendless.NET version says 6.2.0

Hello @Lauren_Robinson

try to print something to the console before Backendless logic, and make sure that you are able to see the messages


I am trying to use the file upload. It uploads the file to Backendless. I have things printed to the console before the Backendless call. But it never returns the URL after the call.
I am able to use the non-blocking .NET API for logging in successfully, but not the blocking API, which is what I really need. For registering users, neither of the .NET API’s return anything, so I resorted to the REST API.
I would prefer to use the .NET API for all calls.

Hello, @Lauren_Robinson.
I tried to reproduce your error. But everything works for me as it should.
My code for blocking and non-blocking call:

    static void Main( string[] args )
    {
      Backendless.InitApp( "MY APP ID", "MY API KEY" );

      BackendlessUser user;

      user = Backendless.UserService.Login( "hdhdhd@gmail.com", "123234", false );

      Console.WriteLine( "User is logged in: " + user.ObjectId );


      Backendless.UserService.Logout();
      var result = LoginUserAsync();
      Console.WriteLine( "Next user is logged in: " + result.Result );


      Console.ReadLine();
    }

    static async Task<String> LoginUserAsync() 
    {
      BackendlessUser user;
      user = await Backendless.UserService.LoginAsync( "nextuser@gmail.com", "123234", false );

      return user.ObjectId;
    }

Result in condole:
image

In your case, you are trying to see your output in the debug logs.
Try to output with Debug.WriteLine();

It should look like this:
image

Best Regards, Nikita.