Page 1 of 1

Bug: NmpCore.exe can't start or attach to service

Posted: Fri Oct 07, 2011 12:04 am
by zilley
NmpCore wouldn't attach to my running Windows service via /a or start it via /svc. In the first case it got stuck waiting for the .NET Framework to load, even though the service had started successfully. In the second case it got stuck at the "Waiting for profiled process to start" step. Event Viewer tipped me off:
.NET Runtime version 4.0.30319.235 - Loading profiler failed during CoCreateInstance. Profiler CLSID: '{9C5F9693-80CB-4ECF-879C-0F4ABC941613}'. HRESULT: 0x80070005. Process ID (decimal): 18140. Message ID: [0x2504].
Process Monitor revelated an Access Denied error:

Code: Select all

	servicename.exe	59036	CreateFile	C:\Users\xxx\AppData\Local\Temp\SciTech\NmpCore\{3347BE38-91DE-4901-B6F4-9BC49CC4DCEB}\64Bit\ProfilerCallback.dll	ACCESS DENIED	Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
Apparently the problem is that the service process doesn't have write access to that folder since the folder is under my profile but the service runs under Network Service account. I was able to work around by granting the service account access to the folder.

Re: Bug: NmpCore.exe can't start or attach to service

Posted: Fri Oct 07, 2011 2:27 pm
by Andreas Suurkuusk
Thanks for the error report. There should be no need for the service account to have write access to the temporary directory, but it does need read access. (Did you have to assign write access as well?) We will fix this and release a new version in the beginning of next week.

Re: Bug: NmpCore.exe can't start or attach to service

Posted: Tue Oct 11, 2011 9:43 pm
by Andreas Suurkuusk
Yesterday we released a maintenance version of .NET Memory Profiler (v4.0.114). This version includes a fix for this error. You can download the latest release from http://memprofiler.com/download.aspx, or http://memprofiler.com/nmpcore.aspx if you only want to download NmpCore.exe.

Re: Bug: NmpCore.exe can't start or attach to service

Posted: Tue Oct 11, 2011 10:27 pm
by zilley
I appreciate the fast turnaround.