1

I've got a problem with changing the physical path of virtual directories on an IIS, while running on a TeamCity-Agent. I'm changing the Path by using the <mkiisdir /> NAntContrib task. On the command prompt using nant it works just fine and changes the physical path too. Under TeamCity the NAnt log output looks just fine, as if all went right. But when my web application starts, the physical path is still wrong. So I started to use adsutil.vbs provided by IIS to change the physical path. On the command prompt it's working fine, but on TeamCity it does not change the path, although the build log shows that it was changed to the right directory.

I even stopped IIS before changing and started it back after changing the path, but it didn't help either.

I hope you can help me with this really annoying problem.

Rami A.
  • 10,302
  • 4
  • 44
  • 87
Chris
  • 21
  • 3
  • Can you post your code? The only thing I can recommend right now is make sure the TeamCity windows service account has the privileges to make the changes you requested. NAntContrib's mkiisdir and NAnt's exec tasks have a verbose property that if you set to true will display more verbose messages about the results of the task. Also see this: http://stackoverflow.com/questions/260526/nantcontrib-nant-mkiisdir-fails-on-iis-7-0-windows-2008 – Rami A. Jan 28 '12 at 02:21
  • @RamiA. I'm calling mkiisdir like this: The Log looks just fine, as using this task. – Chris Jan 30 '12 at 07:35
  • The Build-Agent is started from the agent.bat using the "start" command. This is called from the User i log on onto the Agent. This User can call the Nant Tasks from commandline and they are working! – Chris Jan 30 '12 at 07:41
  • Can you post your log? What are the values of src.dir and computer.name? When I use mkiisdir, I set only the dirpath, vdirname, and verbose properties. What you can try is to make sure the virtual directory does not exist before calling mkiisdir. – Rami A. Jan 30 '12 at 08:32
  • [init] mkiisdir [08:23:22]: [mkiisdir] Creating/modifying virtual directory 'MySite' on 'AGENT-002:80' (website: ). [08:23:22]: [mkiisdir] Setting application type "InProcess". [08:23:22]: [mkiisdir] Setting appfriendlyname = My/Site [08:23:22]: [mkiisdir] Setting accessread = True [08:23:22]: [mkiisdir] Setting aspallowsessionstate = True [08:23:22]: [mkiisdir] Setting authanonymous = True [08:23:22]: [mkiisdir] Setting authntlm = True [08:23:22]: [mkiisdir] Setting defaultdoc = default.aspx – Chris Jan 30 '12 at 09:02
  • I am not sure, but the problem may be the value of appfriendlyname. Try to use a name without any special characters. – Rami A. Jan 30 '12 at 09:04
  • src.dir is the base-directory of my application. It has 2 separate virtual directories, so that the path is build together. The path is echoed before it is used, so that i know the right path is used. computer.name is the name of the computer => "AGENT-002". I tried to delete the virtual directory, before making a new one, but the "deliisdir" task seems not to delete my directory, when running in the teamcity agent. – Chris Jan 30 '12 at 09:05
  • The second virtual directory is changend at the same time and has no special character in its appfriendly name. There i've got the same problem. – Chris Jan 30 '12 at 09:13
  • I am wondering if it works correctly if you try setting only the dirpath, vdirname, and verbose properties? How are you checking if the correct application path is set correctly or not? – Rami A. Jan 30 '12 at 09:47
  • I check this by opening the IIS-Management-Tool and check the values of the path, etc. Also my Build is breaking, when it cannot access my application. – Chris Jan 30 '12 at 09:51
  • > I am wondering if it works correctly if you try setting only the dirpath, vdirname, and verbose properties? – Rami A. Jan 30 '12 at 16:48

0 Answers0