0

I am trying to implement the example provided in the Microsoft website, getting below error can anyone please help me with this.

https://learn.microsoft.com/en-us/exchange/client-developer/exchange-web-services/how-to-authenticate-an-ews-application-by-using-oauth#register-your-application

I am trying to implement sample code provided in App-only authentication, I am using VS 2016 console application.

static async System.Threading.Tasks.Task Main(string[] args)
        {
            // Using Microsoft.Identity.Client 4.22.0
            var cca = ConfidentialClientApplicationBuilder
                .Create(ConfigurationManager.AppSettings["appId"])
                .WithClientSecret(ConfigurationManager.AppSettings["clientSecret"])
                .WithTenantId(ConfigurationManager.AppSettings["tenantId"])
                .Build();

Error :-

Severity Code Description Project File Line Suppression State Error CS5001 Program does not contain a static 'Main' method suitable for an entry point

Please let me know how to resolve the error.

Regards, Ramesh.

Ramesh
  • 1
  • Does this answer your question? [Error message "CS5001 Program does not contain a static 'Main' method suitable for an entry point"](https://stackoverflow.com/questions/47588531/error-message-cs5001-program-does-not-contain-a-static-main-method-suitable-f) – riQQ May 29 '23 at 13:31

1 Answers1

0

If I may suggest using a REST API gateway instead of EWS directly, your job may be easier. Here is the authorization flow then.

Alexey
  • 556
  • 1
  • 5
  • 18