Mostrando entradas con la etiqueta AZURE FUNCTION. Mostrar todas las entradas
Mostrando entradas con la etiqueta AZURE FUNCTION. Mostrar todas las entradas

jueves, 12 de marzo de 2020

Problema al llamar a Get Method of a Rest API en la web en mi código Xamarin.Forms

 System.NullReferenceException: Object reference not set to an instance of an object.


Estoy tratando de consumir un método Get de un WebAPI aleatorio en la Web a través de mi Xamarin.Formscódigo. Pero no puedo llamar a esa API.

Codigo Inicial


  private HttpClient httpClient;  

  public async Task<List<User>> GetUsersGroup(string group)

        {          
            List<User> users1 = new List<User>();

            var url = $"{Config.RoomsEndPoint}/{group}";
            var result = await httpClient.GetStringAsync(url);
            users1 = JsonConvert.DeserializeObject<List<User>>(result);
            return users1;


        }

Solucion


private HttpClient httpClient; 

public async Task<List<User>> GetUsersGroup(string group)
        {
            if (httpClient == null)
            {
                httpClient = new HttpClient();
            }
            List<User> users1 = new List<User>();

            var url = $"{Config.RoomsEndPoint}/{group}";
            var result = await httpClient.GetStringAsync(url);
            users1 = JsonConvert.DeserializeObject<List<User>>(result);
            return users1;


        }

function is in error: Microsoft.Azure.WebJobs.Host: Error indexing method

The 'AddToGroup' function is in error: Microsoft.Azure.WebJobs.Host: Error indexing method 'AddToGroup'. Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'signalRGroupActions' to type IAsyncCollector`1. Make sure the parameter Type is supported by the binding. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
[12/03/2020 03:01:23 p. m.] The 'Messages' function is in error: Microsoft.Azure.WebJobs.Host: Error indexing method 'Messages'. Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'signalRMessages' to type IAsyncCollector`1. Make sure the parameter Type is supported by the binding. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
[12/03/2020 03:01:23 p. m.] The 'negotiate' function is in error: Microsoft.Azure.WebJobs.Host: Error indexing method 'negotiate'. Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'signalRConnectionInfo' to type SignalRConnectionInfo. Make sure the parameter Type is supported by the binding. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
[12/03/2020 03:01:23 p. m.] The 'RemoveFromGroup' function is in error: Microsoft.Azure.WebJobs.Host: Error indexing method 'RemoveFromGroup'. Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'signalRGroupActions' to type IAsyncCollector`1. Make sure the parameter Type is supported by the binding. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
[12/03/2020 03:01:23 p. m.] The 'User' function is in error: Microsoft.Azure.WebJobs.Host: Error indexing method 'User'. Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'userTable' to type CloudTable. Make sure the parameter Type is supported by the binding. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
[12/03/2020 03:01:23 p. m.] The 'Users' function is in error: Microsoft.Azure.WebJobs.Host: Error indexing method 'Users'. Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'usersTable' to type CloudTable. Make sure the parameter Type is supported by the binding. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
Hosting environment: Production
Content root path: C:\DevProjects\OrdenesTrabajo\Mobile\Trino\ChatTrino.Function\bin\Debug\netcoreapp2.1


Solución 


Pude solucionar este problema agregando el paquete NuGet
Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator