Kirk Evans Blog

.NET From a Markup Perspective

Is C# missing checked exceptions?

An interesting thread on SlashDot asks if a developer should learn C# or Java as a 2nd year student.  In typical SlashDot form, there are the usual uneducated anti-MS bashing comments on missing features that actually exist or comparisons of features where the author is clearly stretching to find something where the Java language excels… Read more

VB.NET Generics and System.Action delegate

A customer indicated that they were having some problems with Generics in VB.NET and using “foreach” on it.  After a couple of emails back and forth, I realized they wanted to see how to use the ForEach method on a List or Array.  One way to use iteration is to use the “For Each” syntax,… Read more

The One About Attributes

I love using .NET attributes.  When I am teaching a class on web services, I start by showing what an attribute is, how you can create custom attributes, and how to use GetCustomAttributes to detect your attribute.  I then cruft up a sample CsvSerializer that serializes a class to a CSV file based on the metadata… Read more

A Quick Primer on Namespace Bindings

I sent an email trying to explain to a customer why their SOAP packet was not being processed correctly.  In effect, the problem was that an element that was supposed to be bound to was redefining its namespace binding using xmlns=””.  A quick example: <transportation xmlns=““> <bus /> <car xmlns=“”> <chevrolet /> <ford />… Read more

WSDL.exe /parameters switch

WSDL.exe in .NET 2.0 has a great addition, the capability to specify all of the documents for the tool in an XML file rather than in the command line.  For instance, if you use schema imports, you need to provide the schemas at the command line: wsdl.exe http://localhost/foo/foo.asmx?wsdl http://localhost/foo/foo1.xsd http://localhost/foo/foo2.xsd Not very pretty, and it… Read more

Modify a Web Service’s WSDL Using a SoapExtensionReflector

A customer pinged me with an interesting problem.  They hosted an ASMX web service to run under SSL according to the KB article “HOW TO:  Secure XML Web Services with Secure Sockets Layer in Windows Server 2003“.  When they viewed the WSDL for the service, the scheme for the URI still indicated “http” instead of… Read more

Application Compatibility and .NET 2.0

Lots of customers who skipped the .NET 2.0 betas waiting for the RTM are now asking questions like, “will my application continue to run?”  Some resources to help you understand application compatibility: Channel9 video explaining application compatibility.  Jesse Kaplan — Will your .NET 1.1 apps work on 2.0 or vice versa? A list of steps… Read more