Yeah, it could happen to any of us. You setup TeamCity 8.0 as a continuous integration server a while ago. It runs perfectly fine, it runs so fine that you never need to log on as an administrator any more. You even forget that it exists, you even forget YOUR PASSWORD!
Now what? Reinstall everything? Try to hack the database? Use some cryptic java commands? What? What?
No panic needed, the nice people at JetBrains already thought about this. There is a Super-user token that allow you to get back to the server UI with system administrator permissions.
Go and get the token from the teamcity-server.log file (search for “Super user authentication token” text).
After that you just need to:
- Go to <TeamCity server URL>/login.html?super=1
- Enter the Super-user token.
- Enjoy the rest of your day
By now you probably know that Microsoft is offering a FREE preview of TFS online. If you have a Microsoft account (previously Live Id), you already have a TFS account. Just sign in and start
playing using the features!
So much usage will probably leave a few projects on your account that you don’t need at all. Time for some cleanup.
But, how do you delete a project from your TFS Preview account????
- Open a VS2012 command prompt in administrator mode
- Go to
%programfiles%\Microsoft Visual Studio 11.0\Common7\IDE
- Execute the following command (replace myproject and projectname with your values):
You might be prompted for your credentials and to confirm your request:
Warning: Deleting a team project is an irrecoverable operation. All version control, work item tracking and Team Foundation build data will be destroyed from the system. The only way to recover this data is by restoring a stored backup of the databases. Are you sure you want to delete the team project and all of its data (Y/N)?Y
Just hit Y and enjoy!
This is a common task for C# programmers. You have a string value and need to convert it to the equivalent Enum value. Piece o’ cake: code some nifty
switch statement or maybe a bunch of
if / else conditions to test for every possible match, right? … er, NO.
Say you have declared an Enum like:
public enum FeedBackMessageType
None = 0,
Then you should be able to convert a string like:
var feedbackMessageType = (FeedBackMessageType) Enum.Parse(typeof(FeedBackMessageType), "Success", true);
If you are trying to convert a string that doesn’t match any of values from the enum, you will get a ArgumentException. How to avoid this? Try:
var invalidMessageType = "Info";
var feedbackMessageType = Enum.IsDefined(typeof(FeedBackMessageType), invalidMessageType)
? (FeedBackMessageType) Enum.Parse(typeof(FeedBackMessageType), invalidMessageType , true)
One caveat, the
IsDefined method has no
ignore case parameter. According to MSDN: The characters in the string must have the same case as the enumeration member name.
Some wise men said: Customer collaboration – requirements cannot be fully collected at the beginning of the software development cycle, therefore continuous customer or stakeholder involvement is very important.