index > Team Foundation Server - Version Control > tf.exe through iis

tf.exe through iis


Hi
I'm trying to make a simple application that builds and deploys my solution through a web page. My approach has been to make a nant script that runs tf.exe a number of times and to run this nant script from the web page (this might seem strange, but it was chosen simplify maintenance). The Web page runs in a separate application pool (Windows 2003) having the identity of the user I'm using all automated tasks from.

The application works fine up until I'm running the "tf get c:\deploy /recurive" where it complains about "Unable to determine the workspace". Before this line I have run several tf commands on the server, successfully, but none of them requires workspace.

I have checked:
- that the user is correct by prompting the user name to screen
- that the working folder is correct
- that the same syntax and user runs fine from command line.

What is needed on the local machine besides user name and folder to determine the workspace? Is there something in the registry or system variables that haven't been loaded correctly?

Any suggestions will be greatly appreciated.

Snorre

piip
The line is of course
tf get c:\deploy /recursive



piip
I've reduced the problem to this code run in the web application pool of a user that has a workspace in c:\project\build:
string command = @"C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\tf.exe";
string args = "get";
ProcessStartInfo f = new ProcessStartInfo(command);
f.Arguments = args;
f.UseShellExecute = false;
f.RedirectStandardError = true;
f.RedirectStandardOutput = true;
f.RedirectStandardInput = true;
f.CreateNoWindow = true;
f.WorkingDirectory = @"c:\project\build";
f.LoadUserProfile = true;
f.WindowStyle = ProcessWindowStyle.Normal;

Still getting "unable to determine workspace"

Shouldn't this work?

piip
Have you considered using the Version Control API rather than shelling out to tf.exe? That would be much more reliable.
William Bartholomew
I could of course do that, but we have a large nant scripts used for deployment and that would mean that I have to maintain two sources. I don't really (really) need the web page, but it's my curiosity as to why tf.exe doesn't find the workspace through iis that is driving me now. Running the deployments manually is less work than maintaining two different deployment sources.


piip
Try changing f.WorkingDirectory to c:\deploy.
Richard Berg MSFT
Thanks, but didn't help.

What puzzles me is that "workspaces" and "workspace" command works perfectly. Identifies the user correctly and everything. My theory is that the "get" command doesn't find the server, perhaps because the registry isn't loaded completely in the application pool. I find it strange that the "get" command doesn't accept the /server tag. Anybody know why?


piip
If the problem only happens with Get, it's probably due to threading -- Get does its downloading on a background thread, and those threads don't always inherit the app pool credentials correctly. See http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=771972&SiteID=1
Richard Berg MSFT
Excellent, thank you.
Updating the processmodel in machine.config did the trick. in retrospect the threading problem is quite obvious, since when creating the workspace and working folders in the same method/thread made the get command work, but using an existing workspace did not.

Thanks again.


piip
reply 9

You can use google to search for other answers

 

More Articles

Error in unshelve - 'Cannot insert null @MissingParents.ItemId'
Trouble using both VSS and VSTS
Changes since a label was applied
Get all items that changed between 2 dates
How to search TFS comments from Visual Studio
How do team projects relate to branches?
SQL server gets busier when openning a solution
Common/Shared Assemblies
Use of Visual Studio 2005 Team Foundation Server MSSCCI Provider ...
New Team Foundation Server MSSCCI Provider Available Now!
Welcome to Bokebb   New Update   Joins the collection  
 

New Articles

Finding Other Checkouts
Documentation on using the MSSCCI provider
Generate list of merge conflict
Is using workspace.Get() right?
newbie questions regarding permissions i…
TF61002 CQConverter: Unknnown Migration …
What's become of the Team Foundation Pow…
How to recover a delete revision
BisSubscribe vs TfsSubscribe
Change/Set the Working Folder/Local Name
Orphaned branch
Solution with multiple projects can't pe…
Change Local Path after download files f…
Bug: Remove Becomes Delete
partial turn on of the code analysis

Hot Articles

TFS Version Control workspace structure
Changing Permissions on New Branches
Using MSSCCI provider with VS 2003
How can I merge an outside source tree i…
Explanation of branching and normal work…
check out all items programatically C#
The underlying connection was closed
Database Size After Conversion
Branching from a labeled version after a…
Forward integrating (parent-to-child) bu…
Team System Multiple Checkout Problem
Problem with Rename - Delete/Undelete
ThreeWayMerge.Run() crashes when IsBasel…
Merge problem in BetaR
Can't delete orphaned version control pr…

Recommend Articles

Trying to move source causes weird error
Workspace cache for non .net developers
"Add Files" option greyed out
Why is the "Compare" item disa…
Approval check-inpolicy
automated release notes
Logging files modifications
2 TFS Project - 1 Source Control Root
Custom Check-In Policy
Files scrambled after VSS migration
MSSCCI v1.0 and VS2003 Provider not show…
During a merge, the "Building Chang…
Problem with Rename - Delete/Undelete
Checking in Solution not including all f…
MSSCCI Provider and SQL Management Studio