DCSIMG
Baruch Frei
Sign in | Join | Help

August '11 TFS Power Tools Release

Published at Aug 19 2011, 04:13 PM by BaruchF

Yesterday Microsoft released the new version of the TFS Power tools.

See what Brian Harry blogged about it here.

First of all, the installation made simpler since you don’t have to

uninstall previous version, just install new version over the old one.

Only one thing  – the installation prompts that Windows Explorer

process should be close.

image

If you press Ignore reboot will be required.

Anyway, if you kill the mentioned processes through Task manager,

no need to reboot.

Here some of the new Features in this release:

  • WorkItem Search

image

  • Rollback on Changeset from history

image

  • Rollback from Source Control Explorer

image

Grab it from here.

Take a look also at the updated Build Extensions.

Enjoy !

TFS Web Access – Init Linked Query as Collapsed

Published at Aug 18 2011, 08:43 AM by BaruchF
When you open a linked WorkItem Query in TFS Web Access the

default initial state is expand all and if you have massive tree of

linked WorkItem it’s kind of annoying:

image

Today one of my customers asked me if I can change this default

behavior and make it appear by default with all nodes collapsed.

BTW, in Team Explorer there are buttons for collapse and expand all

but Web Access doesn’t offer this option as described here.

After a little digging in pages an java scripts I found the solution.

Disclaimer: The solution provided below is on your own risk.

On the server that hosts TFS 2010 navigate to:

C:\Program Files\Microsoft Team Foundation Server 2010\Application Tier\Web Access\Web\Resources\Scripts .

Find the file QueryResultGrid.js (backup original file before you make

any change). Open the file and find initialize function at the end of the

function before the line:

this.m_initialized = true;

Copy and paste this line:

this.collapseAllNodes();

The function now should look like this:

/*overridden methods*/
initialize: function () {
TSWA.QueryResultGrid.callBaseMethod(this, 'initialize');

this.m_rows = {};
this.m_gutterRows = {};
this.m_rowStack = [];
this.m_neededWorkItemsStack = [];
this.m_selectedRows = {};

this.prepareQueryInfo();
this.takeMeasurements();
this.attachDOMEvents();

if (this.m_queryInfo.isDirty) {
this.setDirty(true, false);
}

Sys.Debug.trace(String.format("Query ResultGrid on initialize"));
this.layout();
this.collapseAllNodes();
this.m_initialized = true;
},

Save and reopen web page.

That’s it !

image

How it works ? this Java Script dynamically creates the result grid  on

demand, if you will scroll down the file you will fund that the function

collapseAllNodes already declared, we just added a call to it at the

end of grid initialization.

Thanks to Shlomo for his help.

Workflow Designer Patch

Published at Aug 09 2011, 08:58 PM by BaruchF

Everyone who works with workflow designer (and if you are

TFS Build Developer – you do it a lot Smile) encounter the problem

with Workflow Designer slowness and crashes (happened to me

like 20 times today Sad smile) .

Today, Microsoft announce a patch for that !

This patch includes fixes to ASP.Net & Silverlight as well and other

35 issues and 6 features as you can find in KB 2468871.

Read more in Buck Hodges post.

Grab it from Here.

 

Happy Building.

TFS API–Upload Workitems Query

Published at May 06 2011, 04:55 PM by BaruchF

I recently got a request from one of my customers for code sample

how to programmatically upload Workitem query (wiql) to TFS.

Since the UI doesn’t allow import query from file but only create

new query in editor I decided to share it.

First of all, dealing with queries using API became a little complicated

in TFS 2010 because the folder tree support. I recommend a post

written by my colleague Shai Raiten as very good source to learn it.

(although in his sample code the save method for add/remove

folders is missing Smile).

