Monday, December 5, 2011

Visual Studio 2008 and Team Foundation Server 2010

Make sure to apply SP1 on your Visual Studio 2008. Install "Visual Studio Team System 2008 Service Pack 1 Forward Compatibility Update for Team Foundation Server 2010" (http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=10834) Once you install this update, you can try adding Team Foundation Server 2010 as destination, but you will be greeted with error “TF31002: Unable to connect to this Team Foundation Server …”. Reason behind this is that old Team Explorer 2008 does not know anything about collections. Solution would be to add it as full path (e.g “http://server:8080/tfs/collection”). I could not do it because every time I entered full path, I also got error “TF30335: The server name cannot contain characters ‘/’ or ‘:’ …”. Since official way would not work it was time to come up with alternative. In order to add TFS 2010 server, you will need to exit Visual Studio 2008 and go into Registry editor. Find key “HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\TeamFoundation\Servers” and at this location just add string value. Name of this value will be what Team Explorer 2008 will use for display. It’s value is full address of your server. It should be something like “http://server:8080/tfs/collection”. Ref: http://www.jmedved.com/2009/11/visual-studio-2008-and-team-foundation-server-2010/

Monday, February 21, 2011

Run 32 bit DLL on 64 bit machine

If your .NET application is a website running in IIS you can circumvent it.

An ASP.NET webpage running on IIS on a 64-bit machine will be hosted by a 64-bit version of the w3wp.exe process, and if your webpage uses 32-bit dlls your site will fail.

However in IIS you can go into the Advanced Settings of the Application Pool running the site, and change "Enable 32-bit applications" to true.

So it's still not able to run 32-bit dll inside 64-bit process, but rather it is running w3wp.exe as a 32-bit process instead.

Thursday, February 17, 2011

Delete files older then X days using batch file

forfiles /p C:\Temp\Payable_05Jan\ /S /M *.* /D -1 /C "cmd /c del /q @PATH"

[check the quotation sign, this is very imp.]

Batch file not executing from Task Schedular

1) Make sure that the task is set to "configure for Windows Vista or Windows 2008" on the first page of the task properties (under the "general" tab)
2) Make sure that the task is set to "start in" the folder that contains the batch file: open the task properties, click on the "actions" tab, click on the action and then the "edit" button at the bottom. In the "Edit Action" Window there is a field for "start in (optional)" that you set to the path to the batch file.
3) Make sure that the task is running as an account that has explicit "Full access" permissions to all these things: The .bat file itself, the folder containing the .bat file, and the target files/folders that are affected by the .bat script. Inherited permissions didn't seem to work for me.
4) Make sure that the account running the task is a member of the local "administrators" group for this machine
5) Make sure that the task is set to "run whether logged on or not"
6) The Task should run successfully with expected output when you right-click on the task and select "run" If it does that then it will run successfully when you are logged off.

http://social.technet.microsoft.com/Forums/en-US/winservermanager/thread/d47d116e-10b9-44f0-9a30-7406c86c2fbe/

Wednesday, January 12, 2011

Delete branch/subfolder in TFS

You don't use tfsdeleteproject for deleting a subfolder. You can use tf.exe command
Deleting a branch in TFS
Start .Net 2005/2008 command prompt:-
Start –> All Programs –> Visual Studio 2005 –> Visual Studio Tools –> Visual Studio 2008 Command Prompt

Ensure there is a workspace set up for the branch you want to delete and that a version of the branch has been fetched from TFS onto the local disk within the folder pointed to by the workspace.

In command prompt, change directory to the parent of the branch to be deleted. For example, if my workspace at the root level points to c:\projects and I have a branch called “TestMain” beneath it (c:\projects\TestMain) then do the following:-
> cd c:\projects
Then type:-
> tf delete /lock:checkout /recursive Reliable\CRM

If there are more folders under CRM, those will be marked for deletion if you specify /recursive switch.

Next:
Now, once you have specified what you want to delete, you have to check in your pending changes, which can be done like this

tf.exe checkin /recursive "A\B"

This should checkin your pending delete change and remove the folder from the repository and local workspace.

URL's:
http://www.woodwardweb.com/vsts/000143.html
http://nomisit.wordpress.com/2007/12/06/deleting-a-branch-in-team-foundation-server/