I want to search all the telegram channels available with this :
var clientApi = await ClientFactory.BuildClientAsync(settings).ConfigureAwait(true);
IDialogs userDialogs = await clientApi.MessagesService.GetUserDialogsAsync(100).ConfigureAwait(true);
and then get the chats, so channels like this :
var s = userDialogs.Chats.AsEnumerable; //.Chats.asEnumerable();
but I can't compile it because it's throwing this error :
Error CS1061 'IDialogs' does not contain a definition for 'Chats' and no accessible extension method 'Chats' accepting a first argument of type 'IDialogs' was found (is a using directive or assembly reference missing?).
I'm using OpenTl and when I try to debug it, the userDialogs as an attribute Chats, as well as some others.
OpenTL library
Related
I'm currently trying out the code for "Create a Customer Payment Instrument" by using their sample code and I am getting an error on this line.
var configDictionary = new Configuration().GetConfiguration(); error is "The type or namespace 'Configuration' could not be found".
Quick fix shows me to add one of these two Using statements: using CyberSource.Client; or using CyberSource.Clients;.
But this gives me another error - 'Configuration' does not contain a definition for 'GetConfiguration' and no accessible extension method 'GetConfiguration' accepting a first argument of type 'Configuration' could not be found."
There isn't much documentation so I am unsure how to fix.
I'm working on functionality to allow users to download Azure Blob Storage items.
I am trying to get a list of blobs using:
var list = await container.GetBlobsAsync(BlobTraits.All, BlobStates.All, string.Empty).ConfigureAwait(false);
Here is the error I have though:
Error CS1061 'ConfiguredCancelableAsyncEnumerable' does not contain a definition for 'GetAwaiter' and no accessible extension method 'GetAwaiter' accepting a first argument of type 'ConfiguredCancelableAsyncEnumerable' could be found (are you missing a using directive or an assembly reference?)
Is async available for C# 7.3? Or to use Async calls to obtain all the blobs in the container I need to upgrade to 8.0 C#?
If I change the code to this:
await foreach (BlobItem page in container.GetBlobsAsync(BlobTraits.None, BlobStates.None, string.Empty))
{
yield return container.GetBlobClient(page.Name);
}
Then I have this error:
Error CS8370 Feature 'async streams' is not available in C# 7.3. Please use language version 8.0 or greater.
I know GetBlobsAsync() returns AsyncPageable<> and I'm assuming it is only available in C# 8.0?
These are the 2 options I can think of :
update you're langVersion to 8 which you are saying you do not want to do
use an enumerator eg
var blobs = blobContainerClient.GetBlobsAsync()
List<BlobItem> blobList = new List<BlobItem>();
IAsyncEnumerator<BlobItem> enumerator = blobs.GetAsyncEnumerator();
try
{
while (await enumerator.MoveNextAsync())
{
blobList.Add(enumerator.Current);
}
}
finally
{
await enumerator.DisposeAsync();
}
I'm a beginner at writing and understanding C#. I would like to know how to reuse some code I have that updates a WebService username and password credentials.
Here is code in 1st cs File:
...
public class AuthenticateLogin
{
public static object PassCredentials()
{
ServiceName.UsersClient clientauthentication = new ServiceName.UsersClient();
clientauthentication.ClientCredentials.UserName.UserName = "user";
clientauthentication.ClientCredentials.UserName.Password = "pwd";
}
}
...
Here is code in 2nd cs File:
var test = AuthenticateLogin.PassCredentials();
Console.WriteLine(test.EchoAuthenticated("Successful Login"));
Error Received:
Error CS1061 'AuthenticateLogin' does not contain a definition for 'EchoAuthenticated' and no accessible extension method 'EchoAuthenticated' accepting a first argument of type 'AuthenticateLogin' could be found (are you missing a using directive or an assembly reference?)
Solution desired:
In the second file, I want to be able to use the methods in the 'clientauthentication' of the first file. I need to be able to use the 'clientauthentication' like a common object in multiple other cs files. FYI: I can use the 'clientauthentication' methods fine in the 1st file and it works okay.
So I am using the Plugin.SpeechRecognition Nuget Package and following the exact code on line and its not working.
I have tried adding the "Plugin.Permissions" Nuget Package and that hasn't helped and i have tried googling the problem but there isn't anyone getting this issue and it seems to work fine for everyone. I have also tried removing the "await" keyword and it just says
Operator '==' cannot be applied to operands of type 'IObservable' and 'bool'
Here is my code:
private async void GetSpeechPermission()
{
var granted = await CrossSpeechRecognition.Current.RequestPermission();
if (granted == true)
{
// go!
}
}
so what should happen is there is no error what so ever and the code should run fine but the line of code
await CrossSpeechRecognition.Current.RequestPermission();
has a red underline saying
IObservable' does not contain a definition for 'GetAwaiter' and no extension method 'GetAwaiter' accepting a first argument of type 'IObservable' could be found (are you missing a using directive or an assembly reference?)
when I am using the EXACT code provided by the creator of the plugin from here https://github.com/aritchie/speechrecognition
Any help is MUCH appreciated!!
The Solution to this was to add
using System.Reactive.Linq
in the using section of the code and instead of using a bool value as the code example for the plugin suggests, instead, in the if statement, convert the "granted" variable to a string and then check for "Available", Code:
private async void GetSpeechPermission()
{
var granted = await CrossSpeechRecognition.Current.RequestPermission();
if (granted.ToString() == "Available")
{
//GO
}
}
Hope this helps some one! :D
My question is about how to get a stack out of a queue. The program should work by generating stacks (shown below), having those stacks stuffed with data (also shown below), then unloading and displaying the data in them. Right now it just throws a CS1061 exception at me. The 5 is there for example, the actual code is picking a random string from an array.
public void newCustomers()
{
var customer = new Stack();
store.Enqueue(customer);
}
public void Shop()
{
var customer = store.Dequeue();
customer.Push(5);
//^currently this doesn't work. I'm assuming the typing for customer is wrong.
store.Enqueue(customer);
}
CS1061
Severity Code Description Project File Line Suppression State
Error CS1061 'object' does not contain a definition for 'Push' and no accessible extension method 'Push' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)
You're using the non-generic Queue class. The Dequeue() method returns an object that you would have to cast to Stack:
var customer = (Stack)store.Dequeue();
customer.Push(5);
I would suggest using the generic queue class Queue<T> instead.