Working on a webapp on VS2017 using MVC framework on .NET 4.5. In my local dev environment, I use the web.config file something like this:
<appSettings>
<add key="GOOGLE_APPLICATION_CREDENTIALS"
value="C:\\Work\\Services-abcd.json" />
</appSettings>
But when I run the webapp I still get the error that GOOGLE_APPLICATION_CREDENTIALS is undefined.
So my question specifically is:
- Where am I going wrong? Do I need to define it somewhere else?
- When I deploy this to staging/production, on my azure web service, how will I share the json file and how will the web.config file need to change for that?
I know this question answers how to get the variables in web.config, but somehow I am not able to set it there.
Edit 1: Since I was asked, here is where I am getting the error of missing environment variable-
using Google.Cloud.Translation.V2;
TranslationClient client = TranslationClient.Create();
I am unable to declare TranslationClient.