Search This Blog

December 31, 2012

TFS 2010 Build Number Format


In TFS 2010, Build Number Format in Build Definition uses date format by default. For example, here is the Build Number Format.

$(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.r)

TestBuild_20121231.1

TestBuild_20121231.2

TestBuild_20121231.3
....

The build number is incremental on Dec 31, 2012

If our project would like to use Major release 2 and Minor Release 1, the following build number format can be used easily.

$(BuildDefinitionName)_2.1.0$(Rev:.r)

ProjectName_2.1.0.1

Projectname_2.1.0.2

Projectname_2.1.0.3


Can we put the following Build Number format? The answer is no because the following screenshot will appear.

$(BuildDefinitionName)_2.1.$(Rev:.r).182.



You can modify the Build Process Template (xaml) to meet your need of Build Number format as well.

December 30, 2012

Date format localization causes the Issue on ArcGIS Rest API


Our project is using Silverlight 5 and ArcGIS Rest API. We are very happy that the product is live in 7 countries now.

Recently our users in some EMEA countries reported the issue saying that they can’t use some important features in their local machines.  This makes me think that it is the localization issue.  Developers always use English Operating system and IE (en-US) to develop the important features. Of course, there is no issue in their local machines. Testers can’t find those localization issues, either. We need to narrow down the issue and see if we can still repro them. 

It makes me think of some scenarios:

IE French (fr-FR): causes the issue when testing

IE Germany (de-DE):  no issue when testing





Change system Locale to French or Germany and use IE (en-US): No issue when testing.




Change date format to French and use IE (en-US): causes the issue when testing.

Change date format to German and use IE (en-US):  causes the issue when testing.

Change date format to Chinese (PRC) and use IE (en-US): causes the issue when testing in another feature.




Since our product is live in 7 countries, we need to narrow down the issue and finally we find date format in localization causes the issue all the time for some important features. It is easy for our developers to fix the bugs quickly.

We also notice that ArcGIS Rest API can’t handle localization of date format in some EMEA countries very well. In this case, it is out of our control. We need to report the bugs to ESRI.

The quick workaround is to ask users to change the date format to English (United States), it will work.

December 28, 2012

Successfully upgrade Windows 8 to Windows 7 on HP Pavilion G7-2240US and fix the issue of Windows cannot be installed on this disk. The selected disk is of the GPT partition style

My wife got the new HP Windows 8 laptop (HP Pavilion G7-2240US) last week. After she played around it, she didn't like Windows 8 because there was no productivity in her daily job tasks. I totally agreed. 

I don't understand why Microsoft removes the function of disabling Metro UI in Windows 8 RTM, but it was allowed in Windows Developer Preview Version. I have no complaints about Windows RTM in Tablets or Surface Computers. I do have complaints about there is no Windows 8 desktop version for laptop like Windows 7.

She wanted me to "upgrade" Windows 8 (Consumer version) to Windows 7 in this new HP laptop. Here are my steps:

Use F10 key to go to BIOS setup. It has the function called Legacy support. We need to enable it and it can let us install Windows 7.  EFI BIOS will be disabled automatically.

Use Internal CD ROM to boot Windows 7 CD

When installing Windows 7 x64, the setup screen told me to install Windows 7 in a new partition disk. However, I got the error dialog box saying Windows cannot be installed on this disk. The selected disk is of the GPT partition style.

Don’t panic.  Use Shift + F10 and it goes to command prompt.

Enter the following command

diskpart

List disk

Select disk 1

Select partition 1

Clean

Convert mbr :

If I didn’t use clean command, I could not convert GPT to MBR successfully.

After using clean command, I converted GPT to MBR successfully. After rebooting the machine, I installed Windows 7 without any issue.

If you don’t like Windows 8 on your new laptop, you can try to "upgrade" it to Windows 7 and meet your needs. 

December 27, 2012

Test List Editor of VSTS 2010 is deprecated in VSTS 2012


In Visual Studio 2005/2008/2010, we can drag the selected tests from the Test List Editor into the test list. This is a good feature, but it is deprecated in VSTS 2012. The new feature is called Test Explorer.

If you have 1,500+ unit tests in Test List Editor  in VSTS 2010, it is not easy to upgrade those tests in VSTS 2012 because it is deprecated. 

Do you think Test Explorer is user friendly compared to Test List Editor? 

December 20, 2012

TFS Build: When Automated Tests Fail, TFS Build Fails


Yesterday I saw one guy asking one interesting question in MSDN forum. The question can be extended: If automated tests (unit tests, web tests, DB tests, WCF tests…) via MSTEST fail in TFS build, TFS build needs to fail.  It is easy to configure in the TFS build definition:

Open TFS build definition

In Process tab, expand Automated Test

Set Fail Build On Test Failure = True (False by default)





