0

At the moment I'm setting up a new project on my TeamCity server, which should simply build and execute a C# application.

The application needs access to a network drive for the execution, so the path to the network drive is passed as argument. The build step works well, but I get a 'System.UnauthorizedAccessException' according to the path of the network drive, after executing it. The TeamCity account has administrative priviliges and everything works well if I start it manually.

So, I assume my user account or the build agent still does not posses administrative priviliges? Do I have to set more specific settings at my TeamCity server?

Sorry if this post is a repetition, but among others, this post [0] does not worked for me. Any ideas? Thx a lot in advance!

[0] how to run visual studio or nunit as administrator from teamcity

Community
  • 1
  • 1
bianconero
  • 215
  • 1
  • 12
  • 1
    Please see ["Should questions include “tags” in their titles?"](http://meta.stackexchange.com/questions/19190/should-questions-include-tags-in-their-titles), where the consensus is "no, they should not"! –  Apr 07 '15 at 08:11
  • Are you referencing the network path as a mapped drive or using the UNC path? – Nanhydrin Apr 08 '15 at 09:35
  • I'm using the UNC path. I still assume that TeamCity does not posses all necessary permissions... – bianconero Apr 08 '15 at 11:22
  • UNC is good. When you say you start it manually are you logged in as that same admin user, and do you mean manually from within TeamCity or something else? – Nanhydrin Apr 09 '15 at 10:00
  • Manually means: I'll execute it directly on the build machine (Windows 7) under the same user account. The TeamCity service runs under this account too. Thx in advance :) – bianconero Apr 09 '15 at 10:15
  • 1
    That totally sounds like it should work, particularly since it shoulds like it's a domain account you're using? It could be a setting in the local security policy on the machine for the user account to prevent it from running as a service. It sounds like the issue might be due to it running non-interactively rather than the user itself. Are you trying to run an executable off the network drive or is it just file access? – Nanhydrin Apr 09 '15 at 10:32
  • Yes, it's a domain account. Hmmm okay, it seems that the problem is not TeamCity related... It's just a file access. So, my conclusion is that the TeamCity service does not have all necessary (administrative) permissions... – bianconero Apr 09 '15 at 11:05
  • Already solved it: TeamCity service had to be changed to the user account – bianconero Apr 09 '15 at 13:57

1 Answers1

0

The solution of my question is the same as in this question:

Trying to get a Windows Service to run an executable on a shared drive

Community
  • 1
  • 1
bianconero
  • 215
  • 1
  • 12