471,317 Members | 1,378 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,317 software developers and data experts.

unauthorizedaccessexception

hi, I have a problem making window service.
My service tries to access local files and network files. when I let it
strated, unauthorizedaccessexception is occurred!
I guess my window service do not have domain authorization.
how can I endow my service with domain authorization ?
help me plz..

Jun 27 '08 #1
3 1274
how can I endow my service with domain authorization ?

What account is it running as? Local Service? Network Service?

Local Service will be "anon" when calling out. Network Service will
identify using the machine's identity. If you want a specific account,
then just change the service details to use a named network account (and
restart it). You can automate this if you create an installer (msi) for
the service, but if it is only going to be installed a few times it is
just as easy to go into the services applet and change the settings there.

Marc
Jun 27 '08 #2
Thanks Marc.
I modified property of service process installer as your reply.
So, my service got domain authorization.
//processInstaller.Account = ServiceAccount.NetworkService;
processInstaller.Account = ServiceAccount.User;
processInstaller.Username = "sean";
processInstaller.Password = "fdsfdsfdsf";
"Marc Gravell" <ma**********@gmail.com님이 다음 메시지를 작성했습니다.
news:u9**************@TK2MSFTNGP04.phx.gbl...
>how can I endow my service with domain authorization ?

What account is it running as? Local Service? Network Service?

Local Service will be "anon" when calling out. Network Service will
identify using the machine's identity. If you want a specific account,
then just change the service details to use a named network account (and
restart it). You can automate this if you create an installer (msi) for
the service, but if it is only going to be installed a few times it is
just as easy to go into the services applet and change the settings there.

Marc
Jun 27 '08 #3
Just remember that it is trivial to disassemble .NET code and look at
the original source... be careful you don't compromise your password by
including it in code.

Marc
Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.