Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unauthorized program.cs:line 29 error dotnet run #21

Open
saurabhksinha900 opened this issue Jan 13, 2020 · 4 comments
Open

unauthorized program.cs:line 29 error dotnet run #21

saurabhksinha900 opened this issue Jan 13, 2020 · 4 comments

Comments

@saurabhksinha900
Copy link

C:\Users\saurabh.sinha\Downloads\AISchoolTutorials-master\AISchoolTutorials-master\sketch2code\Import>dotnet run

Unhandled Exception: Microsoft.Rest.HttpOperationException: Operation returned an invalid status code 'Unauthorized'
at Microsoft.Azure.CognitiveServices.Vision.CustomVision.Training.TrainingApi.GetDomainsWithHttpMessagesAsync(Dictionary`2 customHeaders, CancellationToken cancellationToken)
at Microsoft.Azure.CognitiveServices.Vision.CustomVision.Training.TrainingApiExtensions.GetDomainsAsync(ITrainingApi operations, CancellationToken cancellationToken)
at Microsoft.Azure.CognitiveServices.Vision.CustomVision.Training.TrainingApiExtensions.GetDomains(ITrainingApi operations)
at Import.Program.Main(String[] args) in C:\Users\saurabh.sinha\Downloads\AISchoolTutorials-master\AISchoolTutorials-master\sketch2code\Import\Program.cs:line 29

@sabatale
Copy link

sabatale commented Mar 7, 2020

Same here. I don't think anyone is maintaining this repo anymore.

@snailmail123
Copy link

Same here. I don't think anyone is maintaining this repo anymore.

Same error isn't working for me either :( did you find a solution to it?

@srinivasreddy21
Copy link

srinivasreddy21 commented Jun 3, 2020

I too facing the same exact issue,did any one of you fixed it,if so please reply with working solution
thanks in advance

@harrybanda
Copy link

harrybanda commented Jul 10, 2020

The solution that worked for me:

  1. Open your terminal and go to Import folder
  2. paste this dotnet add package Microsoft.Azure.CognitiveServices.Vision.CustomVision.Training --version 2.0.0
    this will update the CustomVision package.
  3. Open Program.cs and replace this line TrainingApi trainingApi = new TrainingApi() { ApiKey = trainingKey }; with this line CustomVisionTrainingClient trainingApi = new CustomVisionTrainingClient(new Microsoft.Azure.CognitiveServices.Vision.CustomVision.Training.ApiKeyServiceClientCredentials(trainingKey)) {Endpoint = ENDPOINT};
    makesure to replace ENDPOINT with your yours from customvision.ai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants