As errors go I found this one is pretty horrific.
I got the error deploying a windows service written in .net 3.5 from my Vista x86 dev rig, to a 2003 x86 server. Only having the .NET runtime installed on the server I wrapped the service up in a deployment project. The service installed fine, however when trying to start the service I got a “The service did not respond in a timely manner” error. Initially, like you would, I thought there was probably an error with my code in the OnStart method, but alas nothing in my beautifully crafted exception logging framework(!), over to the event viewer and this little beauty!
The complete error is…
EventType clr20r3, P1 <servicename.exe>, P2 1.0.0.0, P3 4816d837, P4 system, P5 2.0.0.0, P6 471ebf0d, P7 36d5, P8 7f, P9 system.argumentexception, P10 NIL.
The error is titled…
.NET 2.0 Runtime error. (Which through me a little, I’m on .net 3.5!!)
After some intense googling I have pretty much “Jack”, no clear answer from the MS forums, despite input from MSFT staff. Something that kept popping up was that I was referencing something in the framework that wasn’t installed on the server. So I checked every reference manually on the server, I even thought there might be a problem because some of the .NET dll’s on my machine are in “/ProgramFiles (x86)/….” the server not being x64 didn’t have this folder so, I created it! (Not convinced, but worth a shot!) Nope, same error.
Right, most who have seen this error report no problem on their dev machine with VS installed and get it on machines with just the runtime installed. So, feck it, I installed VS 2008 on the server (clutching right!), I just though perhaps there was something VS installed that I was referencing somewhere…at the very least I would have debug tools installed, speed up the process and could rule it out. Nope, same error. Now I can’t actually attach a debugger to the process can I, as the service hasn’t won’t start!
This is mental! As far as I was concerned I had nowhere else to go. By the way, somewhere in there I actually tried to run the service on a different x64 2003 server, but still the same error. I got another service I have been working on, hacked it about so it would build and run (making sure I was referencing the same libraries as original project). Same drill, wrapped it in an installer, spun it up on the server, started first time!!! Right, nothing to do with the framework, clearly the issue is local to my project.
I created a new project and copied in any custom classes and basically replicated exactly what the problem service was doing, IT WORKED. The only thing different, when I created the first project, I deleted the “Service1” that the project template creates.
If you have made it this far down the post in anticipation of the first cause and “concrete” solution for this error, I am sorry to disappoint, but all I have is it to create a new project and start again…VS must be doing/wanting something weird in the background. After wasting a hours on this I don’t have the inclination of patience to look further/deeper.
Perhaps someone has had similar experiences with the error and could enlighten the rest of us?
Technorati Tags: Eventtype clr20r3,windows service,.net 3.5