CSDispatcher not started when in application dir?

CodeSite logging interface classes: default "CodeSite" logger, T|CodeSiteLogger class, destinations, formatters, etc.

CSDispatcher not started when in application dir?

Postby thellekamp » Thu Mar 06, 2014 5:29 am

Hello,

i have CS 5.1.1 and wish to use the filelogging feature on deployed apps. From the help file :

"""
TIP

If you are only interested in generating a log file for your application, and you do not require the Live/File Viewer nor the Controller, then an alternative to installing the CodeSite Tools is to simply copy the CSDispatcher.exe file to the same directory as your application. When your application tries to send its first CodeSite message, the CSDispatcher.exe program will be started and the log file will be updated by the Dispatcher. When your application closes, you may wish to call the T|CodeSiteLogger.CloseDispatcher method to terminate the Dispatcher.
"""

Following this tip, I put the CSDispatcher in the app directory on a users machine. However this seems not to work.

Looking into the sourcecode i get the impression that certain resgistry entries must be set in HKEY_LOCALMACHINE. Is this the case? As this would require elevated user rights, which I want to prevent. The filelogging works fine on my development machine.

Tjerk Hellekamp
thellekamp
 
Posts: 2
Joined:
Thu Mar 06, 2014 5:19 am

Re: CSDispatcher not started when in application dir?

Postby Raize Support » Fri Mar 07, 2014 2:17 am

Hi,

The Registry Entries are used by the logging classes to try to locate the Dispatcher if it is installed on the system. The keys are accessed read-only and do not require elevated rights.

If the logger class cannot locate the registry keys (meaning the Dispatcher has not been "installed" on the system), the logger class will look in the current directory for the CSDispatcher.exe and if it is found, start it.

Also, the default UI Mode for the Dispatcher is Stealth, which means the Dispatcher icon DOES NOT appear in the system tray. When you install the full CodeSite product (not just the tools) the UI Mode for the Dispatcher is changed to Developer.

I just created a simple test project that create a LogFile destination, assigned it to the CodeSiteManager and then sent a simply CodeSite message. I then changed the HKEY_LOCAL_MACHINE\Software\Wow6432Node\Raize\CodeSite\5.0 registry key on my development machine. (I changed the 5.0 to a 5.0x). This way, the logging classes will not find the "installed" dispatcher. I then copied my test project's exe into a new Program Files (x86) directory and also copied the CSDispatcher.exe into the same directory. I then made sure the "installed" Dispatcher was not running and then I ran my test project. The CSDispatcher that was in the app directory did get started. I verified this by using Task Manager. The CodeSite messages were sent to the correct destination.

Ray
Raize Software Support
Raize Software
http://www.raize.com
Raize Support
 
Posts: 622
Joined:
Fri Mar 25, 2011 9:04 pm

Re: CSDispatcher not started when in application dir?

Postby thellekamp » Fri Mar 07, 2014 4:14 am

Hello Ray,

thank you for your detailed response and answering my question by testing and confirming that it works as described.

On the computer I tested on, I checked in the taskmanager if the CSdispatcher was there and it was not when running my application. It must be something with security then?

About the Registry setting, of course it only will be read so no problems there, but I even have no rights to put in a registry key at all on the computers, only 'installation by copy' in one directory is allowed. That is why I need this to work.

Tjerk Hellekamp
thellekamp
 
Posts: 2
Joined:
Thu Mar 06, 2014 5:19 am

Re: CSDispatcher not started when in application dir?

Postby Raize Support » Fri Mar 07, 2014 3:38 pm

On the machine that I tested, UAC is turned on. I specifically created a new directory in Programs Files (x86) to test this because it is protected by UAC. I suppose there may be a group policy on the system that is preventing one app from launching another--would seem odd, but that would explain why you are running into problems. If this is the case, we do have an experimental add-on that you can try that can be used to log your CodeSite messages directly to a log file in the OnSendMsg event of your CodeSite Logger.

Ray
Raize Software Support
Raize Software
http://www.raize.com
Raize Support
 
Posts: 622
Joined:
Fri Mar 25, 2011 9:04 pm


Return to Loggers

Who is online

Users browsing this forum: No registered users and 2 guests

cron