TFS Sync & VS Bugz :: Tip o' The Day

If you receive this error, “TF31005: Team Foundation cannot retrieve the list of team projects because it cannot connect to Team Foundation Server”, or if you are debugging and the code you see on screen is not what is being stepped through or you see VS stepping through white space lines, try this out.

Clear out the cache here on Vista…

C:\Users\userName\AppData\Local\Microsoft\Team Foundation\2.0\Cache

.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, “Courier New”, courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

…or try clearing out this directory on XP/Server 2003.

C:\Documents and Settings\userName\Local Settings\Application Data\Microsoft\Team Foundation\2.0\Cache

.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, “Courier New”, courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

This should get the ball rolling for Visual Studio & TFS Synchronization again.

UPDATE:  This thing kept nagging me throughout the day until Denis (coworker) finally got into the logs and found this “Invalid length parameter passed to the SUBSTRING function“.  This occurs, usually, right after a SP1 upgrade on the TFS Server.  After poking around a while Denis found this KB.  After running a simple update statistics…

use tfsintegration

update statistics tbl_security_identity_cache

.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, “Courier New”, courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

…all was running flawlessly after that.  Only an 8 hour day lost.  🙁  But hey!  At least this helps somebody out there!

Implementing Enterprise Library Architecture Part 2

In the last entry I covered several points about using the Policy Injection Application Block (PIAB) for some AOP based cross cutting work.  If interested, check out Part 1.

  • Setting up IIS for Self Signed SSL Certificates on Windows 2003 and Vista.  Mention IIS Toolkit, etc.
  • Show IIS security settings for Windows Auth, Basic, Digest, Anonymous, etc.
  • Setup a REST based service and a SOAP based service.
  • Setup the web.config file for the IIS based services for basic authentication w/o SSL use.
  • Setup the web.config file for the IIS based services for basic authentication w/ SSL use.

Part 3

  • Setup a client for access via ASP.NET MVC.
  • Setup a client for access via AJAX/JavaScript.
  • Setup a client for access via Silverlight.

More notes:

  1. State differences between Windows 2003 and Windows 2008 (XP/Vista or IIS 6/7).  Namely the various states of execution needed for Vista/08 for the project to run in elevated administrator access.

  2. State short steps, then state elaborated information for each of the configuration/code segments.

  3. Make sure to point out these articles for summary:  http://www.leastprivilege.com/FinallyUsernamesOverTransportAuthenticationInWCF.aspx

  4. Report on the various exceptions for Windows Vista & lack of immediate availability of security elevation for self hosted apps.

  5. Report on the differences.

  6. What is the System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel exception??   http://weblogs.asp.net/jan/archive/2003/12/04/41154.aspx  !!  agggh  !!  http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/bb0fc194-5bf3-4c24-94bb-c86f94c76bc2  …  http://community.salesforce.com/sforce/board/message?board.id=NET_development&message.id=3290   …

WCF Security Sucks.

There, I’ve said it.  Now don’t get me wrong, I don’t mean the actual security itself, it is just fine.  I mean implementing the mess.  WCF security has so much configuration, by the time one is done sorting through the deluge of options then they run into the blasted use case of transport, SSL, and a whole host of other things.

With WCF, generally, if you want security, go get SSL running NOW.  Don’t even beat around the bush, just go do it.  I learned this the hard way and fought and fought and fought with the damned thing.

I simply wanted to enforce a standard username and password schema on REST Services.  How hard could it be I thought?  Well, it isn’t really hard, but it sure as hell is frustrating, confusing, and somewhat asinine in nature.  In addition to that IIS supports some security methods, windows service services support others, and the delusion of what goes with what gets more confusing the more one digs into all of this cluster of a mess.

The simple fact is, web services don’t secure in a logical straight forward way because services weren’t built with security, they were built primarily to be wide open.  Not kind of open, but totally open.  Go read the original documentation on the things and you’ll see.  So were does that leave us?  The business world that wants some security around the services that is quick to build, fast to access, easy to scale, etc?  Out of luck, that’s where it leaves us.

So now that I’ve spent the first 4 paragraphs of this entry complaining about the flagrant mess that are web services, WCF, and the associated stacks, here’s how one can build out these for true Internet use in the real world.

Building WCF Transport Enabled SSL based Security

Ugh, first, setup the blasted SSL certificates needed for development.

…

http://www.leastprivilege.com/FinallyUsernamesOverTransportAuthenticationInWCF.aspx

This is exactly what I want to do… now the question is.  Will it work.  The various pending requirements are INSANE.  UGGGHHH.

…

Try a secure WCF service via a hosted console service.

Try an IIS SSL enabled virtual directory based WCF service.

TFS Fight and Some TDD

I started working on a new project a few days ago that has been dubbed Cockatoo, which we have hosted on Codeplex, by the team I’m working with.  For those that are curious who these 3L173 d3\/3L0P3r$ are I’ll run through the names;  Jason Mauer, Josh Wisely, Erik Mork, Monica Mork, Kelly White, and…  we might have more.  Want to join the team?  Send me a message at adronhall at symbol gmail [.] com…

Anyway, I’ll jump into some of the first steps I’ve taken to get rolling.  My task is to create an assembly that will wrap the Twitter API so that the methods are abstracted into simple object method calls instead of instantiating and working through all the various HTTP communications.  As always, I try to stick with the TDD style and thus jumped right into the test code.

Services Are Coming!

The WebTrends REST Services are coming!  These services will provide a wide array of data that can be retrieved from various sources in your WebTrends Profile, the various custom reports, and displayed in any way you need.  Once can connect with Silverlight, Excel, Windows WPF, WinForms, Adobe AIR, Adobe Flash, Java, or almost any platform that you choose.

