Resolving “CloudConfigurationManager does not exist in the current context” compiler error

Hi,

In case you get are trying to access the cloud configuration file in your Azure Cloud service and get the error “CloudConfigurationManager does not exist in the current context” on CloudConfigurationManager class, then all you need to do is add the nuget package “Microsoft.WindowsAzure.ConfigurationManager” to your project. And then, make sure you include the using statement “using Microsoft.Azure” in the class where you’re trying to access the cloud configuration file.

Hope this helps!!

[Update]

As pointed by Matthew Harris, this doesn’t seem to work for ASP.NET 5 json configs. While trying to read configuration specified in json file, please follow the approach mentioned in the below link.

http://stackoverflow.com/questions/30575689/how-do-we-use-cloudconfigurationmanager-with-asp-net-5-json-configs/30580006#30580006

This entry was posted in .NET, C# and tagged , . Bookmark the permalink.

4 Responses to Resolving “CloudConfigurationManager does not exist in the current context” compiler error

  1. goldy says:

    Thanks , it works .

  2. This didn’t solve my issue, so I’m posting this in because your page comes up high in the search results for this problem.

    For asp.net core applications the CloudConfigurationManager cannot be used but there are workarounds explained here:

    http://stackoverflow.com/questions/30575689/how-do-we-use-cloudconfigurationmanager-with-asp-net-5-json-configs/30580006#30580006

    • Amogh Natu says:

      Apologies for late response. Thank you for pointing that out. I’ve never worked on ASP.NET 5 and need to first get some hands on before I can write anything about it. 🙂 However, for now, I’ll update the post to point to the link that you’ve provided.

Leave a Reply

Your email address will not be published. Required fields are marked *