Using a custom server URL with Parse on Xamarin - parsing

I'm working on a company project that has been built over the last 18 months and has a backend built using Parse.com, we are in the progress of migrating to Back4App.
However I am unable to find how to set the API Server URL in the C# SDK which I'm using with Xamarin, as the initialise method only has parameters for an application key and a .NET key.
Would anyone know how I can set the API Server URL to http://parseapi.back4app.com?

You can supply a custom ParseClient.Configuration that contains your Server URL:
ParseClient.Initialize(new ParseClient.Configuration()
{
Server = "http://parseapi.back4app.com",
ApplicationId = "YourAppIDHere",
});

Turns out I was using an outdated version of Parse within Xamarin and I fixed this by updating my references.
To use a custom server you need Parse v1.7.0.

Related

Not able to add FromSqlRaw or FromSqlRawAsync in Web API code

I am using VS 2019 and I have a simple Web API method to execute a stored procedure that returns one string. I am using Entity Framework Core version 3.1.31.
When I am trying to call the stored procedure in my Web API method by using
context.Database.FromSqlRawAsync
I get an error
DatabaseFacade does not contain a definition for FromSqlRaw...
However if I use ExecuteSqlRaw, it accepts it and does not throw any error.
Any suggestion on how to resolve this?
I have tried installing Microsoft.EntityFrameworkCore.Relational package version 3.1.31 from nuget package manager. I am also using using Microsoft.EntityFrameworkCore statement in the Web API controller.
What else do I need to do?

Getting token from a windows form app get stuck when trying to get a secret form Key Vault

I am trying to read key vault keys from a windows form app. When I call following:
var client = new SecretClient(new Uri("https://xxtestingkeyvault.vault.azure.net/"), new InteractiveBrowserCredential());
var test = client.GetSecret("Test");
It just get stuck. I would expect a browser to popup. Any pointers?
OK found a solution. If i took a .Core Console Application it worked. I then tried using the .NET Windows Forms (and not the .NET Framework version) and added the code to an event from a button. Still same. I then added the code in the Form_Load event. Then it worked. So there is something in the event model that requires it to be in the start-up of the application. If I add it in the Form_Load of the .NET Framework version it does still not work.

Web service call missing field value xamarin IOS

I'm having a web reference which is being used by both a Xamarin IOS application, Xamaring Android application, and a Windows Store application.
And this all worked very well, until I updated Xamarin.
Now, there is a field that But it works fine for the Android and Windows applications.
I have tried to update the web reference multiple times, with no luck. I have also tried to debug the web service locally, to see if it returns the same , which it does.
When I receive it in my Windows Store app., it looks like this:
And in my IOS app., it looks like this:
It is always the StructureId that is never set, for some reason. And it was not like that before I updated Xamarin.
Anyone who knows what I am doing wrong, or have stumbled onto the same kind of problem ?
That looks like the linker removed unused members. Defaults have not changed (it's not related to your update) but you should check that your application is being built with Link SDK (and not Link all).
If you want a smaller executable and set Link all to achieve this then you'll need to add [Preserve] attributes on the structure you're serializing (e.g. used in web services).
I was able to make it work. I am not sure if it cached anything, or what, but it helped to add some "noise" on the webservice call.
I just added DateTime.Now.Ticks to my webservice URL in Reference.cs, so it would always be a new URL call:
this.Url = "http://somewebsitename.com/ReportService/ReportService.asmx?v=" + DateTime.Now.Ticks;

Wierd JSON result - Elfinder.NET initialization error

I'm using ElFinder.NET connector in my MVC applications. In one application everything works fine, but the other application can't initialize Elfinder.
The code used to initialize Elfinder is the same in both applications. The problem is probably in Connector.Process(this.HttpContext.Request) call.
In the application, where ElFinder is working, Connector.Process returns JSON result with correct data, the other application returns a wierd result.
I can see in the browser, that the request was processed, but the response body contains string System.Web.Mvc.JsonDataContractResult instead of JSON data. If I step through the code in Visual Studio, I see that Connector.Process return a JsonDataContractResult but it's empty.
Well then :)
Possible situation is; outdated Json.Net(Newtonsotf.Json) package version. If you have an older version of this library please simply replace them with the ones in elfinder's package as i say on my comment..

Getting Authentication working on Mono for Android with servicestack

I've got ServiceStack working nicely on the server and with a Windows test client, and now need to get it working in my Mono For Android application.
I've downloaded the following:
ServiceStack.Common.dll
ServiceStack.Interfaces.dll
ServiceStack.Text.dll
from the github tip, and added references to these in my Mono for Android project.
However, we need to use authentication, so need the ServiceStack.ServiceInterface.Web namespace to be available for the client, so I can do the following:
var c = new JsonServiceClient("http://localhost:53434");
var authResponse = c.Get(new Auth { UserName = "myusername", Password = "password", RememberMe = true });
Looking at my working test client, Auth is defined in ServiceStack.ServiceInterface.dll, so presumably I need to get hold of this DLL, or its source and compile it in my project.
Am I on the right lines here, or is there a simpler way to set things up? I've searched around but can't find a good resource on how to use ServiceStack with Mono For Android - if there is one, please feel free to point me to it!
I note this StackOverflow indicates I'm on the right lines - all I might need is ServiceStack.ServiceInterface.dll compiled for Mono For Android.
James
You shouldn't have to compile the server ServiceStack.ServiceInterface.dll for use in any client library as there is a copy of the Auth DTOs is also available in the ServiceStack.Common.dll client library at ServiceStack.Common.ServiceClient.Web.AuthDtos.cs.
This is possible since both server and client DTOs generate the same wireformat.

Resources