Here is a code sample how to upload Query to Team Queries folder

   1: //define wiql to upload
   2: string wiql = "SELECT [System.Id], [System.WorkItemType], [System.Title] FROM WorkItems WHERE [System.TeamProject] = @project  ORDER BY [System.Id] ";
   3:  
   4: //create instance of project collection
   5: TfsTeamProjectCollection tfs =
   6:        TfsTeamProjectCollectionFactory.GetTeamProjectCollection(
   7:            new Uri("http://bf-lap:8080/tfs/defaultcollection"));
   8: //get work item store
   9: WorkItemStore wis = (WorkItemStore)tfs.GetService(typeof(WorkItemStore));
  10: //get desired project in work item store by its name
  11: Project teamProject = wis.Projects["VersionControl"];
  12: //get team queries folder
  13: QueryFolder teamQueries = teamProject.QueryHierarchy["Team Queries"] as QueryFolder;
  14: //create query definition in desired folder
  15: QueryDefinition queryDefinition=new QueryDefinition("My New Query",wiql,teamQueries);
  16: //save changes
  17: teamProject.QueryHierarchy.Save();

Result:

image

If we want to upload to any other folder than “Team Queries” or

“My Queries” first we have to find it in the folders tree.

So I wrote a recursive function to find desired folder.

   1: /// <summary>
   2: /// returns QueryFolder in given project by its name
   3: /// </summary>
   4: /// <param name="project"></param>
   5: /// <param name="name"></param>
   6: /// <returns></returns>
   7: public static QueryFolder GetQueryFolder(Project project, string name)
   8: {
   9:     return GetQueryFolder(project.QueryHierarchy as QueryFolder, name);
  10: }
  11: /// <summary>
  12: /// recursive find QueryFolder in Queries tree
  13: /// </summary>
  14: /// <param name="root"></param>
  15: /// <param name="name"></param>
  16: /// <returns></returns>
  17: public static QueryFolder GetQueryFolder(QueryFolder root, string name)
  18: {
  19:     if (root.Name == name)
  20:     {
  21:         return root;
  22:     }
  23:     else
  24:     {
  25:         foreach (QueryItem item in root)
  26:         {
  27:             QueryFolder subFolder = item as QueryFolder;
  28:             if (subFolder != null)
  29:             {
  30:                 QueryFolder folder = GetQueryFolder(subFolder, name);
  31:                 if (folder != null)
  32:                 {
  33:                     return folder;
  34:                 }
  35:             }
  36:         }
  37:     }
  38:     return null;
  39: }

Full code sample can be downloaded from here

Happy Coding !

Open Select User or Groups dialog

Published at Apr 27 2011, 12:57 AM by BaruchF

לפני לא הרבה זמן (כשעתיים – אבל זה שייך לאתמול Smile) שלמה גולדברג פרסם בשמי

Select User or Groups מחלקה שתפקידה להקפיץ את החלון.

. שאינם נצרכיםTFS אולם בדוגמת הקוד שהוא פרסם ישנם הפניות לאוביקטים של

לכן החלטתי לפרסם את הדוגמא הנקיה בלא אוביקטים מיותרים.

את המחלקה תוכלו לראות כאן

הפרוייקט המלא כאן

לאחר ההרצה נקבל את החלון הבא:

image

Team Foundation Server 2010 Power Tools–New Release

Published at Mar 04 2011, 07:32 AM by BaruchF

Brian Harry has just announced a new release of the

Team Foundation Server 2010 Power Tools

that includes new features, improvement and bugs fix

for existing features.

What I really liked is the enhanced Windows Explorer

Extensions:

image

With much more options.

Another graet improvement occurs in the Backup & Restore tool.

You can read about all new stuff  in Brian’s blog.

Download it from here.

CustomizableOutDir In Team Build 2010

Published at Feb 22 2011, 10:48 AM by BaruchF

The default behavior of Team Build is to override the Output Directory

defined in the compiled project and direct all outputs to Binaries Dir.

But, sometimes this behavior is not good either because of Solutions

dependencies either because we want our outputs in specific

structure.

In Team Build 2008 there was a predefined property for that reason

“CustomizableOutDir” that if it set to true output directories  are not

overridden.

In Team Build 2010 (as part of moving from MSBuild to Workflow) this

Property is gone.

A while ago Jim Lamb posted about a way to achieve similar results

in Team Build 2010 using “TeamBuildOutDir” property.

But, if you simply want to live Output Directory as defined in the

projects ,there is a simpler way to do it.

Just open Build Template in xaml editing mode search for this string

