.Net Remoting Error – Win32Exception: The logon attempt failed

Quite a while ago, in the absence of any alternatives, we built a remote deployment utility so we could push updates to our staging and production servers without manual intervention.

Recently however, while deploying the latest code for an internal project to a new production server, the .Net 2.0 automatic deployment  I had created threw the following, rather unfriendly error:

Exception Details: System.ComponentModel.Win32Exception: The logon attempt failed
[Win32Exception (0x80004005): The logon attempt failed]
[InvalidCredentialException: The server has rejected the client credentials.]

In order to protect the server from attack we have a system service which we communicate to using .Net remoting, which requires authentication.

Apparently the bug occurred, because I created the user account which we authenticate against on the new server, after I have installed the system service.

I uninstalled the system service, reinstalled it and it magically worked like it should.