private async Task<AuthenticationToken> GetToken()
{
string username = loginDialog.username;
string password = loginDialog.password;
string requestString = $"Service/Login";
RestRequest request = new RestRequest(requestString, Method.POST);
request.AddParameter("username", username);
request.AddParameter("password", password);
IRestResponse<AuthenticationToken> response = await _client.ExecuteAsync<AuthenticationToken>(request);
return response.Data;
}
I am using RestSharp in a few projects within my solution. I can not use it within the installer, WixSharp isn't working well with RestSharp. I need to use WebClient or HttpClient to achieve the same response as I get with this Method using the RestSharp library. Is anyone able to help?
In the case of requirement some external assembly for Wixsharm runtime just add it like below:
var proj = ManagedProject()
proj.DefaultRefAssemblies.Add("Restsharp.dll")
And it will be avaliable for load in runtime and accessable for use.
P.S. Dont forget to check assembly existence in your builder executable file output location.