The reason we chose REST is because of the ease of use, easy of understanding, and design that is inherent to the REST ideals.  In addition almost every major Internet Company Presence that provides services is using REST, which provides even more interoperability for our clients to connect disparate data sources.

In this entry I am going to cover the following material you’ll need to connect to WebTrends REST Services.

  • REST API Concepts
  • Asynchronous Calls
  • Calling a REST Service in C#
  • Displaying the Results

ALT.NET Seattle – My 2 Cents

First off, I have to say ALT.NET Seattle kicked ass.  Plain and simple, it is awesome to be able to hang out with a bunch of alpha geeks.  The level of discussion starts high and the topics generally stay informative and helpful.  The following is a quick summary of the sessions I jumped into and what we covered in each.

Sara Ford – Code Project Site & Agile Process

Sara Ford is the PM for the Code Project Site.  During the session we discussed the various aspects of her team moving from Waterfall to Agile and the points of contention they have and have had.  Sara mentioned that she’s moving from 6 years of Waterfall and being de-institutionalized so she can work agile.  I couldn’t help but think, that is a very realistic way to describe the process.  Waterfall imprisons a team and one really has to work to get out of that.

Currently the Code Project team that Sara in PM of does 1 week iterations, pair programs, has continuous integration, and has the iterations broken out like this;

  • Iteration 1 is new features.
  • Iteration 2 is new features and bug fixes.
  • Iteration 3 is bug fixes and final branching for the drop.

Two subsequent steps after these three, is regression and deployment.  Both which occur outside of the developer’s 3 iteration cycle.  After iteration 3 the team starts on a new iteration 1 to begin the cycle again.

Also mentioned was that

Sara Ford  –  Code Project site & Agile Process

Team doesn’t do stand ups because of the single room.  If someone needs to know where things are, they are expected to inquire themselves.

…

—

Scott Hanselman – Why so mean.

Alpha Geeks

Phil Haack / Karen / Eaun

Phil talked to current focus at MS.  TDD & Microsoft

Karen displayed – New intellisense feature so that one can do TDD.

Euan & Karen showed how the new unit tests will do exactly like I blogged HERE.  🙂   Makes me a happy developer.

Deployment is also fixed so that tests run out of bin instead of the OUT directory.  This will resolve a fair amount of issues.  It will be a setting in Test Tools – > Test Execution under the Tools menu.  “Limit number of test results to:”  and make it 1 or something that will limit the number of files.

The fact that that MSTest isn’t specifically built for unit testing.  It is NOT the best for Agile (from MSTest Euan) and definitely not particularly good for TDD.

After a good debate & conversation one thing that was applauded was: private test accessors are being deprecated and WILL BE removed in the near future!  This is good news as the private test accessors really perpetuate bad practice.  Unfortunately the ordered tests and test generations are still going to be in the box, but the MSTest Euan did point out that these used for unit tests are a bad idea and also perpetuate bad practice.

euang@ms.com

DAY TWO

Extreme w/ large teams

Oren/Ayende came and spoke on various testing practices.

Feature == 2 hr of work.

testing based on features.  i.e. no real unit tests, but feature testing to assure space.

Seems like when a clear separation of concerns is implemented this is more possible then when not.

A contention of senior vs. junior developer came up.  Alex Hung of Thoughtworks brought up that there should not be this separation in an agile team because of pairing.  The separation is eliminated at a rapid pace when pairing, and thus a major point of Agile.

Ayende posed with the question “what would you do to segment work if you where rebuildnig VS.NET” – his response “get JetBrains to do it”.

….

after that I hit up a few different things…

Oxite review pt 2.  Oxite is better now & Samper is handling gettin’ that straightened out.  Oren/Ayende offered some insight and ideas also.

…

LINQ session for a few minutes.

FP – Functional Programming – F#

Discussing insurance calculation type application.  Basic asynchronous execution for multi-threading multi-proc multi-core against.

One note was that if C# objects are used – and they’re brought in via the imutable keyword than yer screwed.  Gotta bring them in without imutable and just run calcs w/o making changes to the objects.  Speeds up big time because it is then thread safe.

Lazy evaluation – functions – imutable types

The real question of the session for FP though :  How does one know WHEN to use F#.

Large datasets are being used for processing.

OOP C# is too much overhead.

Much of this comes down to F# is less “wordy” than C#.

…

What are the patterns of multi-paradigm programming.

What is functional not appropriate for?

RDBMS are dead – James Avery – Oren took over.

Alternates:

  • ACID vs.  BASE (not alternative, concept to know)
  • Document – Couch DB, SDS, SDB
  • Key Store – Memcache, RDHT, Dynamo
  • Object – db4o
  • Column Database – hmpf
  • Row Database – hmpf
  • Big Table / Big Tree

Again – Oren jumped in after James Avery got talk started.

ACID fails w/ RDBMS upon scaling.

App level assumes more responsibility but scaling increases.  ->  elaborate for discussion.

Shopping cart uses this for Amazon.

Consistency lacks…

Oren – Building Rhino DHT – always succeed a write…  consistency might be of contention.

massively scalable.

research :: dynamo (discuss with Mukesh)

Architetural decisions help define the database…  such as needing to control the schema or data store creation without having direct access to the database.  i.e. SQL Server can’t be changed – such as tables and views added – without specific permission can’t be done…  others such as key value or or document databases (couch DB) can literally store a database or whatever as the value of the key value.

…Oren – smart – period

Oren – Rhino HD.

replicated data store.  data is written to one place, then it is immediately replicated to other nodes stores…

Tim Brey – QCon – San Francisco – November

Jim Gray – Memory is the new disk, disk is the new tape.