Hey CougerAC,
thanks for your reply. sorry about the lateness of mine, I wrote the original post just before I went away on holiday for the weekend, and things were busy the first day back.
Yes, The Interop COM DLL's are already referenced in my Windows Service as they are used in processing the AutoCAD drawings during the 'publishing' process. I researched your suggestion as it isn't an approach I've seen before. It appears that you suggested a method called 'early binding', which is generally recommended over 'late binding' (which my call to CreateObject is classified as). I hadn't experimented with this before.
So, I tried out your suggestion this evening on the server, and forced a publishing run with Visual Studio attached to the service so I could debug the live code.
Unfortunately the program failed again at the same point, which was the point at which AutoCAD is instantiated and attached to:-
AcadApp = New AcadInterop.AutoCADApplication
(AcadInterop is my variable name from the Imports statement)
the only difference between this failure and the previous one was that the exception message which is now - "Server execution failed"
I used a small free program called RegMon to watch the registry calls during execution of this code, and it clearly shows AutoCAD starting up. Indeed, Taskmanager also shows the acad.exe process fire up, but it fails after a delay of many seconds, and throws up the error above. I am guessing that this would indicate that my process is unable to attach successfully to the AutoCAD process
I also looked the error message up on Google, and it also appears related to my first error - they both point to the AutoCAD installation not properly registering the Interop DLL's, but I haven't had time to compare the registry entries of a healthy machine (one that the service runs OK on) and the server.
Ugly problem. If you have any more ideas, they would be appreciated.
Thanks,
Regards,
Glenn