Thursday, January 24, 2008

WCF error: The socket connection was aborted.

I got this error when I called my WCF service:

The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:00:59.9921880'.

One of the things I've noticed with WCF is that some of the error messages are not very helpful.

The actual problem here was that the message was too large and it was exceeding the settings for the binding. I updated my bindings and everything is working fine now. In the MSDN docs, it says these settings are to limit denial of service exposure, so maybe that's why the error message isn't very helpful.

Here are the settings I updated:
  • maxReceivedMessageSize
  • maxBufferSize
  • maxBufferPoolSize

I updated these settings on the client and server.

Warning: I have not done any research into these settings to see exactly what they are. It is quite possible that changing only one of these settings will work and it is also possible that changing these settings may have an adverse impact to your system.

So, here is the section from my new config file:

<binding name="MyCoolBinding" maxreceivedmessagesize="10000000" maxbuffersize="10000000" maxbufferpoolsize="10000000">

Good luck!

Wednesday, January 16, 2008

Samsung - Not supported mode with DVD player

I was trying to connect my DVD player to my new Samsung TV last night and I kept getting a "Not Supported Mode" error. Nothing I found in the user manual or on Google helped me. Well, after a little trial and error I figured out the problem. I had accidentally connected the cables incorrectly. I am using component video cables and I had switched the red and green cables. I swear I'm not color blind.

I this helps anyone else that has a similar problem.

Wednesday, January 9, 2008

makecert.exe error: Can't create the key of the subject

I hit a snag while trying to create a certificate for WCF work today. I was following directions on another blog, but every time I tried to create the certificate I would get this error:

Can't create the key of the subject ('<some guid>')

Each time I tried, the GUID would change.

I'm not sure why it is happening, but I did find a workaround. The directions I was following were to create the certificate in the "LocalMachine" certificate store using the following command:

makecert.exe -sr LocalMachine -ss MY -a sha1 -n CN=Client -sky exchange -pe

After some trial and error I discovered I was able to create the certificate in the current user store instead using the following command:

makecert.exe -sr CurrentUser -ss MY -a sha1 -n CN=Client -sky exchange -pe

I thought I would post this message to hopefully save others the effort.
Note to the makecert developers: Please provide more useful error messages.

I discovered the source of the problem! For some reason, I did not have the appropriate permissions to the directory where the certificates are stored. If you are getting the same error that I was getting, try granting your account (or the admin group, etc.) full control permission to the following directory:

C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys

For more information, see Microsoft KB article Q278381