Friday, September 10, 2010

CS0426: The type name XXX does not exist in the type XXX

Yesterday, I was getting below error continously when I was working on a sample of MasterPage.

CS0426: The type name 'MyMaster' does not exist in the type 'System.Web.UI.WebControls.TreeView'

While I tried a lot many things (deleting page, adding new etc.) and also googled couple of things, but could not get any clue. Later while reading a post I realized the problem.

Problem here was that I had named my project (and thereby assembly and the namespace) as TreeView. So at runtime, the CLR was trying to find my master page inside Sytem's standard treeview class.

So solution was simple i.e. just change the project and namespace name to a non reserved work like TreeviewPOC in my case.

So next time you get CS0426 error, just check if your namespace or project name is colliding with any of the standard (or even third party controls etc).

Happy Coding

Regards, Subhash Dike

Friday, August 20, 2010

How to unshelve when items are locked in other workspace

Ever faced a problem, where you have been given a shelveset but the owner has locked files in his shelveset.

Here is how you could get those files in your workspace without any issue.

Just execute the below command (put the original values in place of placeholders denoted by <>

tf view /server:<Your Server Name> shelveset:"<ShelvesetName>";<Owner in Domain\UserID format> <Path of item you want to unshelve> > <Path Where you want to copy those files>

For more information you can visit MSDN Documentation

Wednesday, February 17, 2010

How to avoid recurring TFS login from Visual Studio

Every time you open Visual studio (with tfs connected mode), it asks you to enter credentials. Even if you are trying to do some command line stuff for tfs, it will prompt you for credentials.

Let's try to make that easy.

Steps (Windows Vista)

  1. Control Panel, User Accounts, User Accounts (again);
  2. Click "Manage your network passwords" ("Tasks" list on the left);
  3. In the "Stored User Names and Password" dialog, click Add;
  4. Type in your Code-Plex (or any other TFS server for that matter)
    1. Add only the host name in the "Log on to" field ();
    2. Type username in the "Domain\FirstName.LastName" format;
    3. Select "A Windows logon credential" radio button.

 

Steps (Windows 7)

  1. Control Panel, User Accounts
  2. Click "Manage your credentials" (on the left);
  3. In the "Stored Credentials for Automatic logon" page, click "Add a windows credential";
  4. On the resultant page Type in your following details -Plex (or any other TFS server for that matter)
    1. Add only the host name in the "Network details" field (tfs server full name);
    2. Type username in the "Domain\FirstName.LastName" format;
    3. Type Password

Steps (Windows XP)

  1. Control Panel, User Accounts, Advanced tab
  2. Click Manage Passwords
  3. Click Add
  4. Enter the server name (tfs server name), user name (Domain\FirstName.LastName and password).