backendless 4.0 init .net sdk

Hi Mike,

Please try the build from the link below. The problem should be fixed there:
https://github.com/Backendless/.NET-SDK/tree/4.0/Backendless/Bin/NET_40/Debug

Regards,
Mark

Hi Mark,

Thanks, yes that worked!! I can now init Backendless without an exception.

But unfortunately that has moved us onto another error. (If we can just fix this we will be away!)

When I try and register a user with:
newUser = Backendless.UserService.Register(newUser)

The server returns this:
The remote server returned an error: (401) Unauthorized

I checked my security levels and they all seem to be exactly as those set on the 3.0 app. Is there anything different on the 4.0 version which might need different privileges?

Here is my full code resulting in error, in case it helps, or is wrong for 4.0 version.

try
{

       BackendlessUser newUser = new BackendlessUser();
 
       newUser.SetProperty("email", txtEmail.Text);
       newUser.SetProperty("name", txtName.Text);
       newUser.SetProperty("surname", txtSurname.Text);
       newUser.Password = txtPassword.Text;
       newUser = Backendless.UserService.Register(newUser);
    


     //presume registration was success   
     lblRegisterResult.Text = "Hello, " + newUser.GetProperty("name") + "<br/><br/>" + "Thankyou for signing 




    
    
    }


     catch (BackendlessAPI.Exception.BackendlessException exception)
     {
 
         lblRegisterResult.Text = "Hello, " + "<br/><br/>" + "We had a problem registering you" + "<br/><br/>" + exception.BackendlessFault.Message + "<br/><br/>" + "Please try again";
     }

Hi Mike,

I tried reproducing the error and could not. Here’s what I did:

    Created an ASP.NET project where I use the latest build of backendless.dll. Set up a virtual directory in my IIS and mapped it to an app pool configured for .NET 4.0: http://support.backendless.com/public/attachments/db38532010026b9677574a1c43dff084.jpg</img> The apppool configuration is below. Notice it is using the NetworkService identity: http://support.backendless.com/public/attachments/2c197381fe6acef990abf83ad3160a86.jpg</img> The code of the app is trivial, InitApp and Login, then update a label: http://support.backendless.com/public/attachments/c00f87195b8e397cf5ce21d3a6b68ed5.jpg</img> When I load the page, it worked as expected: http://support.backendless.com/public/attachments/72bd7ba774c3aadc97ad37fdd55ec428.jpg</img>

Going back to the problem you experience, is the 401 error coming from IIS or the Backendless servers?

Regards,
Mark

Thanks Mark, really appreciate the time you took to do this. Away from work today, but will try tomorrow.

Hi Mark

Success!! I started again with a clean slate and all works as expected. It works if the application pool is set to ApplicationPoolIdentity or NetworkService.

Why it wasn’t after you did mutex removal I don’t know - some setting I tried on the server no doubt, but anyway thanks again for your efforts to get me up and running with the backendless 4.0

Sorry Mark, NOT SUCCESS! It was a false positive, schoolboy error I had commented out the bit of code causing the problem. Still getting the 401 error despite following your notes and setup. Following your code all works fine, except when I call the Backendless.UserService.Login(name, password)

Sorry, how can I tell if the problem is coming from IIS or Backendless servers?

I put Backendless.UserService.Login in a catch block and this is the output:

catch (BackendlessAPI.Exception.BackendlessException exception)
{

exception.BackendlessFault.Message:
The remote server returned an error: (401) Unauthorized.

exception.BackendlessFault.Detail:
Internal client exception at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at Weborb.Client.HttpEngine.ProcessAMFResponse[T](IAsyncResult asyncResult)
}

Hi Mike,

What is your app ID?

Regards,
Mark