Author Archives: Amogh Natu

About Amogh Natu

Technology enthusiast, Associate Consultant @ Microsoft, music lover, love my guitar, Microsoft.NET, ASP.NET, C#.NET Professional.

Resolving “Value does not fall within the expected range” ArgumentException while reporting custom health events in Azure service fabric

Hi, If you’re working with Azure Service Fabric, there are chances you might be using the cluster Health Management APIs provided by SF SDK. And if you’re using those, then you would obviously be posting some custom health events at … Continue reading

Posted in .NET, General | Tagged , , , , , , , , | Leave a comment

Check if service bus topic/subscription/queue exists with SAS key not having Manage permission

Hi, Consider a scenario where you’ve developed an application health monitoring type system which validates your application at application startup/periodically. Now as part of that if your application uses Azure service bus queues, topics, subscriptions, then it would be good to … Continue reading

Posted in .NET, C#, General | Tagged , , , , , , , , , , , | Leave a comment

Out parameters in Async methods.

A little while ago, I wanted to have an asynchronous method that returned a string but also populated an integer “out” parameter. So I started writing the method as below // Note: This will give compiler error. private async Task<string> … Continue reading

Posted in .NET | Tagged , , , | Leave a comment

Cannot access a disposed object. ‘System.Net.Http.StringContent’ While having retry logic.

Hi, I faced this scenario today when I was trying to make an HttpPost call using a retry logic wherein I was getting an ObjectDisposedException while trying to retry for the first time. Exception Message: Cannot access a disposed object. … Continue reading

Posted in General | Tagged , , , , , , , , , , , , | Leave a comment

Resolving “make sure that the controller has a parameter less public constructor” error in WebAPIs

Hi, If you’re working with WebAPIs and in the your API Controller, you have a constructor that takes parameters which are being injected by Unity or any IoC Container, then there might be a case where you will get the … Continue reading

Posted in .NET | Tagged , , , , , , , , | Leave a comment

Resolving “Not Authorized to Connect” error while running Azure Service Fabric application

Hi, If you’re relatively new to Azure Service Fabric, then there is a chance you might run into this issue wherein you start debugging your service fabric application in Visual Studio 2015 and you run into this exception. “Not Authorized … Continue reading

Posted in .NET | Tagged , , , , , , , , , , , | Leave a comment

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 … Continue reading

Posted in .NET, C# | Tagged , | 4 Comments