Click here to Skip to main content
15,888,908 members
Home / Discussions / C#
   

C#

 
GeneralRe: RasAPI in C# - connecting after failure Pin
Daniel Turini19-Nov-04 6:53
Daniel Turini19-Nov-04 6:53 
GeneralRe: RasAPI in C# - connecting after failure Pin
Roland Bär21-Nov-04 23:25
Roland Bär21-Nov-04 23:25 
GeneralWindows Service and Sql Server Pin
Anonymous19-Nov-04 2:41
Anonymous19-Nov-04 2:41 
GeneralRe: Windows Service and Sql Server Pin
Dennis C. Dietrich19-Nov-04 3:15
Dennis C. Dietrich19-Nov-04 3:15 
GeneralRe: Windows Service and Sql Server Pin
Daniel Turini19-Nov-04 6:49
Daniel Turini19-Nov-04 6:49 
GeneralRe: Windows Service and Sql Server Pin
Steven Campbell19-Nov-04 7:37
Steven Campbell19-Nov-04 7:37 
GeneralRe: Windows Service and Sql Server Pin
Anonymous19-Nov-04 19:13
Anonymous19-Nov-04 19:13 
GeneralRe: Windows Service and Sql Server Pin
Dennis C. Dietrich20-Nov-04 3:43
Dennis C. Dietrich20-Nov-04 3:43 
Zishan wrote:
Same is the problem with the file access. I am trying to access a text file on a client machine with UNC address. The Windows Service is not starting. When I copy the same code on a Windows Appliaction, it is working fine. The Service does not have any problem with text file on the local drive.

I agree with Daniel that you should modify your program so it saves a stack trace in case of an unhandled exception and if I were system administrator and had to use your service I would expect it to write everything relevant into the Windows logs.

Without a stack trace however I can just give you my next best guess. And because you say that the service can access local files but can't access remote files with UNC paths then I'd say you're getting some kind of access denied exception. Remember that when you execute your code as a normal exe (and don't use run as) it runs with your permissions. As developer I assume you might have administrative privileges on your local machine and maybe even on the servers. Your service however runs with the permissions of the account you set in the service configuration. That's by default LOCAL_MACHINE\SYSTEM. Of course any local system account has no privileges on any remote machine. Even if it indeed is an domain account you setup for your service it might not have enough permissions to access the data you want to use. So check out your service configuration and see if that's the problem.

Best regards
Dennis

P.S. Why are you posting as Anonymous? Don't you have an account or are you just not logged in. Well, it's not like it really bothers me, but I'm curious to whom I'm writing. Smile | :)
GeneralRe: Windows Service and Sql Server Pin
Zishan Haider22-Nov-04 0:07
Zishan Haider22-Nov-04 0:07 
GeneralPrinting Graphics Pin
rognog19-Nov-04 1:33
rognog19-Nov-04 1:33 
GeneralRe: Printing Graphics Pin
benjymous19-Nov-04 5:23
benjymous19-Nov-04 5:23 
GeneralRe: Printing Graphics Pin
Heath Stewart19-Nov-04 8:16
protectorHeath Stewart19-Nov-04 8:16 
GeneralRe: Printing Graphics Pin
Daniel Turini19-Nov-04 6:03
Daniel Turini19-Nov-04 6:03 
GeneralRe: Printing Graphics Pin
Heath Stewart19-Nov-04 8:24
protectorHeath Stewart19-Nov-04 8:24 
QuestionHow could I know all the threads have been executed? Pin
momer18-Nov-04 22:19
momer18-Nov-04 22:19 
AnswerRe: How could I know all the threads have been executed? Pin
benjymous18-Nov-04 22:30
benjymous18-Nov-04 22:30 
AnswerRe: How could I know all the threads have been executed? Pin
Daniel Turini18-Nov-04 23:10
Daniel Turini18-Nov-04 23:10 
GeneralNETBIOS Pin
Y3YPnATOP18-Nov-04 22:06
Y3YPnATOP18-Nov-04 22:06 
GeneralRe: NETBIOS Pin
Heath Stewart19-Nov-04 8:35
protectorHeath Stewart19-Nov-04 8:35 
GeneralDataGrid control Pin
sasan5618-Nov-04 20:30
sasan5618-Nov-04 20:30 
GeneralRe: DataGrid control Pin
DougW4818-Nov-04 20:38
DougW4818-Nov-04 20:38 
GeneralRe: DataGrid control Pin
drayab18-Nov-04 20:51
drayab18-Nov-04 20:51 
GeneralDataGridTimePickerColumn question Pin
Old Gun18-Nov-04 16:22
Old Gun18-Nov-04 16:22 
GeneralRe: DataGridTimePickerColumn question Pin
Heath Stewart19-Nov-04 8:38
protectorHeath Stewart19-Nov-04 8:38 
GeneralRe: DataGridTimePickerColumn question Pin
Old Gun20-Nov-04 21:06
Old Gun20-Nov-04 21:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.