Archive for the ‘Windows’ Category

After receiving several DCOM error in Event Viewer about permission on various object I decided to amend the  Launch and Activation Permissions of the Key in question. I this case it was IIS Admin Service with the Key {A9E69610-B80D-11D0-B9B9-00A0C922E750} and  IIS WAMREG admin Service with the key {61738644-F196-11D0-9953-00C04FD919C1}. However, when I tried to amend I found that all the properties were disabled as seen below

image

After some Google-ing, I found that there were a couple of registry keys forcing this read-only state.

HKEY_CLASSES_ROOT\AppID\{A9E69610-B80D-11D0-B9B9-00A0C922E750}

HKEY_CLASSES_ROOT\AppID\{61738644-F196-11D0-9953-00C04FD919C1}

To change this – right click on the key and choose advanced, and replace the owner as the administrators group

image

The once this has been done change the administrator’s permissions to full control.

image

Now re-launch the component service and you should now be able to edit the values

After creating a windows service, to move a file from one UNC path to another using a FileSystemWatcher, which, in turn,  monitors a UNC path of an FTP folder for a new file,  I received an unexpected error.

I wired up the FileSystemWatcher’s OnCreated event to monitor for the new file. However, when the event fires and the service tries to move the file to another UNC path an IOException exception is thown with a message “The process cannot access the file because it is being used by another process.”

After some investigation, I found that when the file is dropped into the directory, the event OnCreated event is fired, but, at that point, the file is still writing. As a workaround, I caught the exception and when the file is released, it fires the OnChanged event, where I can successfully move the file.

Not the prettiest solution, but it works!  Anyone with any better solutions, let me know.