Cats game

I don’t really play games on my PC, but this Cats game from Ferry Halim’s site has me addicted. I think it must be because of the pure simplicity of the game, but I suspect it also has something to do with the hypnotic accompanying music. De doo de doo duh, de doo duh. Doo duh, doo de doo duh…


Security applications break .Net 2.0 remoting

Jamie Cansdale from TestDriven.Net posted about certain security software breaking remoting with .Net 2.0. He also includes a downloadable example to demonstrate the problem.

The current list of culprits is:

The common thread amongst these is that they all have some network monitoring functionality.

The error occurs whenever a .Net TCP remoting channel is closed. Perculiarly, the error happens not on the end that closes the channel, but in the application on the other end of the channel.

The stack trace of the error is:

Exception: System.AccessViolationException
Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Server stack trace:  
at System.Net.UnsafeNclNativeMethods.OSSOCK.WSAGetOverlappedResult(SafeCloseSocket socketHandle, IntPtr overlapped, UInt32& bytesTransferred, Boolean wait, IntPtr ignored)  
at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)  
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)  

I tried the sample code as described with NOD32, remoting to both localhost and to a separate PC but could not get the behaviour.

Update: Jon Cole from Microsoft has posted on the MSDN forums verifying that this is indeed a bug, and that it should be fixed in the next release.


ASP.Net 2.0 web application project error

Chris Sells posted a useful tip (courtesy of Scott Guthrie) about duplicate types when compiling using the web application project model in Visual Studio 2005.

The error displays as:

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request.
 
Please review the following specific error details and modify your source code appropriately.
 
Compiler Error Message: CS0433: The type 'ASP.clientredirector_ascx' exists in both 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\sb2\4d76034e\bec2c8d0\App_Web_clientredirector.ascx.cdcab7d2.zmdrab5k.dll' and 'C:\Windows\Microsoft.NET\v2.0.50727\Temporary ASP.NET Files\sb2\4d76034e\bec2c8d0\App_Web_axhgbqrn.dll'

The solution is simply (although not obviously) to add the batch="false" attribute to the compilation element in the web.config file:

<configuration ...>
    <system.web>
        <compilation batch="false"/>

This generates a lot fewer assemblies and avoids the problem.

Update: According to Mike Harder (a Software Design Engineer on the ASP.NET team) in his recent post on the ASP.Net forums, this is a known bug in the ASP.Net compiler involving directory level circular references. An alternative fix to the batch="false" option is to reorganise the files in the web application to avoid a circular reference.