Wednesday, October 8, 2008

Deserialization Problems

I had a problem: The constructor to deserialize an object of type was not found. Seems the solution might be simple enough.

Tuesday, August 19, 2008

Stored proc are bad, m'kay

I hate stored procedures and personally do not use them, but this article really gives valid points to my preference of not using them at all.

Monday, July 7, 2008

Sending key presses to controls in WPF

The easiest way is to do the following:

KeyEventArgs keyEventArgs = new KeyEventArgs(e.KeyboardDevice, e.InputSource, e.Timestamp, Key.Right);
keyEventArgs.RoutedEvent = e.RoutedEvent;
.RaiseEvent(keyEventArgs);

Friday, June 13, 2008

Because of security restrictions, the type {custom type} cannot be accessed

Had the unfortunate priviledge of encountering this message when using remoting. The solution was quite simple at least.

Just add:
[assembly: AllowPartiallyTrustedCallers]

This solved the whole problem. The whole problem was in my case that my assembly was signed and it lived in the GAC. It is a framework assembly so it must be signed and must live in the GAC.

Monday, March 31, 2008

Performance Counters

A quick and dirty way to add performance counters to your application.

Friday, March 21, 2008

Namespace problem in XAML

I had to do some changes to my XAML forms, and decided to use XmlDocument or DOM for it. The DOM works great when only updating existing elements but when adding new elements it insists on adding the xmlns="..." attribute to all my new elements.

Unfortunately according to this conversation it is the way it is, so I was forced to massage the xml using standard string parsing just after XmlDocument serialized my XAML form.

Thursday, February 28, 2008

Get the StackTrace in C#

To get hold of the StackTrace is quite simple.

Saturday, February 16, 2008

SSL TCP with C#

A very nice example how to open a TCP connection using SSL.

Friday, February 15, 2008

Multiple step operation failure

I have been struggling with this ADO error for a while now. It seems the solution is simple, the new value is longer than the actual field size. Refer to this post.

Tuesday, February 5, 2008

Data binding exceptions

I recently had issues when binding to properties and those properties would throw exceptions. The following post help me figure out how to translate information back to the user.