Oktober 2006 - Posts
We Installed an Local Team Foundation Server here to test some Stuff with It. Local means, that it runs under Local Accounts, but the Windows Server itself is in the Domain.
First of all, I wanted to say, that the Installation of It is really not easy. Before you install It, open the Help and use the Installation Guidelines step by step. you really need it.
The Symptom
While you are installing, you read more than once, that when you run that Stuff as a Local User, you have some limitations. But basically not, what limitations are there.
What you experience afterwards is, that you cannot add any Domain User to Groups, and Domain Users that are in Windows Groups cannot be resolved. so no Domain User can log on into the Team Foundation Server.
The Problem
So, the TFS runs under an Local User. thereof, the TFS cannot access the Active Directory of the Domain, and cannot do anything to Resolve an User. The User gets just a Message, that he is not allowed to access the TFS Server, or when you want to add an AD User, it throws an error that it cannot resolve the User.
The Structure of Identity in TFS
The TFS has a Mixed Identity Structure. It has its own Group/Group Member Structure in the Database. As a Group Member you can add Windows Users and Groups as well as other TFS groups.
The Data is stored in the Tables
TfsIntegration.dbo.tbl_gss_groups
TfsIntegration.dbo.tbl_gss_group_membership
And has an pretty easy Structure. The group_membership is self explaining. It just uses the SID's of an Group and it's Member.
In the groups Table, the special_type tells the System more or less what the Group is about.
0 = Default Group
1 = Administrative Group (Server or Project)
2 = Service Applications (the Identities under that TFS and its Tools runs)
3 = Everyone Group. Here is only the Group for any User that has access to the System (Team Foundation Valid Users)
4 = Licensees Group. dunno what this does.
The PID is the Project ID. If the Group does not belong to an Project, its 0
The commandline Tool "tfssecurity"
in the Tools Folder of the TFS (e.g. C:\Program Files\Microsoft Visual Studio 2005 Team Foundation Server\Tools) there's a Tool called TfsSecurity. With This, you get the detailed Messages, what Fails when you have an Error. Also this Tool gives you best possibilities to modify the Security directly. I really recommend that over direct modifying of the Tables.
To get the Info's of an specific User, just type
tfssecurity /server:<servername> /imx <user>
the User can be either the Domain User "domain\username", the SID, or the LDAP path.
In our Case the Tool tells us in Detail, that it cannot resolve the Domain User. that happens because the TFS runs under a Local User that has no access to the Domain.
The TFS Webservices
TFS itself is not an Program that runs on that machine. Its an very intelligent Webservice and some SQL Tasks.
So it is pretty easy to manipulate the Stuff. And what we need to Solve our Problem is pretty easy. Another User that is allowed to look up in the AD.
That can be done thru the "TFS AppPool" in the IIS Application pools.
Change it to the Local System Account (it warns you about that, but click okay) and now you can add Domain Accounts.
The Drawback here is, that you cannot leave the AppPool with the System account. Basically you only need this for the "Services" Webservice and you can create another AppPool for the Rest, but you ran sometimes into Problems. and one of the not so nice features is, that you often don't get the right error Message. So I don't recommend to leave the AppPool with the Local System.
The Solution
There is a Possibility to use Domain Users in an Local TFS. The Problem in Authenticating is, that the Server cannot look up the User. But if the User is directly inside the Database Tables (group_member), the Server does not have to look up for the User and the Authentication succeed.
To test that, simply put an Domain User in the Membership Table of the Group "Team Foundation Administrators". Now, you can log on into the TFS Server.
Step By Step
But how to do that practically for a bunch of Users?
We combine both of the Ideas.
- Change the Identity of the AppPool to Local System (TFS AppPool)
- Open Visual Studio and Log into the TFS with an Admin Account.
- Create a new Group for your Users
- Add all Users that should have access to the Server (no Groups. only single Users, so they get looked up an cached)
- When finished, change the AppPool back to the Local User
The only drawback from this Solution is, that while you are adding Users, the TFS is practically useless. And also you have to add each new User manually. But for evaluation of an TFS this is pretty nice, since you can just do that on an Test Machine.
Links
Some links about TFS
MSDN TFS Documentation : http://msdn2.Microsoft.com/en-us/library/ms181232.aspx
Rob Caron's Blog : http://blogs.msdn.com/robcaron/
TeamFoundationServer.org : http://teamfoundationserver.org/web/default.aspx
Maybe Rob can tell us, why the team foundation server really needs an domain user, beside of lookup users.
Yesterday I refactored one of our projects and needed to go thru many of the files. and as always, when I see some strange stuff, I cannot leave it and have to correct them (damn perfectionism). so here are the common strange stuff, that should have never made it into the code.
If you have questions to one or the other, just post a comment and I'll explain it a little bit deeper. I'm always happy about response.
Don’t access Indexer of Objects more often than needed.
These Indexers are the Request.Querystring[“blahblah”] stuff.
That rule is first of all depending, on what the Indexer does and how large the Collection is. Bigger Collection means longer time to find your entry.
Basically when you access it in one code block more than 2 times, its better to create an local one.
Be aware, that this is some sort of caching (the value of the variable don't get updated), so its preferred to do this in local code blocks and not in classes with longer lifetime.
Benefits:
+ Faster : since indexers have to go thru the collection on every access.
+ Better Readable : there's less code, an local Variables describe the Data in it better (most times...).
+ Less errors : you can check once if the data in the local variable is okay. (ever saw Application.Items["blah"].ToString()? what's if this item is not present in the Collection?)
+ Threadsave : Your local value don't get changed in your codeblock.
Use string.IsNullOrEmpty and int.TryParse
These are one of the most often checks and you see the same checks in very different ways. It's not easy, when you get an Object, or access these Indexers, to verify that its filled and have the right Type.
Instead of:
object myObj;
int myInt = 0;
try
{
myInt = int.Parse(myObj.ToString());
} catch {}
use:
object myObj;
string myString = myObj as string;
int myInt = 0;
int.TryParse(myString, out myInt);
the Integer gets filled, if its possible or left Zero.
For the Strings there are many possible checks.
The best is
string myString;
if(!string.IsNullOrEmpty(myString))
//do something when string is filled;
That's Equal to
if(myString != null && myString.Length > 0)
//do something when string is filled;
To verify the Length is the best possible Way, because here are no Memory comparing needed since there is no other String involved.
Use the using Statements
When you use namespaces more than once in an class, try to use the using statements. you can also assign it also to an Shortname (like using ctrl = System.Web.UI.WebControls).
+ Better namespace refactoring : we renamed some namespaces due to rebranding and it was a Pain in the Ass to merge the Stuff with other Branches because the changes of the others had the old Namespaces.
+ Better readability : due to less code. depends on the good chosen names of the classes
- Double chosen Class Names : some Classes have the same name, and so the vs does not know, what class to use, when both Namespaces are in the using Region
Don’t cast too often
First, don't use the "is" keyword when you cast it afterwards.
object myObj;
string myString;
if (myObj is string)
myString = myObj as string; // same as myString = (string)myObj
Here the Framework has to make the casting 2 times. once for the is, and once for the real Conversion. Better do it directly and verify if it's not null. (only possible with reference Types).
object myObj;
string myString = myObj as string;
if (myString != null)
//do stuff
Also, when you know that there is an specific Type in an Collection, cast it directly. I often see that with Integers in an object Collection. Its pretty the same code like the one I used to show int.TryParse().
Flatten Conditional
Like suggested in the Framework Design Guidelines, this make the code much easier to read and complex Code easier to understand.
Basically, it says, don't use too much nested if's.
Instead of
if (true)
{
foreach (object var in collection_to_loop)
{
if (true)
{
//do something
}
}
}
Use
if (false)
return;
foreach (object var in collection_to_loop)
{
if (false)
continue;
//do something
}
Don't Log exceptions twice
This is not an Rule for every Project. At my current Project we are the only one who uses it, and have done a pretty nice logging Structure. But as I read the logs, I often see the same Messages multiple Times with different Information. That's hard to get the complete overview of what happened. So, when you are returning an Exception, don't log it also. but fill the Exception with as much Information as possible.
Use The Comment Task List feature
In Visual Studio there is a pretty cool Feature, that if you start a Comment with "//TODO:", a Pointer to that Line is added in the Error List Messages on compile Time. So you can find easily Tasks that you have just defined in the Code itself.
I would suggest, that if you have a bigger Team, also add your Name in the Comment, so everyone knows who created that. You can also add more Tokens that the vs should watch for (Tools->Options->Environment->Task List).
Make Shared Code
If you feel, that you write the same Code over and over (like converting an Object from an ObjectCollection to a Type and verify, if it contains Data), make a shared Method out of it. normally its easy to find an good place. if not, I would suggest to make an "I dunno where to put that" Namespace (often like Utils.Misc or so) and give It there a good description. You can refactor that with someone else later.
Stick to your Architecture
When you defined, that you want to use an 3-tier Architecture, then do that so. As longer a Project exists, as more Violations of such Stuff are done. If you are really in that hurry that you cannot stick to your Architecture (I think that's never the case...) than mark that Code as an Task for refactoring with an todo Comment.
so, that's pretty all for now. I know, there are many more tips out there. but no time to write them all.
There it is. I Shout it out. Now we really started working on the long awaiting next release.
What is RoyalTS?
For those, who doesn't know it. RoyalTS is an manager for Remote Desktop connection. in the current version only supporting the RDP protocol. completely coded in C# and open source.
What are the features for the next Release?
The next release is completely done from scratch. so there is plenty of work to do. here are the main features we plan currently:
- Nested folder Hierarchy : the folder structure is complete up to you
- More Protocols : so you are not limited to administer only windows machines any more
- Plugin interface : you can write your own protocol implementation and integrate it. we also plan to have something like a "verified Plugin list" so you don't get some suspicious plugins
- Keychain : credential management. secured/encrypted with your local user. none other can use your stored passwords
- XML file Format : all configurations are written in XML. edit as you like.
- Tasks : simple commandline tasks you can execute for one or more machines. pretty like in MoM
- Pre Connect requirements : e.g. dial VPN before connect.
This is our Main Feature List, that you all can expect in the final version.
There are many, many more ideas on our wishlist. depending on time and complexity of each, we'll implement them sooner or later.
The Team
Basically all of the code4ward members are working on this Project.
7 People that meet each month and review the Process. so we think we are pretty sure to have a consequent proceeding in finishing the program.
I also want to say, that I'm really glad to be in that project and that its a great team. nevertheless, this is an fun project, and so we don't have the time that companies have for their projects.
When do I get my Hands on the next Release? what is the current Status?
We delayed the Timeline definition to our next meeting. since there were some more prototyping and evaluation in specific parts needed.
But, we have some of the program already coded and currently working on the basics. Architectural stuff and what you always need. (file handling and so on).
Currently the next planned release is Alpha.
This should be something like the version 1 redone with the architecture of 2 but missing the most of the features. so you can start using this version, but don't have real enhancements there. like the RDP Plugin will be directly in the core assemblies and no public Plugin interface. I really would like to have it done till the end of the year, but it seems to be January, when we can release it.
An more detailed Roadmap will be available after the next meeting.
What happened with 1.5?
That release is dropped. we tried to implement some of the really needed stuff that can also be reused with the v2 version branch, but there were too much incompatibilities, so we directly started with v2 and added this "alpha" release, that should be something like the 1.5 with a cool new base.
How can I Contribute? What's with my Ideas?
First of all, many of the Ideas come from people that are using it. Thanks for all of your suggestions. They are great.
If you have more, I would first suggest, posting them to our code4ward Forums. here we can keep track on all the wishes.
The Project itself is Hosted on codeplex.
there you see directly how the process is ongoing.
If you want to contribute to the project or have an direct talk, the best thing is to write it into our forums and we'll contact you.
What's Next?
We'll keep working on it. I try to post about the status about every month. or when we do some cool features explain them directly here (maybe after the alpha release)
Special Thanks to Stefan, for the Guidance of our Team and the Project.
p.s: we know, what the codename means, and choose it because of that... this is a big, big release...
So, time has come, that I also post my A-list.
I just put them together because some of my colleagues wanted to have an starter list. overall I subscribed now to more than 200 feeds.
First of all, we have some linklisters. They post only links to other feeds.
Jason Haley is really an essential information. think at least 1/4rd of my feeds are subscribed after one of his posts
A Continuous Learner's Weblog has also an good linklist.
Software designers
These people post about how to make better software most of the time.
So most posts are not directly code, but helps you with your PC time.
Scott Hanselman Definitive one of the best sources for developers. His tool lists are the best out there.
ScottGu's Blog Always good tips for .net developers. great code.
Sam Gentile Also a good read. Like all of the codebetter.com guys. If you want to search for more, go to their startpage and look at the blogs of the others.
James Shore Successful Software Often criticized and sometimes different to what all others are thinking, but often really good articles.
Newsfeeds
Neowin.net Everyone should know Neowin… they have also 2 other feeds (software & games). always great news source
Engadget Much to read, but their content is so good written.
Videos
Channel 9: The Videos The MS videos from inside. Always very interesting, if you have time to watch. I know there's also on10.net and others. but I like more the really technical videos.
There are also pretty good MS automatic feeds out there. I subscribed to all .net 2.0 kb articles that comes out. But they are most times not interesting.
Geek Stuff
Solution Watch Presents new companies with new ideas. so web 2.0 stuff
TechCrunch The best web company review page out there. With more than 120k subscribers
Website Updates
What's new for Writer Plugin rss feed for Windows Live Writer plugins
CodeProject c# Everyone knows codeproject. Always an good source. But be aware, when you use code, check their license.
Dotnet & co
Programmer feeds
Coding Horror Has deactivated his images in feeds... , but has good content
If broken it is, fix it you should Tess makes debugging at Microsoft. Best articles for hardcore memory debugging
Dotnet BCL team Team blog of the BCL team (the core language team) always good tips for performance
Chris Donnan : Programming - Brooklyn Style I really like his articles. But they are most times not really .net related
Rico Mariani's Performance Tidbits One of the best .net performance blogs. And always has also the explanation why it is so
.NET slave Much code. Most times not the best solution, but always nice solutions for common problems
Greg Young Another codebetter guy. I like his Contests.
Infinities Loop Asp.net stuff. Reveals some of the mystic behind .net
Nicholas Allen's Indigo Blog Always good to keep up to date what's with indigo (wcf). But hardcore code, if you are not familiar with the framework
Signs on the Sand XML Stuff
Clemens Vasters: Enterprise Development and Alien Abductions Most about the WinFx.
K. Scott Allen Odd To Code. Good code examples
Oliver Sturm's weblog Also good content for .net. his electric editing visual studio plugin is a must. one of the developers at DevExpress (I love your tools)
Smart Software Nice info about software development
Rick Strahl's Weblog Another blog with much code
MS Business
Blogs that blog about business stuff, mostly Microsoft.
Ray Ozzie The Technology chief himself. would be nice, to have more posts from him.
Mini-Microsoft Some anti Microsoft thoughts from one inside. Sometimes a little crazy stuff and pessimistic.
Scobleizer The guy who created channel9. But has left Microsoft. Blogs a little bit too often. Had better times… :-)
msgoodies Always nice info about MS.
The Old New Thing The guy, that really knows, why something was done this way. Also wants 100% backcompatibility (maybe you got some of the discussions about that….)
BlueScreenOfDeath's Blog Hmm.. always nice beta info. But site seems to be offline… bad…
Microsoft team blogs
Jensen Harris: An Office User Interface Blog The definite office07 info blog
Microsoft Research Downloads All new downloads from MS Research. Every time cool tools
live.com blog What goes on at Live.com
Microsoft Research Publications All Publications. Sometimes hard to read, but as always good ideas.
MrDave's (David Yack) Blog! Team Foundation server guy. Many useful things about it.
Mobile
MobileCrunch All about new companies dedicated to mobile. part of TechCrunch
UberPhones Every new handset is listed here… was long time a fan of MobileMentalism. but since they don't send their pictures any more to feed readers...
W3C Mobile Web Best Practices Working Group Best practices for mobiles. Just released as a draft, so always good to have more info's.
bluepulseblog About the platform bluepulse. Program once, run on many handset. That’s their idea. Have also posts about general mobile topics.
Other Feeds
10,000 Monkeys - Harnessing The Power of Typing Monkeys I like his posts. Sometimes crazy.
Russell Beattie Notebook Very sad, that he stopped posting. Was a very good blog. (not included in the list)
Attached I have 2 feed lists. the small and the big one. also at the small one, there are some that are not mentioned here...
Hope you enjoy the list.
Update:
Heh, forgotten to add the opml feeds....
Short OPML feed
Complete OPML feed
Also Accessable thru my opml.org page
Technorati tags:
Alist,
a-list,
blogs,
opml,
feeds
Is it so hard, to make rss readers?
I cannot find any reader, that has all my features implemented. most of them lacks of some of the "core" features.
What I really need is:
1) river of news (oldest first optional)
2) good reading pane, fast display of posts
3) folder with options (mark all read,....)
4) and direct tagging of feeds and posts
5) searching in tagged stuff.
6) rating of feeds with more than just a checkbox
and the most readers fail on the last 2. some also on point 3.
none implement point 6.
Currently I'm using FeedHarvest. its pretty cool done. good interface (3pane) and has tagging for posts, smart feeds (posts by keyword. also an cool feature). missing only the 6th feature. browser based.
wanted to try rojo. since it has also pretty much of my points. but the UI has really some bugs, where you cannot read posts... bad....
the third, that I really hope that they implement the direct tagging support is Flock. that is a Mozilla based browser with social additions. and there all of the favorites can be stored in del.icio.us. also the rss posts and therefore tagged. the only bad thing is, that you have to open after "starring" to the fav folder and add the feeds. no direct access.
I', pretty near of making my own rss reader. but I cannot even use an good web rss reader as my store, since they don't have enough features there. maybe using an normal web based rss reader as store and using del.icio.us as my fav store. huh. that will be much work.