OutDir="[BinariesDirectory]" you will find it twice one in the
Clean Task:
<mtbwa:MSBuild CommandLineArguments="[String.Format(&quot;/p:SkipInvalidConfigurations=true {0}&quot;, MSBuildArguments)]" Configuration="[platformConfiguration.Configuration]" DisplayName="Run MSBuild for Project" GenerateVSPropsFile="[True]" OutDir="[BinariesDirectory]" Platform="[platformConfiguration.Platform]" Project="[localBuildProjectItem]" Targets="[New String() { &quot;Clean&quot; }]" TargetsNotLogged="[New String() {&quot;GetNativeManifest&quot;, &quot;GetCopyToOutputDirectoryItems&quot;, &quot;GetTargetPath&quot;}]" ToolPlatform="[MSBuildPlatform]" Verbosity="[Verbosity]" />
 And one in the Build Task 
<mtbwa:MSBuild CommandLineArguments="[String.Format(&quot;/p:SkipInvalidConfigurations=true {0}&quot;, MSBuildArguments)]" Configuration="[platformConfiguration.Configuration]" DisplayName="Run MSBuild for Project" GenerateVSPropsFile="[True]" LogFileDropLocation="[logFileDropLocation]" OutDir="[outputDirectory]" Platform="[platformConfiguration.Platform]" Project="[localProject]" RunCodeAnalysis="[RunCodeAnalysis]" TargetsNotLogged="[New String() {&quot;GetNativeManifest&quot;, &quot;GetCopyToOutputDirectoryItems&quot;, &quot;GetTargetPath&quot;}]" ToolPlatform="[MSBuildPlatform]" Verbosity="[Verbosity]" />

Just delete this argument and you are done.

leave everything else like this:

<mtbwa:MSBuild CommandLineArguments="[String.Format(&quot;/p:SkipInvalidConfigurations=true {0}&quot;, MSBuildArguments)]" Configuration="[platformConfiguration.Configuration]" DisplayName="Run MSBuild for Project" GenerateVSPropsFile="[True]" LogFileDropLocation="[logFileDropLocation]" Platform="[platformConfiguration.Platform]" Project="[localProject]" RunCodeAnalysis="[RunCodeAnalysis]" TargetsNotLogged="[New String() {&quot;GetNativeManifest&quot;, &quot;GetCopyToOutputDirectoryItems&quot;, &quot;GetTargetPath&quot;}]" ToolPlatform="[MSBuildPlatform]" Verbosity="[Verbosity]" />

That’s it!

Msbuild for Website & the slippery “_PublishedWebsites” folder

Published at Feb 13 2011, 03:30 PM by BaruchF

I got request from one of our clients about wired behavior of the

Team Build.

In some of the builds for Web projects the build creates a

_PublishedWebsites folder under drop location and arranges all

WebSites\WebApplications\WebService under this folder very nice.

But in other builds this folder is missing even though all web projects

compiled successfully. It just drops all compiled materials under drop

location.

As I remember it should just work Out Of The Box.

For testing I created new solution with WebApplication and WebSite.

Created simple build definition using default template and built it.

image

As you can see it worked !

 

After a little research it came out that this is behavior of the MSBuild:

When building Web Project in MSBuild if you specify an OutDir

property (for overriding the default OutDir specified in the project),

it creates the _PublishedWebsites folder under specified OutDir.

If you do not set this property (MSBuild will use Default OutDir from

the project) this folder is not created.

So, default behavior of Team Build is to override OutDir property in

order to send outputs to Binaries folder.But in this  particular case

Team Build used customized templates that do not overrides OutDir…

How to do it in Team Build 2010 in the next post.

 

Happy Building !

TFS 2010 - Build Details Log View Is Very Slow

Published at Feb 08 2011, 08:32 PM by BaruchF

A while ago I posted about a bug in viewing the Build Details Log

inside Visual Studio.

I’ve also submitted bug on the Connect web site, but the answer

was “suppress warning level”.

Now there are  news : A good one and A bad one.

I’ll start with the good one: This is officially a bug and will be fix

in the next release.

The bad one is that right now, if you have a big Project to build

that includes a lot of solutions and projects (we have like 70

solutions with more than 700 projects that all depends on each

other) you have nothing to do…