When you queue a new build, TFS build fails as long as one test fails .

In TFS Build definition, I like to Build 2 projects with default platforms and configurations. One is to build Developer project and the other one is to build TEST project.

If TFS can build 2 projects successfully and then run my automated tests, sometimes tests fail due to the code change (service change, DB change) and you are not aware of it. In this case, you can’t make TFS build fail because you need to modify your automated tests.

Therefore, I don’t encourage people to Set Fail Build On Test Failure = True.

If TFS can’t build Developer or TEST project successfully, TFS build fails.

If TFS can build Developer or TEST project successfully, and some automated tests fail, TFS will show Build partially succeeded.

In this case, you can investigate the issue and log the bug or modify your automated tests if required.

December 18, 2012

Fix the issue- TFS Could not connect to Outlook


Today, when I opened Visual Studio 2010 Ultimate to connect to TFS 2010, I would like to send a bug to my manager via Select Selection to Microsoft Outlook. I got the following error message.

TFS242402: Could not start or connect to Outlook. This problem can occur if Visual studio is running full administrator access and outlook is not. If Visual Studio is running with full administer access, close outlook, and reopen Outlook using the Run As Administrator option.





Therefore I have one thing in my mind.  Let me try the following scenario and I get the interesting result.

VS 2010 (No admin right) & Outlook (no admin right)

If MS outlook is open already and choose Select Selection to Microsoft Outlook in TFS, the bug template is in the Outlook.  I can connect to Outlook

VS 2010 (admin right) & Outlook (admin right)
If MS outlook is open already and choose Select Selection to Microsoft Outlook in TFS, the bug template is in the Outlook.  I can connect to Outlook

VS 2010 (admin right) & Outlook (no admin right)

If MS outlook is close and choose Select Selection to Microsoft Outlook in TFS, the bug template is in the Outlook.  I can connect to Outlook

If MS outlook is open already, choose Select Selection to Microsoft Outlook in TFS, I get the error message above.

VS 2010 (No admin right) & Outlook (admin right)

If MS outlook is open already, choose Select Selection to Microsoft Outlook in TFS, I get another error message –Another version of Outlook is currently running. Close it and try again.



My outlook is still the same. Why says another version of Outlook is currently running?  That really confuses people.

Next time if you have this interesting issue, please make sure you use the same right in MS Outlook and Visual Studio. The issue will be resolved.

December 17, 2012

Simple Solution- force browsers to reload Silverlight .xap in user's machine for the specific Production Release


I wrote the post on July 17, 2012 entitled Silverlight .xap needs to be updated in the users’ laptops after pushing a new build. But recently we noticed that .xap file is not updated in user’s machines after we push new change to Production.

The quick workaround for them is to clear the caches in their local machines and hitting the site again will download the latest .xap and .zip files. However, it is not user-friendly.

That being said, we need to force browsers to reload Silverlight .xap in user's machine after we push to Production. Silverlight .xap versioning seems a good idea. 

Actually, I have one simple solution: using different .xap name for the specific Production release. For example, if we have the 12/17 release, we can use XXX1217.xap as the naming convention.

When I use TFS to merge the code from DEV Branch to TEST branch, I can modify the following settings for our Jan 10 release, 2013.

Default.aspx:

Before- param name="source" value="ClientBin/Sprint2.xap"

After - param name="source" value="ClientBin/SprintJan10.xap"

Unload Project and Edit Project file.

Before – XapFilename>Sprint2.xap

After -   XapFilename>SprintJan10.xap

In ClientBin folder, I delete Sprint2.xap first.  After building the solution successfully, I can see sprintJan10.xap in ClientBin Folder. After pushing a new TFS build, the build is successful. When I hit Silverlight Application and check the following folder, SprintJan10.xap is really there.

%USERPROFILE%\AppData\Local\Microsoft\Windows\Temporary Internet Files\



Next time if users have the issue, it is really for me to know if they have the specific Silverlight .xap file for our specific release.


December 13, 2012

Fixed TFS 2010 Build Error – The type or namespace name does not exist in the namespace


This morning when I came to the office, I saw many check-ins from developers last night  and TFS build in DEV environment complained about the following error . The build failed.

MainPage.xaml.cs (21917): The type or namespace name 'XmlSerializer' does not exist in the namespace 'System.Xml.Serialization' (are you missing an assembly reference?)




When I used Visual Studio 2010 IDE to open the solution file and build the solution, there was no issue.  Using MSBuild command line to build the solution in my local machine had no issue at all.

When I unloaded Project and edited Project file, I didn’t see the following file (yellow part) in the project file.

<Reference Include="System.Xml.Serialization, Version=5.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>..\Lib\System.Xml.Serialization.dll</HintPath>   
    </Reference>

After adding it and pushing a new build again, the build succeeded.