Clear controls does not dispose them – what is the risk?

There are multiple threads(a, b, c etc.) about the fact that Clear() ing items in the .NET component containers does not Dispose them(by calling Dispose(true). Most frequently, IMHO, the Clear-ed components are not used anymore in the application, so it needs explicitly be Disposed after Clearing them from the parent containers. Maybe is a good … Read more

HTTP 407 proxy authentication error when calling a web service

I’m working on a .NET app that calls 3rd party web services over the internet. The services do not use SOAP, so we manually construct an XML request document, send it to the service via HTTP, and retrieve an XML response. Our code is a Windows service that is run in the context of a … Read more

How to tell if a caught IOException is caused by the file being used by another process, without resorting to parsing the exception’s Message property

When I open a file, I want to know if it is being used by another process so I can perform special handling; any other IOException I will bubble up. An IOException’s Message property contains “The process cannot access the file ‘foo’ because it is being used by another process.”, but this is unsuitable for … Read more

List of Input Values which will cause the “A potentially dangerous Request.Form value was detected…” error

I know the < and > characters will cause this error, but what other characters/inputs will cause this error? I’m testing for this error in the Global.asax, and reridrecting to an error page where I want to list all possible values which cause this error, so the user can go back to their page and … Read more

How can you explore the managed heap in a .NET application to identify possible memory optimizations?

We have a .NET application which our customers consider too large for mass deployment and we would like to understand what contributes to our memory footprint and is it possible to do any better without completely abandoning .NET and wpf. We are interested in improving both Total Size and the Private Working Set (pws). In … Read more

Is Repository pattern an overkill

I have been using Repository pattern (DDD and POEAA) for some time. However some of our team members have argued that it is just an extra layer of abstraction and unnecessary. I can seen some benefit in their arguments. Modern ORM solutions (NHibernate or EF) have almost everything you need. I searched and found some … Read more

Can two ASPX pages inherit the same code behind class?

I’m just starting out learning ASP.NET. From what I understand, ASP.NET differs from old school ASP in that the logic code for a page exists in as separate file rather then being embedded in the ASP page. So when a user requests a page like ShoppingCart.aspx the server reads the directive at the top … … Read more