I wrote a Windows service in .NET and I want to show classes that will be called by other .Net code. In particular, I have an API that I want to open through a DLL that will be placed in the GAC, and I want the GAC DLL to use the .Net Windows Service classes. I need this architecture, since the code in the Windows service must be running as another user / account as the calling API (the account will be created during installation).
My plan was to open the Windows Service classes through COM (regasm.exe for registration and tlbexp.exe to create a type library), and then call the classes in the GAC DLL through COM (imported via tlbimp.exe). However, I get the following error from tlbimp:
TlbImp: error TI0000: System.Runtime.InteropServices.COMException - the type library '' was exported from the CLR assembly and cannot be reused, it is imported as a CLR assembly.
This means my method will not work. I can only think that I might need a C ++ DLL as a bridge for my GAC DLL to make COM calls, but this seems like an unpleasant solution.
I am mainly looking for offers. Does anyone know how to expose Windows service classes written in .Net to another .Net code?
source
share