Question about Window Services

5 views
Skip to first unread message

Yarbrough, Darren

unread,
Feb 12, 2013, 5:40:13 PM2/12/13
to sgfd...@googlegroups.com

Hey, Guys,

      Does anyone have any experience working with Windows Services?

 

      I’m trying to get a C# 2010 Windows Service running on Windows 7 to access a SQL Server 2008 R2 database and write to folders.  Everything [the Service, the Database, and the Folders] is on the same PC.  [This cannot change.]

 

      So far, I’m running into horrific problems with access.

 

      The same code runs beautifully as a console app [meaning that the file copies and database access actually happen].  However, when I run the Windows Service version of the code, both activities create exceptions.

 

      Any ideas?  :-/

 

      P.S.  The Windows Service code has been functioning correctly for over 4 years as a C# 2005 Window Service on Windows Server 2003 accessing a SQL Server 2000 database.

 

 

Darren R Yarbrough
Programmer Analyst III | IT Systems Support
AG National Leadership & Resource Center

1445 N. Boonville Ave. | Springfield, MO 65802
p: 417.862.2781 x3384 | f: 417.831.3754

www.AG.org

 

Tom Rankin

unread,
Feb 12, 2013, 5:44:30 PM2/12/13
to sgfd...@googlegroups.com
Darren, I've got some windows services running in both windows 7 and on windows server, accessing db and files without any troubles. What types of exceptions are you getting.


--
--
Springfield .NET Users Group - http://www.sgfdotnet.org
To post to this group, send email to sgfd...@googlegroups.com
To unsubscribe from this group, send email to sgfdotnet-...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sgfdotnet?hl=en
---
You received this message because you are subscribed to the Google Groups "Springfield .NET Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sgfdotnet+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Rick Long

unread,
Feb 12, 2013, 6:39:09 PM2/12/13
to sgfd...@googlegroups.com

What account is the service running as?  Does that account have access within SQL Server and the NTFS permissions you need?

--

James Frater

unread,
Feb 12, 2013, 7:02:16 PM2/12/13
to sgfd...@googlegroups.com

Hi Darren,

I too have been running successful service (VB.NET in my case), first w/VS 2008, then 2010, and now 2012.  Yes, the service credentials must have rights to both SQL and file system to access whatever resources it needs.  There is no implicit requirement on services that they must access resource only on the box on which the service is running (perhaps this is not what you were saying) – this is rather a function of the account credentials you provide for the service and any performance considerations, for instance, network latency accessing remote resources.  Hope this helps, -James

Jay Smith

unread,
Feb 12, 2013, 8:40:48 PM2/12/13
to sgfd...@googlegroups.com
Darren,

What credentials is the service running as. You want to make sure that account has access to any resources; folders, shares, etc.

Without seeing the exception it is hard to say. But I'd check the account credientials first if you haven't already l.

Hope that helps,

Jay
--
--
Springfield .NET Users Group - http://www.sgfdotnet.org
To post to this group, send email to sgfd...@googlegroups.com
To unsubscribe from this group, send email to sgfdotnet-...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sgfdotnet?hl=en
---
You received this message because you are subscribed to the Google Groups "Springfield .NET Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sgfdotnet+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


--
Jay Smith
about.me/Jay.Smith


Reply all
Reply to author
Forward
0 new messages