Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dll run as service - how to set parameter
Message
From
08/07/2017 03:08:51
 
General information
Forum:
C#
Category:
Installation, Setup and Configuration
Miscellaneous
Thread ID:
01652528
Message ID:
01652564
Views:
43
>>>Hi everybody,
>>>
>>>I have a DLL project. To the main class (based on the public interface) I added a property called lTraining.
>>>
>>>That dll is being invoked as a service (my colleague added that service).
>>>
>>>My question is - how can we somehow pass 'Training' parameter (may be to that service) and how would it then set that flag property?
>>>
>>>Thanks a lot in advance.
>>
>>Do you mean that you want to start the service with a parameter or that you want to change the flag whilst the service is running ?
>>If the former that then might help: https://stackoverflow.com/questions/42812333/pass-an-argument-to-a-windows-service-at-automatic-startup
>>
>>If the latter then you have lots of options: named pipe, web sockets, WCF etc......
>
>Hi Viv,
>
>I have a problem.
>
>Basically, my questions were because we wanted to be able to run our middleware com class in the training mode.
>
>The original code was the following:
>
>
>public enum ReturnType { UNK, STR, XML, XM2, XM3, DSP, ADO }; // UNK = unknown, if it has not been set or they selected an unavaliable value
>    // TODO: Enum of methods - change 
>
>    [Guid("1c3f2f40-86f0-418b-a33f-9bdda89e82b5"), InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
>    public interface IMiddleware
>    {
>        [DispId(1)]
>        String Invoke(String input);        
>    }
>
>    [Guid("362941ee-ae94-41a2-9dd4-3e159e87cb4d"), ClassInterface(ClassInterfaceType.None)]
>    [ProgId("Siriusware.Middleware")]
>    public class MiddlewareCom : IMiddleware
>...
>
>
>It worked fine.
>
>I added a new class and also generated a new GUID using the Tools/Create Guild so the signature now is the following:
>
>
>//[Guid("BCD1A253-6D2F-4BBF-9164-184AF7B7414E"), ClassInterface(ClassInterfaceType.None)]
>    //[ProgId("Siriusware.MiddlewareTraining")]
>    //public class MiddlewareComTraining : MiddlewareCom
>    //{
>    //    public MiddlewareComTraining() : base("Training")
>    //    {
>                        
>    //    }
>    //}
>
>I added running this class as a service using our PoolService program (written in C++).
>
>And now I am able to run the training service fine, but I can not run the Live service anymore.
>
>The pool log has the following
>
>2017.07.07 18:26:11.341 ( 1 ) Unable to Create Instance of Siriusware.Middleware Error: Unable to load Siriusware.Middleware. Invalid class string
>2017.07.07 18:26:11.341 ( 1 ) Unable to load Siriusware.Middleware. Invalid class string
>
>Even after I commented out the training class and re-tried I still can not start the service.
>
>So, do you know what may be wrong?
>
>Thanks in advance.

Don't know. Often 'Invalid class string' happens if a DLL is not registered but since your other (working) class is in the same assembly it doesn't seem to be the case.
Do you get any more info is you try to start the service manually ?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform