Author Archives: erikbra

Beware of TimeSpan.Parse

I am in the process of building a custom configuration section, and as a part of it, I need a TimeSpan property. I have struggled a bit with figuring out the format to use for TimeSpan in the string value … Continue reading

Posted in .NET | Leave a comment

COM+ and System.Transactions living happily ever after

Recently I had an issue where I had to use a COM+ transactional component from a WCF service. I was porting some old functionality from another COM+ component to a WCF service, when I stumbled across this issue. The new … Continue reading

Posted in .NET, C#, COM+ | Leave a comment

VB.NET developers – Please don’t name your properties the same as your classes

Today I was reminded that C# is a bit more strict in its naming conventions than VB.NET. After I converted an old project from VB.NET to C#, I spent a good part of the afternoon updating the names of properties … Continue reading

Posted in .NET, C#, VB | Leave a comment

WIF SAML token POST and requestValidationMode=”2.0″

Just a quick note on the WIF SAML token POST and problems like this (you’ve probably had these problems too, if working with WIF and .NET 4.0): (see e.g. Why am I getting the “A potentially dangerous Request.Form value was … Continue reading

Posted in .NET, C#, WIF | 5 Comments

Encrypt your WIF claims

WIF claims are per definition safe from tampering, as they are signed, and you do use SSL, don’t you? However, there might be times when you don’t want even the end user to be able to read the contents of … Continue reading

Posted in .NET, C#, WIF | 6 Comments

Reminder: Your publics are public.

A simple solution to the ASP.NET MVC Mass Assignment vulnerability, and a reminder on visibility modifiers on View Models. Continue reading

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

Find .NET runtime versions in Powershell

We are using multiple versions of the .NET framework at a client’s, in a huge enterprise application. We had an issue today, where someone had introduced a dependency on .NET 4.0 too low down in the stack, so that projects … Continue reading

Posted in Uncategorized | Leave a comment

Quick Powershell and SQL Server tip

Today I had to create a quick copy of a database for some integration testing purposes. In the process, I learnt two things: 1. How to replace text in a bunch of files with Powershell: 2. How to execute a … Continue reading

Posted in Uncategorized | Leave a comment

MVC AntiForgeryToken and WIF gotcha

We are in the process of implementing a Windows Identity Foundation based login. And in this process, we had some problems with an MVC site. The AntiForgeryTokens were suddenly invalid. We got the following error on every postback in our … Continue reading

Posted in .NET, C#, MVC, WIF | 4 Comments

X509Certificate2Collection is picky…

Just a quickpost. I noticed the other day, experimenting with WIF, that the X509 Certificate Store is extremely picky on the Distinguished name when trying to locate a certificate in the certificate store. My certificate’s Distinguished name shows in the … Continue reading

Posted in .NET, C#, WIF | Leave a comment