1

When i used google maps api in plain html it was working fine, but when i copied it to asp.net project it throw error.

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=SECRET_KEY&libraries=places&language=ru-RU"></script>

This API project is not authorized to use this API. Please ensure this API is activated in the Google

AidOnline01
  • 712
  • 7
  • 19
  • 1
    This is gonna sound like a dumb question. But did you use the correct key in the url of the script when you placed it on the .cshtml page of your .Net Core project? There is literally no difference between putting a script tag on and html page and on an .cshtml page. Check view source in the browser to see what was rendered. – RonC Apr 11 '17 at 17:22
  • Something to test [disable and reenable the api](http://stackoverflow.com/questions/32994634/this-api-project-is-not-authorized-to-use-this-api-please-ensure-that-this-api) – Jimmy Smith Apr 11 '17 at 17:24
  • Api key is same in html in folder and in asp.net project. If i open just file.html it works, but when i run localhost server it throw this error. – AidOnline01 Apr 11 '17 at 17:46
  • @AidOnline01 the api key is included in the project right? have you checked the published files to make it was properly uploaded to the root directory? – David Lee Apr 11 '17 at 17:51

1 Answers1

0

I just reloaded Visual Studio and it begun working???

AidOnline01
  • 712
  • 7
  • 19