Thanks a lot for your reply. I think you are right, my service is running under system account. Today I have done some experements and got some positive results. I am creating my service from VS2005 C# Windows Service wizard. Then I am adding a installer to it.In the installer account type I have set it to NetworkService ( as my service need some network related activities). Then I added a set-up project to it . After installing my service from Administrative Tools->service->my service->property I opend the log on page and logged on as administrator and started the service and it worked correct.
[Quoted Text] >Have you configured the service > to run under the same account or to impersonate the account > in code?
Still I am not able to cofigure my service programatically to run under a specific user's account. Can you tell me the steps to do it.
Thanking you in advance.
Regards Arindam
"Alessandro Angeli" wrote:
> From: "Arindam" > > > I am making a windows service which needs to access WMP > > library. > [...] > > Now mediaPlaylist.count is giving 0. But my Music library > > contains 20 files. I have tried this kind of code in a > > console application, it is working correct there. > > The console application by default runs under the same > account as the interactive user while services usually run > under some system account. Have you configured the service > to run under the same account or to impersonate the account > in code? > > > -- > // Alessandro Angeli > // MVP :: DirectShow / MediaFoundation > // mvpnews at riseoftheants dot com > // http://www.riseoftheants.com/mmx/faq.htm > > > >
|