Tag Archives: C#

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

Invoke a POST method with XML Request message in C#

Hi, To invoke a POST method located at a particular URL with an XML request message, we need to follow the below steps: Create a request to the url Put required request headers Convert the request XML message to a … Continue reading

Posted in .NET, ASP.NET, C# | Tagged , , , , , , , | 1 Comment

Restricting to only one running instance of an application in C#

Hi, We all must have observed some time or the other that when you try to open an application that is already running, you get a pop up that says, “Another instance of the same application is already running” or … Continue reading

Posted in .NET, C#, General | Tagged , , , , , , , , , , , , , , , , , | 1 Comment

[Solution]configuration system failed to initialize – C# Exception

Hi, Today I encountered an exception while working on an application. The exception was “configuration system failed to initialize”. The problem that I was having in my application configuration file was that I declared the <appSettings> tag immediately after the … Continue reading

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

Getting a machine name of logged in user in asp.net

Hi, I recently encountered this scenario and thought of blogging about it. To get the machine name of the logged in user, you can use the “GetHostEntry()” method provided in System.Net.Dns class. GetHostEntry takes a string as parameter and it … Continue reading

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

How to implement a multi-column Dropdown list? See attached image for more clarity

Hi, This post is more of a question than an article. I want to implement a multi-column drop down box where in I should be able to filter the results appearing below as I type along with auto-complete feature. A … Continue reading

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

‘yield’ Keyword in C#

Hi, This post is mainly about the ‘yield’ keyword provided in C#. I never really got a chance to use this keyword until now. So thought I would just blog about it. This blog is not of my own writing; … Continue reading

Posted in .NET, C#, CodeProject, General | Tagged , , , , , , , | 2 Comments