Browse by Tags

Web Service performance numbers--plenty fast for UI work
While designing Web Services, the question of "interface granularity" often comes up. Conventional wisdom is that Web Service calls are slow, so the interface must be quite coarse to prevent performance problems. Four years ago, a partner and...
Debug vs Release mode differences when storing a delegate in a hashtable
The following code demonstrates a difference in the behavior of the .NET runtime between debug and release mode. I'm running .NET 1.1 with SP1 on Server 2003, but this also happens on Win2k and XP. We've been seeing it for months, but it was finally isolated...
Executing custom code on attributed classes at compile time
Eoghan Murray read my blog on custom attributes and sent the following question: I am interested in doing the following: Adding an attribute to certain classes, so that, at Compile time, information about them gets written to an xml file. I see that the...
Could not establish trust relationship with remote server.
When you use HTTPS for your web services, you may get a System.Net.WebException that, "The underlying connection was closed: Could not establish trust relationship with remote server." This indicates that the client is unable to negotiate a secure connection...
Determine if a .NET Assembly is Release or Debug
We recently got a bug report where a tester got a Debug.Assert failure in what I thought was a Release mode build. I went over to her machine, but found I couldn't tell from the binaries if it was a Release or a Debug build. ILDASM is no help, as Debug...
No way to add custom performance counters to existing custom categories...?
According to http://www.devcity.net/net/article.aspx?alias=perf_counters , “You cannot create new counters within existing custom categories. If you need to add counters to categories that already exist, the only way you can do so is to delete the...
Implementing Equals in C#
While working on refactorings, I often notice domain objects that implement Equals incorrectly. Below is a sample implementation of Equals. The key points are that Equals should not throw an exception if obj is null or of the wrong type. Also note the...
Implementing IDisposable
C lasses that need explicit destruction semantics or wrap managed resource usually implement IDisposable to allow for predictable destruction outside of garbage collection. As I was just reminded by a defect in my code, all classes that implement IDisposable...
Debug only methods in C#/.NET
In Steve Maguire's Writing Solid Code , he encourages writing Debug only code that double checks complex logic. For example, Excel uses a highly optimized evaluation method. In the Debug build, there is another method that evaluates the same arguments...
Transactional behavior when updating a DataTable
Steve wrote, "I was checking out Transactional behavior on DataTables , and that's some good stuff. Did you ever come up with a good workaround?" We already had our own DataViewWrapper class that inherited from DataView, which we were using to catch the...
More Posts Next page »