how to import a dll in Windows Service
-
Hi all, I have created a Windows Service in visual Studio 2005 beta version.In this service,I want to import a dll called CamtoJ2k.dll.
[DllImport("CamToJ2K.DLL", CharSet = CharSet.Unicode)] static extern bool CamToJ2K(string sourcePath, string destinationPath, int qFactor);
I also copied this dll in bin\debug folder. When i ran the service ,i got an error that unable find the dll. **Exception:System.DllNotFoundException: Unable to load DLL 'CamToJ2K.DLL': The specified module could not be found. (Exception from HRESULT: 0x8007007E)**Plz tell me about 1.how to import dll in service 2.do i need to add any reference to this dll(i tried this but couldnt able to add ) Thanks in Advance.. cheers sangeetcheers sangeet
-
Hi all, I have created a Windows Service in visual Studio 2005 beta version.In this service,I want to import a dll called CamtoJ2k.dll.
[DllImport("CamToJ2K.DLL", CharSet = CharSet.Unicode)] static extern bool CamToJ2K(string sourcePath, string destinationPath, int qFactor);
I also copied this dll in bin\debug folder. When i ran the service ,i got an error that unable find the dll. **Exception:System.DllNotFoundException: Unable to load DLL 'CamToJ2K.DLL': The specified module could not be found. (Exception from HRESULT: 0x8007007E)**Plz tell me about 1.how to import dll in service 2.do i need to add any reference to this dll(i tried this but couldnt able to add ) Thanks in Advance.. cheers sangeetcheers sangeet
Are you sure your service is being run from the bin\debug folder? Also, does your CamToJ2K.dll have any dependencies that might also need to be copied to that location? -Phil