More details in Jason Prickett Blog in this post.

You can find some helpful tips there as well.

Happy Building !

ALM @ Tech-Ed Eilat 2010

Published at Dec 02 2010, 09:27 AM by BaruchF

שלום לכולם, אני יודע שקצת הזנחתי את הבלוג שלי בזמן האחרון (התירוצים הרגילים

משפחה,עבודה וכו’).אז Teched הוא סיבה טובה לחזור ולכתוב…

מתוקף תפקידי כיועץ בתחום של ALM השתתפתי בעיקר בהרצאות של מסלול זה.

ההרצאות היו מעולות עם האנשים הטובים ביותר בארץ ובעולם בנושא ALM.

 

הבשורה הגדולה !

 

אני חושב שהבשורה הגדולה שיצאה ביחד עם גירסת VS & TFS 2010 היא הכנסת

כל המשתתפים במחזור חיי הפיתוח לתוך TFS. אין יותר חורים אפלים ומשתתפים חשובים

בתהליך שאין להם כלים להיות שותפים מלאים בתהליך הפיתוח.

כוונתי בעיקר לארכיטקטים ומנהלים מצד אחד ולבודקים מן העבר השני.

חבל שמסלול ALM לא הוקלט אני הייתי רוצה לראות הרצאות שפספסתי ואני חושב שיש עוד

אנשים שהיו מוצאים בזה תועלת.

 

אז מה היה לנו שם ?

 

המסלול התחיל בבוקר היום השני ב8:00 בבוקר (מוקדם אני יודע) בהרצאה של צביה שסקרה

הן את הכלים החדשים והן את המסלול ומה נראה בכל אחת מן ההרצאות.

המשיך בהרצאה מעולה ומקיפה של Brian Keller על היכולות החדשות של TFS 2010.

ההרצאות הבאות התמקדו כל אחת בזוית מסוימת של הכלי ואיך מכניסים עוד מהמשתתפים

החשובים בתהליך לתוך התהליך.

ראשון דבר שי רייטן שאותו אני תמיד נהנה לשמוע ולמרות שאני בתחום הוא מצליח לחדש לי

לפחות משו בכל הרצאה (גילוי נאות-שי הוא עמית לעבודה בסלע).שי העביר הרצאה מעולה על

יכולות הטסטינג החדשות ב VS 2010.

לצערי בהרצאות אחה”צ לא הצלחתי להשתתף עקב התחייבויות אחרות אבל שמעתי (שוב לצערי

ההרצאות לא הוקלטו) שהיו הרצאות מעולות של ערן וקובי על מודול טסטינג ושל דן על DBA 

ו VS 2010.

 

היום השלישי התחיל קצת יותר מאוחר מהיום השני(לא לזלזל ברבע שעה שלימה בבוקר שאחרי

המסיבה), בהרצאה מעולה של גדי על כלי הארכיטקט החדשים.(היה שווה לקום).

לאחר מכן בעוד הרצאה של  Brian Keller על Agile קראו סיכום מאלף של גדי.

ולאחר מכן אחת ההרצאות החשובות לדעתי במסלול של שמוליק סגל (גילוי נאות-שמוליק הוא

עמית לעבודה בסלע). על איך משלבים את כל היכולות החדשות שהוצגו בכל ההרצאות הן של

הארכיטקטים הן של הבודקים והן של DBA בתהליך בילד אוטומטי.

שמוליק הציג סנריו מלא של תהליך הפיתוח הכולל הן ואלידציה של ארכיטקטורה הן בדיקות

UT וCoded UI והן DB Deployment והכל ללא מגע יד אדם.

סגר את המסלול אריאל גור אריה שדבר על UT ובעיקר TDD.

 

לסיכום היה כיף נהניתי לפגוש את האנשים שמאחרי הבלוגים והפוסטים וגם ללמוד דברים חדשים.

כמובן תודה ענקית לסלע שהביאה אותי לשם ובמיוחד לדודו וקרו שפקחו באופן אישי על הכל.

Command Line build – Bug & Workaround

Published at Aug 24 2010, 12:04 AM by BaruchF

In the last time I was working on updating one of our clients Build Machines.

We got a new muscular (virtual) machine with 2 cores and a lot of memory, but instead

of getting faster build they start to fail unexpectedly.

It came out that unmanaged (C++) solution that we are building in command line using

devenv.com is falling without any meaningful error in the log.

I’ve opened Visual Studio in build environment and everything works like a charm,

it compiles with no errors.

Building in command line using devenv.com from the same environment results an error

without much information.

After a lot of digging I found this thread says that build order is define by project

dependencies but there is bug in command line builds that if you have more than one

core it promises the start order of building projects but not the end order.

In other words: if Project B depends on Project A than Project A will be started first but

Project B won’t wait for it to finish and might start before on the second core.

(this problem doesn’t exist when building using Visual Studio IDE.)

So the only workaround I found is to set the “maximum number of parallel builds

to 1 (default is the number of cores you have) using Visual Studio IDE.

Tools==> Options ==>Projects and Solutions==>Build and Run

image 

(Unfortunately, MSBuild.exe & VCBuild.exe has /maxcpucount switch you can set,

but devenv doesn’t).

I know it affects Build Time But at least it compiles :-) .

TFS 2010 Upgrade Issue

Published at Jun 28 2010, 04:05 PM by BaruchF

If you already upgraded from TFS 2005/2008 to TFS 2010 or you

are about to. You must read Brian Harry Blog Post about potentially

serious issue of losing Labels content and Merge Data here.

According to Brian: ”Under no circumstance will it cause the contents of

any source code to be modified or lost”.

This issue caused by change of handling items in source control between

TFS 2008 Version Control and TFS 2010 Version Control, you can read

about this change here.

Since that change caused the issue it does not affect upgrading from

previous versions of TFS 2010 (Beta,RC).

Brian also provides a set of Sql scripts to check if you were affected or

going to be.

So check it out.

Team Build Summary Window in VS 2010 – Bug & Workaround

Published at May 13 2010, 10:06 AM by BaruchF

I just submitted a bug on Microsoft Connect in Team Build Summary

window in VS 2010.

First of all this page uses a lot of system resource. When you have real

Build with more than couple steps the CPU goes up to 100% usage &

memory goes up to 1 GB – 1.2 GB (depends on system memory).

The second problem is that if you have really a lot of steps like a lot of

warnings/errors, the page never finishes to load.

If you think “OK I’ll switch to another tab & go back later”, it’s not

going to work since when ever you live the tab it loses the cursers

position and when you go back it starts loading the page again. 

If you encountered  the same problem you can vote for the bug here.

Since this page renders the web access page of Build Summary and just

adds link to source code for every error or warning, there is workaround.

image

Right click on tab header and choose “Copy Full Path” then paste it in

Web Browser and you can review the Build Summary, But you lose

the links to source file.

WSS 3.0 – Change Web Site Administrator

Published at Dec 05 2009, 08:04 PM by BaruchF

WSS (Windows SharePoint Services) not like other systems doesn't inherit permissions from

the parent automatically.

Means that even though you are site collection administrator and farm administrator

and local computer admin (even if you are domain admin…) you wouldn’t have access

to Website created under that web collection.Unless the owner (Website administrator)

gave you explicitly permissions on the Website. If the user created the Website left the

company (or was recreated for some reason) and didn’t give somebody else admin rights

on this Website you are in troubles. Recreating the user is not solution because he will get

new Sid and wouldn’t have access either.

This problem also happens after upgrading from WSS 2.0 to 3.0 for some reason the

upgrade process removes all users from the Website except from the Website primary

site collection administrator that might be an old user.

So you have to take ownership (become admin) on this website, this is how you do it:

 

  • Open the WSS 3.0 Central Administration :Start-->Programs—> Administrative Tools—> SharePoint 3.0 Central Administration.

(By default its in “http://ServerName:17012”).

  • Select Application Management :
  • image

 

  • Select Site Collection Administrators :
  • image

 

  • Select Change Site Collection (click on the Site Collection url to open the menu).
  • image
  • Select the Website you want
  • image

 

  • Now you can change the Website Administrator:
  • image 

Good Luck !

More Posts Next page »