Category: Tips

  • Promise FastTrak TX4660 issue when used with NVidia MediaShield Raid

    Building a new machine, I have experienced the lack of compatibility between the Sata RAID Controllers from the FastTrak TX Series and some on-board Sata RAID controllers 🙁

    Click to Read More

    I have 6 Sata II controllers on my Motherboard “Asus Striker II Formula“. They support RAID thanks to the NVidia MediaShield Storage Technology.

    Yesterday, I plugged into a PCI-e 16x port of this motherboard a Promise FastTrak TX4660 controller card with RAID support.

    Unfortunately, the initialization sequence of the FastTrak (during the boot sequence) kept  blocked forever on the message “Press <Ctrl-F> to enter FastBuild Utility”. I was  unable to either enter this utility pressing Ctrl-F or continue the boot sequence (and start  the OS). And although the PC didn’t look completely freezed, Ctrl-Alt-Delete was not responding either. Notice: I was using a PS2 keyboard, just to be sure… as some USB controllers are sometimes not initialized before the end of the boot sequence to make this one shorter.

    I quickly discovered that the FastTrak was passing successfully if I was disabling the RAID Support on the motherboard. But then, my PC was not able to start the OS as this one was installed on a RAID 0 array managed by the motherboard’s controllers.

    To make it clear: if I was restoring the “default settings” in the Bios (which does not enable the RAID support), then the FastTrack was passing successfully (or I could enter the utility pressing Ctrl-F). But as soon as I was re-enabling the Raid Support on the Sata Controller of my motherboard (and nothing else), the boot sequence stopped after the message mentioned above…

    This morning, I read that the Promise FastTrak is incompatible with some other Raid Controllers. I assumed I was in such a case. So, I started to hope that a Bios Update would possibly fix the incompatibility.

    1) I did first update the Bios of my Asus Striker II Formula from v1305 to v2402 (the latest) using the tool of Asus, the “EZ Flash 2” available in the BIOS itself, and the new firmware copied on a USB key. The update was a piece of cake…

    Unfortunately, it did not solve the problem 🙁

    2) I did next downgrade the Bios of my Promise FastTrak Tx4660 from v2.9.0.0039 (the latest) to v2.9.0.0037 (the previous one) using a Bootable USB Key created with a tool from BootDisk and the flash utility found on Promise.com

    And BINGO!!!

    The boot sequence completes now successfully with RAID enabled on the motherboard. Only notice that I see a black screen for 15s to 25s while the FastTrak scans for the drives…

    Loading

    ,
  • Access Synology from Windows 8 with a Windows Live ID

    Since I did upgrade my PC from Windows 7 to Windows 8 and did start to use my Microsoft account (Windows Live ID) to sign in, I am prompted for credentials when I try to  access shared folders on my Synology, although I did create an account with the same name on the NAS. The Credential Manager (formerly known as Windows Vault) is the solution!

    Click to Read More

    First, to be sure that I did create an  account with the same name as my Windows Live Id on the Synology, I did check the name of that Live Id in C:\Users. It was the very same.

    However, that’s not the name sent by Windows 8 to the NAS.

    I could provide valid credentials but I don’t want to do that at each access. And unfortunately,  the old good “Remember my credentials” checkbox seems to be gone in Windows 8. But the feature behind this option (Windows Vault) is still available.

    1. If you are not on the Start Screen, type “Ctrl-Esc”
    2. Once on the Start Screen, type “Control” and select the search result “Control Panel”.
    3. In the “Control Panel” search box, type “Credential” and select the search result “Credential Manager” (This one is the feature formerly known as Windows Vault).
    4. Select the “Windows Credentials” button.
    5. Now, select “Add a Windows Credential.”
    6. In the view that opens, type in the hostname of your NAS or its network address
    7. Provide the user name and password that you want to use to connect on the NAS instead of your Windows Live ID.
    Et voilà!

     

    Loading

    ,
  • Fresh re-install of Windows 7 before upgrading to Windows 8 Pro for less than 15€

    As you really should know, if you bought a computer with Windows 7 home premium or above between June 2, 2012 and January 31, 2013, you can buy the upgrade to Windows 8 pro for about 15€!!! And actually, it works also for older Windows 7 PC as far as you mention that you bought it recently…

    Here is the link to get the Promo Code

    However, just like me, you most probably don’t want to upgrade your PC with all the crap currently installed on it. Instead, you want to upgrade from a fresh install of Windows 7. But unfortunately, you don’t have the setup media to re-install Windows 7 SP1 🙁

    No problem! The official ISO’s (English versions) from Microsoft are available here.

    Click to Read More

    Reinstal you PC with the adequate ISO and upgrade next to Windows 8 using the Upgrade Assistant – providing your Promo Code to pay the lowest price (Payment with Paypal is available). No need to install any Windows updates for Windows 7 before starting the upgrade to windows 8. But when upgrading to Windows 8 choose the option “keep nothing” to have a cleanest installation.

    Finally, after the installation, delete the “windows.old” folder using the Disk Clean-up utility:

    1. Right click your System Drive and select properties
    2. Start the Disk Clean-up Utility (button next to the pie chart).
    3. Click “Clean-up system files” (Disk Clean-up will restart itself)
    4. Select now “Previous Windows Installation(s)” in the list of files to delete (This option was not available before step 3).
    5. Click “Ok” and confirm the “Delete Files”

    Et voilà!

    Loading

  • Windows command

    Just as I intensively use windows hot keys and shortcuts that boost my productivity, I also like some “windows commands” to avoid clicking on sub-sub-sub-extra-sub-menus to reach some windows configuration screens…

    Click to Read More

    Using commands is straightforward, if you know it: Use the Shortcut  :start:Start +R and type your command in the dialog box.

    Here is a list of available commands, most of them being actually components like:

    • .cpl : « Control Panel » Applet
    • .msc : Microsoft System Console
    • .mmc : Microsoft Management Console.

    Control Panel Commands

    • control : opens the “Control Panel” window
    • control admintools : opens the “Administrative Tools”
      • :start:Start  > Control Panel\System and Security\Administrative Tools
    • control color : opens advanced appearance settings with the “Window Color and Appearance” tab to customize colors used in your theme
      • :start:Start  > Control Panel\Appearance and Personalization\Personalization\Window Color and Appearance\Advanced appearance settings…
    • control desktop or desk.cpl : opens display properties with the themes “Personalization” tab
      • :start:Start  > Control Panel\Appearance and Personalization\Personalization
    • control folders : opens “Folder options” mainly to customize the windows explorer
      • :start:Start  > Control Panel\Folder Options
    • control fonts : opens “Fonts” tab of the Appearance and Personalization” window where you can preview and delete available fonts
      • :start:Start  > Control Panel\ Fonts
    • control international or intl.cpl : opens the “Regional and Language” options
      • :start:Start  > Control Panel\Clock, Language, and Region\Region and Language
    • control keyboard : opens “Keyboard Properties” mainly to customize the speed parameters
      • :start:Start  > Control Panel\Hardware and Sound\Devices and Printers\ right click the keyboard and select Keyboard Settings
    • control mouse or main.cpl: opens mouse properties
      • :start:Start  > Control Panel\Hardware and Sound\Mouse (under Devices and Printers)
    • control netconnections or ncpa.cpl: opens “Network Connections”
      • :start:Start  > Control Panel\Network and Internet\Network and Sharing Center\Change adapter settings (on the left)
    • control userpasswords: opens “User Accounts” editor to change password
      • :start:Start  > Control Panel\User Accounts and Family Safety\User Accounts
    • control printers : opens “Printers and Faxes” available
      • :start:Start  > Control Panel\ View devices and printers (under Hardware and Sound)
    • control userpasswords2 or netplwiz : opens “User Account” for access restrictions and advanced user management.
    • control schedtasks or taskschd.msc : opens the “Tasks Scheduler”
    • optionalfeatures : opens the “Turn on/off Windows Features” utility
      • :start:Start  > Control Panel \Programs\Programs\Turn Windows features on or off

    Control Panel Applets

    • access.cpl : opens “Ease of Access Center”.
    • appwiz.cpl : opens the “Add/Remove programs” wizard
      • :start:Start  > Control Panel\Uninstall a program (under Programs)
    • desk.cpl : opens display properties with the themes “Personalization” tab
      • :start:Start  > Control Panel\Appearance and Personalization\Personalization
    • hdwwiz.cpl or devmgmt.msc : opens the “Device Manager” utility
      • :start:Start  > Control Panel\System and Security\Device Manager (under System)
    • intl.cpl : opens the “Regional and Language” options
      • :start:Start  > Control Panel\Clock, Language, and Region\Region and Language
    • irprops.cpl : infrared utility tool (if installed)
    • joy.cpl : opens “Game Controllers” settings
    • main.cpl : opens “Mouse Properties”
      • :start:Start  > Control Panel\Hardware and Sound\Mouse (under Devices and Printers)
    • mmsys.cpl : opens “Sound “ utility with the Playback, Recording, Sounds and Communication tabs
      • :start:Start  > Control Panel\Hardware and Sound\Sound
    • ncpa.cpl : opens “Network Connections”
      • :start:Start  > Control Panel\Network and Internet\Network and Sharing Center\Change adapter settings (on the left)
    • powercfg.cpl : opens “Power Options” properties for Power Plan configuration
      • :start:Start  > Control Panel\Hardware and Sound\Power Options
    • sysdm.cpl : opens “System Properties”
      • :start:Start  > Control Panel\System and Security\System\Change settings (bottom right) – Win + pause
    • telephon.cpl : opens the phone/modem “Location Information”
    • timedate.cpl : opens “Date and Time” properties
      • :start:Start  > Control Panel\Clock, Language, and Region\Date and Time
    • wscui.cpl : opens the “Action Center” for Windows “Security Management” et “Maintenance”
      • :start:Start  > Control Panel\System and Security\Action Center
    • wuaucpl.cpl : opens “Windows Updates”
      • :start:Start  > Control Panel\System and Security\Windows Update

    System Consoles

    • mmc : opens the “Microsoft Management Console”
    • azman.msc : opens “Authorization Management” console
    • certmgr.msc : opens “Certificate Management” console
    • compmgmt.msc : opens the “Computer Management” console
    • comexp.msc or dcomcnfg: opens the “Component Services” console including COM+, IIS, Event Viewer and Services Manager, …
    • eventvwr : opens the “Event Viewer”
    • fsmgmt.msc : opens the “Shared Folders” console
    • gpedit.msc : opens the “Local Group Policy Editor” console
    • lusrmgr.msc : opens the “Local Users and Groups” console
    • napclcfg.msc : opens the “NAP Client Configuration” console
    • rsop.msc : opens the “Resultant Set of Policy” issued from all defined “Group Policy” objects
    • services.msc : opens the “Service Manager”
    • secpol.msc : opens the “Local Security Policy” console
    • wmimgmt.msc : opens the (WMI) “Window Management Instrumentation”

    Windows utility and applications

    • explorer : opens Windows Explorer ( :win: + E  )
    • iexplorer : opens Internet Explorer
    • calc : opens Calculator
    • soundrecorder : opens sound recording tool
    • dpinst : opens the “Device Driver Installation Wizard”
    • dvdplay : play CD or DVD
    • osk : opens “On-Screen Keyboard” (Win+U)
    • magnify : opens “Magnifier”
    • dialer : opens “Phone Dialer”
    • eudcedit : opens the “Private Character Editor”
    • sndvol : opens the “volume mixer”
    • rstrui : opens the “System Restore”
    • msinfo32 : opens the “System Information”
    • mrt : opens the “Malicious Software Removal”
    • taskmgr : opens “the Windows Task Manager” (Ctrl + Alt + Esc)
    • cmd : opens a command prompt
    • sigverif : opens the “File Signature Verification” tool
    • winver : displays your Windows version
    • iexpress : opens the wizard for creating self-extracting archives.
    • mblctr : opens the “Mobility Center” on laptops only (Win+X)
    • msra : opens “Windows Remote Assistance” to request help to a friend
    • mstsc: opens the “Remote Desktop connection” window
      • mstsc -v:host opens directly the remote desktop of the host.
    • msdt : opens the “Microsoft support diagnostic tool”
    • printbrmui : opens “Printer Migration Wizard” to export/import queues and printer drivers to/from file.
    • shrpubw : opens the “Create a shared folder wizard”
    • narrator : starts the “Windows Narrator”
    • wscript : opens the “Windows Script host settings” window
    • fxscover : opens the “Fax Cover Sheet Editor”
    • iscsicpl : opens the “iSCSI Initiator” properties
    • mdsched : opens the “Windows Memory Diagnostics” tool
    • dxdiag : opens the “DirectX Diagnostics” tool
    • odbcad32 : opens the “ODBC Data Source Administrator” tool
    • regedit : opens the “Registry editor” with support to search on values. May not be used to set permissions.
    • regedt32: opens the “Registry editor” with support to set permissions. May not be used to search on values (only searching for keys is supported).
    • verifier : opens the “Driver Verifier Manager”
    • cliconfg : opens the “SQL Server Client Network Utility”
    • colorcpl : opens the “Color Management” tool used to calibrate displays ad fine-tune color rendering.
    • credwiz : open the “Stored User Names and Password” wizard to backup and recover user passwords
    • mobsync : opens the “Synchronization Center”:
    • msconfig : opens the “System Configuration” utility which give access to all Startup and Boot options
    • syskey : opens the “Windows Account Database” security management which allows the enable data encryption on Windows.
    • comp : Compare files in a console

    Disk management

    • diskmgmt.msc : opens the “Disk Management” console
    • cleanmgr : opens the “Disk Cleanup” utility
    • dfrgui : opens “Disk Defragmenter”
    • chkdsk : starts a complete analysis of disk partition in console mode
    • diskpart : starts the “Disk Partitioning tool” in console mode

    Connection management

    • ipconfig: lists the configuration of IP addresses on your PC (for more information type ipconfig/? in the CMD menu)
      • ipconfig /all : show details
      • ipconfig /release : release IP of all adapters
      • ipconfig /renew : renew IP of all adapters
      • ipconfig /displaydns : display DNS cache entries
      • ipconfig /flushdns : delete all DNS cache entries
      • ipconfig /registerdns : refresh DHCP and re-register DNS
    • inetcpl.cpl : opens the “Internet Properties”
    • firewall.cpl : opens the “Windows firewall” settings: Control Panel\System and Security\Windows Firewall
    • fw.msc : opens the “Windows Firewall with Advanced Security” console

    Miscellaneous commands

    • netproj : allow or not connecting to a network projector
    • logoff : closes the current session
    • shutdown : shuts down Windows
    • shutdown -a : to interrupt Windows shutdown
    • dism /online /cleanup-image /spsuperseded : clean cache for installation of service packs (useful to release a lot of space on the system drive!)
    • sfc : System File Checker (Requires Windows CD if the cache is not available):
      • sfc /scannow: immediately scans all system files and repairs damaged files
      • sfc /VERIFYONLY: scans only those files system
      • sfc /Scanfil = “name and file path”: scans the specified file, and repairs if damaged
      • sfc /VERIFYFILE = “name and file path”: Scans only the file specified
      • sfc /scanonce: scans the system files on the next restart
      • sfc /REVERT: return the initial configuration (For more information, type sfc /? In the command prompt CMD.
      • sfc /scanboot: scans the system files on every boot
      • sfc /purgecache: purge File Cache
      • sfc /cachesize=x: Set Cache Size to size x:
    • ftp : ftp client
    • telnet : Telnet client
    • rasphone : Manage Remote Access Service connections
    • msiexec : Windows Installer
    • wiaacmgr : Windows Picture Import Wizard (Need camera/scanner connected)

    Environment Variables

    • %WINDIR% or %SYSTEMROOT%: windows installation folder (e.g.: C:\Windows)
    • %PROGRAMFILES%: location where programs are installed (e.g.: C:\Program Files)
    • %USERPROFILE%: location of currently logged user’s profile (e.g.: C:\Users\ [username])
    • %HOMEDRIVE%: partition where the operating system is installed (e.g.: C:)
    • %HOMEPATH%: location of currently logged user’s home (e.g.: \Users\ [username])
    • %TEMP%: location of the temporary folder

    Sources: Oreilly, Microsoft Control Panel, Web Talk’s Command Guide.

    Command to Control Panel

    Control Panel Applet

    Command

     
     
    Action Center control /name Microsoft.ActionCenter  
    control wscui.cpl  
    Add Features to Windows 8 control /name Microsoft.WindowsAnytimeUpgrade  
    Administrative Tools control /name Microsoft.AdministrativeTools  
    control admintools  
    AutoPlay control /name Microsoft.AutoPlay  
    Biometric Devices control /name Microsoft.BiometricDevices  
    BitLocker Drive Encryption control /name Microsoft.BitLockerDriveEncryption  
    Bluetooth Devices control bthprops.cpl13
    Color Management control /name Microsoft.ColorManagement  
    Credential Manager control /name Microsoft.CredentialManager  
    Date and Time control /name Microsoft.DateAndTime  
    control timedate.cpl  
    control date/time  
    Default Programs control /name Microsoft.DefaultPrograms  
    Device Manager control /name Microsoft.DeviceManager  
    control hdwwiz.cpl  
    devmgmt.msc  
    Devices and Printers control /name Microsoft.DevicesAndPrinters  
    control printers  
    Display control /name Microsoft.Display
    Ease of Access Center control /name Microsoft.EaseOfAccessCenter  
    control access.cpl  
    Family Safety control /name Microsoft.ParentalControls  
    File History control /name Microsoft.FileHistory  
    Flash Player Settings Manager control flashplayercplapp.cpl  
    Folder Options control /name Microsoft.FolderOptions  
    control folders  
    Fonts control /name Microsoft.Fonts  
    control fonts  
    Game Controllers control /name Microsoft.GameControllers  
    control joy.cpl  
    Get Programs control /name Microsoft.GetPrograms  
    Home Group control /name Microsoft.HomeGroup  
    Indexing Options control /name Microsoft.IndexingOptions  
    rundll32.exe shell32.dll,Control_RunDLL srchadmin.dll  
    Infrared control /name Microsoft.Infrared  
    control irprops.cpl  
    Internet Options control /name Microsoft.InternetOptions  
    control inetcpl.cpl  
    iSCSI Initiator control /name Microsoft.iSCSIInitiator  
    Keyboard control /name Microsoft.Keyboard  
    control keyboard  
    Language control /name Microsoft.Language  
     
    Location Settings control /name Microsoft.LocationSettings  
    Mail4 control mlcfg32.cpl5  
    Mouse control /name Microsoft.Mouse  
    control main.cpl  
    control mouse  
    Network and Sharing Center control /name Microsoft.NetworkAndSharingCenter  
    Network Connections control ncpa.cpl  
    control netconnections  
    Network Setup Wizard control netsetup.cpl  
    Notification Area Icons control /name Microsoft.NotificationAreaIcons  
    Offline Files control /name Microsoft.OfflineFiles  
    Pen and Touch control /name Microsoft.PenAndTouch  
    control tabletpc.cpl  
    Performance Information and Tools control /name Microsoft.PerformanceInformationAndTools  
    Personalization control /name Microsoft.Personalization  
    control desktop  
     
    Phone and Modem control /name Microsoft.PhoneAndModem  
    control telephon.cpl  
    Power Options control /name Microsoft.PowerOptions  
    control powercfg.cpl  
    Programs and Features control /name Microsoft.ProgramsAndFeatures  
    control appwiz.cpl  
    Recovery control /name Microsoft.Recovery  
    Region control /name Microsoft.RegionAndLanguage  
    control intl.cpl  
    control international  
    RemoteApp and Desktop Connections control /name Microsoft.RemoteAppAndDesktopConnections  
    Scanners and Cameras control /name Microsoft.ScannersAndCameras  
    Screen Resolution control desk.cpl  
    Sound control /name Microsoft.Sound  
    control mmsys.cpl  
    Speech Recognition control /name Microsoft.SpeechRecognition  
    Storage Spaces control /name Microsoft.StorageSpaces  
    Sync Center control /name Microsoft.SyncCenter  
    System control /name Microsoft.System  
    System Properties control sysdm.cpl  
    Tablet PC Settings control /name Microsoft.TabletPCSettings  
    Task Scheduler7 control schedtasks  
    Taskbar control /name Microsoft.Taskbar  
    rundll32.exe shell32.dll,Options_RunDLL 1  
    Text to Speech control /name Microsoft.TextToSpeech  
    Troubleshooting control /name Microsoft.Troubleshooting  
    User Accounts control /name Microsoft.UserAccounts  
    control userpasswords  
    Windows 7 File Recovery control /name Microsoft.BackupAndRestore  
    Windows Defender control /name Microsoft.WindowsDefender  
    Windows Firewall control /name Microsoft.WindowsFirewall  
    control firewall.cpl  
    Windows Mobility Center control /name Microsoft.MobilityCenter  
    Windows SideShow control /name Microsoft.WindowsSideShow  
    Windows Update control /name Microsoft.WindowsUpdate  

    See also the shortest path to access any Control Panel Applet.

    Click to Read More

    Notice: Another quick access to all “Control Panel” applet if you don’t want to type commands.

    1. Press Ctrl + Esc
    2. Click on “Control Panel”
    3. Start to type the title of the applet (no need to click in the search area)

    You may also create your own shortcut key to access directly the “Control Panel”:

    1. Create a shortcut (in any folder) to C:\Windows\System32\control.exe
    2. Assign a shortcut Key to that shortcut via the tab “Shortcut” of its “Properties”.
    See also “here

    Loading

  • Sync MS Outlook and Android using gmail account

    I really like MS Outlook and use it on all my Windows PC and laptops – at work as well as at home. But there was nothing offered my MS to sync Outlook’s emails, contacts and calendars between multiple PC and Android. So, I started to use a gmail account to that purpose.

    Click to Read More

    • First, I did enable the imap support on my gmail account and took note of all the gmail “imap parameters” for the next steps.
    • Next, I did configure an imap account to access my gmail mailbox in MS Outlook (on all my PC/Laptops).
    • A also configured my Google account on my Android smartphone to access my gmail mailbox , my Google Calendar and my Google Contacts.
    • Finally, I did install two freeware on all my Windows PC to sync my Google Calendar and my Google Contacts with Outlook:
      • Go Contact Sync Mod” to sync my Outlook’s Contacts with gmail (both way)
      • Google Calendar Sync” to sync my Outlook’s Calendar with gmail (both way on my private PC, one way at work => to get my professional appointments on my personal computers but no the opposite).

    Et voilà 😉

     

    Now, I should have a look on my “Outlook Web Account” (previously “hotmail”) to see if I could not use it to sync MS Outlook and Android in a similar way… MS did add/integrate indeed several services which deserve some attention…

    Loading

  • Assembly Version, File Version and Product Version: The Butterfly Effect

    Assembly Version, File Version and Product Version are “related” if you don’t specify them explicitly… and you could be surprised by one of the side effect: loosing you application data or user settings when incrementing the Assembly File Version.

    Click to Read More

    How are those versions specified:

    By default, any new Visual Studio Project includes an AssemblyInfo file defining default values (major, minor, build and revision) for the Assembly Version and Assembly File Version:

    [csharp][assembly: AssemblyVersion("1.0.0.0")]
    [assembly: AssemblyFileVersion("1.0.0.0")][/csharp]
    • A difference in the build number represents a recompilation of the same source. This is usually appropriate because of processor, platform, or compiler changes.
    • Assemblies with the same name, major, and minor version numbers but different revision numbers are intended to be fully interchangeable. This is usually appropriate for security fix, etc …
    • “[assembly: AssemblyVersion(“65534.65534.65534.65534“)]” is maximum.

    MSBuild can auto-increment the build and revision numbers at each build if we provide a (*) in place of those figures. Ex.

    [csharp][assembly: AssemblyVersion("1.0.*")][/csharp]

    or

    [csharp][assembly: AssemblyVersion("1.0.0.*")][/csharp]

    In such cases, the build number is generated based on the current day and the revision number is generated based on the number of seconds since midnight. Replacing the revision number only with a (*) would be irrelevant. Indeed, consecutive builds would most probably have lower revisions.

    There is no default value set for the Product Version when creating a new Visual Studio Project. But a value can be set manually in the AssemblyInfo file using:

    [csharp][assembly: AssemblyInformationalVersion("1.0.0.0")][/csharp]

    Usually, the Product Version is a value like major.minor.build, but it can actually be any string, like “1.0 RC”, etc… Don’t use (*) in this string as it wouldn’t be replaced by an auto-incremented figure. Instead, it would crash your application in some cases (See further for the explanation). Notice also that before VS 2010, using anything else that major.minor.build.rev was resulting in  false warning during compilation.

    What do those versions mean:

    Assembly Version : This is the version number used by framework during build and at runtime to locate, link and load the assemblies. When you add reference to any assembly in your project, it is this version number which gets embedded. At runtime, CLR looks for assembly with this version number to load. But remember this version is used along with name, public key token and culture information only if the assemblies are strong-named signed. If assemblies are not strong-named signed, only file names are used for loading.
     
    Assembly File Version : This is the version number given to file as in file system. It is displayed by Windows Explorer. Its never used by .NET framework or runtime for referencing. But it can be used by OS tools.

    Product Version (a.k.a Assembly Informational Version): Defines an additional version information for an assembly manifest. This is the version you would use when talking to customers or for display on your website..

    What if a version is not specified:

    • If the Assembly version is not explicitly specified, it takes the value of 0.0.0.0.
    • If the Assembly File version is not explicitly specified, it takes the value of the Assembly version.
    • If the Product version is not explicitly specified, it takes the value of the Assembly File version.
    How could issues occurred due to this relation:

    By your fault 🙂

    At work, we recently decided to manage the major and minor numbers of the Assembly Versions at build time, within our TFS Build Process Template. Assembly Versions’ build and release numbers are kept equal to 0 while major and minor are enforced with values provided through Build Definitions’ parameters. At the same time,  we auto-increment the build and release numbers of the Assembly File Versions while keeping their major and minor numbers aligned with those of the Assembly Versions. We don’t touch the Product Version. This was designed as recommended in KB 556041.

    As mentioned, major and minor numbers are specified through custom parameters of our Build Definitions. The build number is computed to reflect directly the current day using a format like “YMMdd” with Y = year modulo x to be <= 6 (None of our product has a longer life). The release number is set with the auto-incremented value provided out-of-the box by Team Build.

    Previously, most of the binaries were compiled locally, on development workstations, and there was no version management at all (There was simply no need for any such versioning): Assembly Version and Assembly File Version were always kept unchanged.

    The change introduced with our Build Process Template had an unexpected consequence: As there never was any Product Version specified explicitly in the AssemblyInfo, binaries’ Product Versions were always equal to the Assembly File Version… kept therefore unchanged through all builds. However, since we started to auto-increment the Assembly File Version, the Product Version started to increment too…

    And ? And some users started to complain that their custom settings were lost after the installation of each new version…

    We quickly noticed that, as usually recommended, developers were making use the two following properties to store  respectively application’s data and users’ data:

    [csharp]Application.CommonAppDataPath[/csharp]
    [csharp]Application.LocalUserAppDataPath[/csharp]

    And after some investigations on MSDN, it appeared that the path returned by those properties depend among other on the Product Version 🙁

    Depending on the OS, CommonAppDataPath is usually like:

    • %SystemDrive%\Documents and Settings\All Users\Application Data\<CompanyName>\<ProductName>\<ProductVersion> or
    • %SystemDrive%\ProgramData\<CompanyName>\<ProductName>\<ProductVersion>

    And LocalUserAppDataPath is like:

    • “%SystemDrive%\Documents and Settings\<UserId>\Local Settings\Application Data\<CompanyName>\<ProductName>\<ProductVersion>” or
    • “%SystemDrive%\Users\<UserId>\AppData\Local\<CompanyName>\<ProductName>\<ProductVersion>“.

    So, indeed, each new release of our product having now a new Product Version, application’s data and users’ data of the previous versions are not used anymore…

    Any (*) used in the Product Version (e.g.: 1.0.*) wouldn’t be replaced by auto-incremented build/release numbers (as mentioned previously), the “AppDataPath”  above would contain an illegal character; reason why the application would crash when accessing this path.

    This also impacted applications accessing settings in the registry with methods like:

    [csharp]Application.UserAppDataRegistry.SetValue()[/csharp]
    [csharp]Application.CommonAppDataRegistry.SetValue()[/csharp]

    Those methods access respectively data under 

    • HKCU\Software\<CompanyName>\<ProductName>\<ProductVersion>\
    • HKLM\Software\<CompanyName>\<ProductName>\<ProductVersion>\
    Read also this paper on User Settings Management.
    See also one of my sources here about this topic.

    Loading

    ,
  • Windows Shortcuts and Hot Keys

    A impressive reference guide of shorcuts and hot keys is available on the “Shortcut World” website here, covering various OS (Windows, MacOS, Linux) and products (Autocad, Office, … ). Use the search box to find shortcuts for your software (e.g.: “Windows 7”).

    But the most complete, up-to-date and official, lists of shortcuts for Windows should be the ones provided by Microsoft itself.

    Click to Read More

    Have a look:

    • here for Windows 7, 8.1 and 10
    • here for Windows XP

    To find shortcuts for other Microsoft products (Excel, Word, …) go to the page Accessibility in Microsoft Products, select a product in the list to open the related page and search for the “shortcut” word on that page. you will most probably find what you need 😉

    Notice that you may also create your own “keyboard shortcut” to open a program:

    1. Locate a shortcut to that program (e.g.: via the menu Start > All Programs).
    2. Right-click the shortcut, and then click Properties.
    3. In the Shortcut Properties dialog box, click the Shortcut tab.
    4. In the Shortcut key box, enter the key that you want to use in combination with Ctrl+Alt (keyboard shortcuts automatically start with Ctrl+Alt) and click OK.

    If the same key combination as the shortcut you just created is used by a program currently running, then your shortcut might not work.

    Loading

  • Drop Builds’ primary output in a “Latest” folder

    As briefly mentioned in another post, we have a specific “Reference Assemblies” folder on the Build Machines containing the latest version of each assembly issued from a successful Build. Assemblies in that folder, know as the “Latest” folder, can be used for “Continuous Integration” Builds.  This post is about the pragmatic solution implemented to drop only the primary output of the Builds in that folder.

    Click to Read More

    The output of a Build contains not only the assemblies and satellite assemblies issued from the compilation of the Visual Studio Projects (I.e.: assemblies part of the “primary output” as named in the Microsoft Setup Projects). It contains also a copy of all the referenced assemblies (file references) with the property “CopyLocal”=”True”.

    It’s important for our purpose to only drop the primary output into the “Latest” folder, otherwise we could override the latest version of some referenced assemblies with a  copy of the specific version found for the Build (e.g.: when targeting the Integration Environment, we use the promoted version on, the assemblies which are possibly not the latest).

    We may not set “CopyLocal”=”False” on all the “file references” because MSTest needs a copy of those in the bin folder to be able to run the unit Tests (That would not be the case if we could find for MSTest an equivalent of the “ReferencePath” parameter of MSBuild).

    We don’t have access to methods (or well described “algorithms”) to retrieve the exact list of assemblies part of the “primary output”. Such methods are only implemented in the Microsoft Setup Projects (Projects not supported, by the way, by MSBuild).

    We don’t want all our developers to add MSBuild Scripts in their Visual Studio Projects to drop the “Targets” in the “Latest” folder.

    Ex. copy “$(TargetDir)$(TargetName).???” “C:\RefAssemblies\Latest”

    This is not only too error prone (like everything you request to a human developer), but it’s also not robust enough. It’s in our opinion impossible to maintain this with enough guarantee taking into account that developers can for example add support for new languages at any time. For each Project, in addition to the assembly $(TargetDir)$(TargetName).dll, we also have to drop the satellite assemblies (e.g.: <culture>\<assemblyname>.resources.dll”), etc…

    The most generic solution we found to identify the assemblies part of the primary output, although quick and dirty, consists in parsing the FileListAbsolute.txt file generated by MSBuild itself and available in the “obj” folder. We “rely” so on direct output of Microsoft (the content of that file) and avoid to implement (and maintain) our own generic (and most probably complex) algorithm (“complex” because I have no idea how to detect satellite assemblies in a Visual Studio Project).

    Notice: We may only drop the primary output of Builds in the “Latest” folder for “Continuous Integration” Builds or Builds targeting the Integration Environment (both using the latest version of the sources). Builds targeting Qualification, Pre-Production or Production use always a specific version of the sources instead of the latest version. Their purpose is indeed to fix a bug in the assemblies deployed in the targeted environment and build with older sources.

    Click to Read More

    [csharp] using System;
    using System.IO;
    using System.Linq;
    using System.Activities;
    using System.Reflection;
    using System.Diagnostics;
    using System.ComponentModel;
    using System.Collections.Generic;
    using Microsoft.TeamFoundation.Build.Client;
    using Microsoft.Build.Evaluation;

    namespace AG.SCRM.TeamBuild.Activity
    {
    /// &lt;summary&gt;
    /// Collect Build’s Primary Output Items
    /// &lt;/summary&gt;
    [BuildActivity(HostEnvironmentOption.All)] public sealed class GetPrimayOutput : CodeActivity
    {
    /// &lt;summary&gt;
    /// List of Build’s Primary Output Items
    /// &lt;/summary&gt;
    [RequiredArgument] public InOutArgument&lt;List&lt;FileInfo&gt;&gt; PrimaryOutputItems { get; set; }

    /// &lt;summary&gt;
    /// Build’s Configuration Parameter
    /// &lt;/summary&gt;
    [RequiredArgument] public InArgument&lt;string&gt; Configuration { get; set; }

    /// &lt;summary&gt;
    /// Build’s Platform Parameter
    /// &lt;/summary&gt;
    [RequiredArgument] public InArgument&lt;string&gt; Platform { get; set; }

    /// &lt;summary&gt;
    /// Local path of Build’s project file
    /// &lt;/summary&gt;
    [RequiredArgument] public InArgument&lt;string&gt; LocalProject { get; set; }

    [RequiredArgument] public InArgument&lt;string&gt; OutDir { get; set; }

    /// &lt;summary&gt;
    /// Collect Build’s Primary Output Items
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;context&quot;&gt;&lt;/param&gt;
    protected override void Execute(CodeActivityContext context)
    {
    var fileListAbsolute = PrimaryOutputItems.Get(context);
    var localProject = LocalProject.Get(context);
    var configuration = Configuration.Get(context);
    var platform = Platform.Get(context);

    // Default Configuration is &quot;Debug&quot;
    if (string.IsNullOrEmpty(configuration)) configuration = &quot;Debug&quot;;

    // Initialize the list of Build’s Primary Output Items if required.
    // Otherwise, add Build’s Primary Output Items to the provided list
    // to possibly support a loop on all Visual Studio Solution files in
    // Build’s
    if (fileListAbsolute == null) fileListAbsolute = new List&lt;FileInfo&gt;();

    if (Path.GetExtension(localProject).Equals(&quot;.sln&quot;, StringComparison.InvariantCultureIgnoreCase))
    {
    // Parse the Visual Studio Solution file
    SolutionParser sln = new SolutionParser(localProject);
    string root = Path.GetDirectoryName(localProject);
    foreach (SolutionProject project in sln.MSBuildProjects)
    {
    localProject = Path.Combine(root, project.RelativePath);
    CollectOutputItems(context, fileListAbsolute, configuration, platform, localProject);
    }
    }
    else
    {
    // Validate that the file is a Visual Studio Project
    var projectCollection = new ProjectCollection();
    try
    {
    Project project = projectCollection.LoadProject(localProject);
    string projectDirectoryPath = Path.GetDirectoryName(localProject);
    CollectOutputItems(context, fileListAbsolute, configuration, platform, localProject);
    }
    catch (Exception ex)
    {
    throw new Exception(string.Format(&quot;Project file ‘{0}’ is not a valid Visual Studio project.&quot;, localProject), ex);
    }
    projectCollection.UnloadAllProjects();

    }

    context.SetValue(PrimaryOutputItems, fileListAbsolute);
    }

    private static void CollectOutputItems(CodeActivityContext context, List&lt;FileInfo&gt; items, string configuration, string platform, string project)
    {
    string projectFileName = Path.GetFileName(project);
    string projectName = Path.GetFileNameWithoutExtension(project);
    string projectPath = Path.GetDirectoryName(project);
    string fileListAbsolute = GetFileListAbsolute(configuration, platform, projectFileName, projectPath);

    if (!string.IsNullOrEmpty(fileListAbsolute))
    {
    System.IO.StreamReader file = null;
    string line;

    string parent = Path.GetDirectoryName(fileListAbsolute);

    // Read the file and parse it line by line.
    using (file = new System.IO.StreamReader(fileListAbsolute))
    {
    while ((line = file.ReadLine()) != null)
    {
    // Ignore obj folder’s local items.
    if (!line.StartsWith(parent, StringComparison.OrdinalIgnoreCase))
    {
    FileInfo item = new FileInfo(line);
    if (item.Exists)
    {
    // We are actually only interested in .dll and .exe + their .pdb, .xml and .config
    if (item.Extension.Equals(&quot;.dll&quot;, StringComparison.OrdinalIgnoreCase) || item.Extension.Equals(&quot;.exe&quot;, StringComparison.OrdinalIgnoreCase))
    {
    //MessageHelper.DisplayInformation(context, string.Format(&quot;Build output of {0} contains: {1}.&quot;, projectName, item.Name));
    items.Add(item);

    var config = new FileInfo(Path.Combine(item.DirectoryName, item.Name + &quot;.config&quot;));
    if (config.Exists)
    {
    //MessageHelper.DisplayInformation(context, string.Format(&quot;Build output of {0} contains: {1}.&quot;, projectName, config.Name));
    items.Add(item);
    }

    var pdb = new FileInfo(Path.Combine(item.DirectoryName, Path.GetFileNameWithoutExtension(item.FullName) + &quot;.pdb&quot;));
    if (pdb.Exists)
    {
    items.Add(item);
    }

    var xml = new FileInfo(Path.Combine(item.DirectoryName, Path.GetFileNameWithoutExtension(item.FullName) + &quot;.xml&quot;));
    if (xml.Exists)
    {
    items.Add(item);
    }
    }
    }
    else
    {
    //MessageHelper.DisplayWarning(context, string.Format(&quot;Primary Output items not found for project {0}: {1}.&quot;, projectName, line));
    }
    }
    }
    }
    }
    else
    {
    //MessageHelper.DisplayWarning(context, string.Format(&quot;SCRM: No FileListAbsolute found for project ‘{0}’&quot;, projectName));
    }
    }

    /// &lt;summary&gt;
    ///
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;configuration&quot;&gt;Build’s Configuration: Debug or Release&lt;/param&gt;
    /// &lt;param name=&quot;platform&quot;&gt;Build’s Target Platform: Any CPU or x86&lt;/param&gt;
    /// &lt;param name=&quot;projectFileName&quot;&gt;Visual Studio Project filename&lt;/param&gt;
    /// &lt;param name=&quot;projectPath&quot;&gt;Visual StudioProject path&lt;/param&gt;
    /// &lt;returns&gt;The path of the FileListAbsolute.txt file.&lt;/returns&gt;
    /// &lt;remarks&gt;This file should be located under /obj/{platform}/{configuration/}.
    /// But we also check the parent folders if the file is not found where expected.
    /// We did indeed experienced problem to locate this file for Builds with &quot;Mixed Plateform&quot; Target.&lt;/remarks&gt;
    private static string GetFileListAbsolute(string configuration, string platform, string projectFileName, string projectPath)
    {
    var fileListAbsoluteName = projectFileName + &quot;.FileListAbsolute.txt&quot;;
    var fileListAbsolutePath = Path.Combine(projectPath, &quot;obj&quot;, platform, configuration, fileListAbsoluteName);
    if (!File.Exists(fileListAbsolutePath))
    {
    fileListAbsolutePath = Path.Combine(projectPath, &quot;obj&quot;, configuration, fileListAbsoluteName);
    if (!File.Exists(fileListAbsolutePath))
    {
    fileListAbsolutePath = Path.Combine(projectPath, &quot;obj&quot;, fileListAbsoluteName);
    if (!File.Exists(fileListAbsolutePath))
    {
    fileListAbsolutePath = null;
    }
    }
    }

    return fileListAbsolutePath;
    }
    }

    /// &lt;summary&gt;
    /// This Visual Studio Solution file Parser can be used to retrieve lists of projects in a Solution.
    /// The first list contains all projects that can be built with MSBuild.
    /// The second list contains all the other projects.
    /// &lt;/summary&gt;
    /// &lt;remarks&gt;
    /// Based on http://stackoverflow.com/questions/707107/library-for-parsing-visual-studio-solution-files.
    /// It’s a wrapper on Microsoft Build’s internal class &quot;SolutionParser&quot;
    /// &lt;/remarks&gt;
    public class SolutionParser
    {
    static readonly Type s_SolutionParser;
    static readonly PropertyInfo s_SolutionParser_solutionReader;
    static readonly MethodInfo s_SolutionParser_parseSolution;
    static readonly PropertyInfo s_SolutionParser_projects;

    public List&lt;SolutionProject&gt; MSBuildProjects { get; private set; }
    public List&lt;SolutionProject&gt; OtherProjects { get; private set; }

    static SolutionParser()
    {
    s_SolutionParser = Type.GetType(&quot;Microsoft.Build.Construction.SolutionParser, Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot;, false, false);
    if (s_SolutionParser != null)
    {
    s_SolutionParser_solutionReader = s_SolutionParser.GetProperty(&quot;SolutionReader&quot;, BindingFlags.NonPublic | BindingFlags.Instance);
    s_SolutionParser_projects = s_SolutionParser.GetProperty(&quot;Projects&quot;, BindingFlags.NonPublic | BindingFlags.Instance);
    s_SolutionParser_parseSolution = s_SolutionParser.GetMethod(&quot;ParseSolution&quot;, BindingFlags.NonPublic | BindingFlags.Instance);
    }
    }

    public SolutionParser(string solutionFileName)
    {
    if (s_SolutionParser == null)
    {
    throw new InvalidOperationException(&quot;Cannot find type ‘Microsoft.Build.Construction.SolutionParser’ are you missing a assembly reference to ‘Microsoft.Build.dll’?&quot;);
    }
    var solutionParser = s_SolutionParser.GetConstructors(BindingFlags.Instance | BindingFlags.NonPublic).First().Invoke(null);
    using (var streamReader = new StreamReader(solutionFileName))
    {
    s_SolutionParser_solutionReader.SetValue(solutionParser, streamReader, null);
    s_SolutionParser_parseSolution.Invoke(solutionParser, null);
    }
    MSBuildProjects = new List&lt;SolutionProject&gt;();
    OtherProjects = new List&lt;SolutionProject&gt;();
    var array = (Array)s_SolutionParser_projects.GetValue(solutionParser, null);
    for (int i = 0; i &lt; array.Length; i++)
    {
    SolutionProject project = new SolutionProject(array.GetValue(i));

    if (project.ProjectType == &quot;KnownToBeMSBuildFormat&quot;)
    MSBuildProjects.Add(project);
    else
    OtherProjects.Add(project);
    }
    }
    }

    /// &lt;summary&gt;
    /// This class represent a Visual Studio Project member of a Solution.
    /// &lt;/summary&gt;
    /// &lt;remarks&gt;
    /// It’s a wrapper on Microsoft Build’s internal class &quot;ProjectInSolution&quot;
    /// &lt;/remarks&gt;
    [DebuggerDisplay(&quot;{ProjectName}, {RelativePath}, {ProjectGuid}, {ProjectType}&quot;)] public class SolutionProject
    {
    static readonly Type s_ProjectInSolution;
    static readonly PropertyInfo s_ProjectInSolution_ProjectName;
    static readonly PropertyInfo s_ProjectInSolution_RelativePath;
    static readonly PropertyInfo s_ProjectInSolution_ProjectGuid;
    static readonly PropertyInfo s_ProjectInSolution_ProjectType;

    static SolutionProject()
    {
    s_ProjectInSolution = Type.GetType(&quot;Microsoft.Build.Construction.ProjectInSolution, Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot;, false, false);
    if (s_ProjectInSolution != null)
    {
    s_ProjectInSolution_ProjectName = s_ProjectInSolution.GetProperty(&quot;ProjectName&quot;, BindingFlags.NonPublic | BindingFlags.Instance);
    s_ProjectInSolution_RelativePath = s_ProjectInSolution.GetProperty(&quot;RelativePath&quot;, BindingFlags.NonPublic | BindingFlags.Instance);
    s_ProjectInSolution_ProjectGuid = s_ProjectInSolution.GetProperty(&quot;ProjectGuid&quot;, BindingFlags.NonPublic | BindingFlags.Instance);
    s_ProjectInSolution_ProjectType = s_ProjectInSolution.GetProperty(&quot;ProjectType&quot;, BindingFlags.NonPublic | BindingFlags.Instance);
    }
    }

    public string ProjectName { get; private set; }
    public string RelativePath { get; private set; }
    public string ProjectGuid { get; private set; }
    public string ProjectType { get; private set; }

    public SolutionProject(object solutionProject)
    {
    this.ProjectName = s_ProjectInSolution_ProjectName.GetValue(solutionProject, null) as string;
    this.RelativePath = s_ProjectInSolution_RelativePath.GetValue(solutionProject, null) as string;
    this.ProjectGuid = s_ProjectInSolution_ProjectGuid.GetValue(solutionProject, null) as string;
    this.ProjectType = s_ProjectInSolution_ProjectType.GetValue(solutionProject, null).ToString();
    }
    }

    /// &lt;summary&gt;
    /// List of known project type Guids from http://www.mztools.com/articles/2008/mz2008017.aspx
    /// + BizTalk: http://winterdom.com/2008/12/biztalkserver2009msbuildtasks
    /// + Workflow 4.0
    /// &lt;/summary&gt;
    public enum ProjectType
    {
    [Description(&quot;{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}&quot;)] Windows_CSharp,
    [Description(&quot;{F184B08F-C81C-45F6-A57F-5ABD9991F28F}&quot;)] Windows_VBNET,
    [Description(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;)] Windows_VisualCpp,
    [Description(&quot;{349C5851-65DF-11DA-9384-00065B846F21}&quot;)] Web_Application,
    [Description(&quot;{E24C65DC-7377-472B-9ABA-BC803B73C61A}&quot;)] Web_Site,
    [Description(&quot;{F135691A-BF7E-435D-8960-F99683D2D49C}&quot;)] Distributed_System,
    [Description(&quot;{3D9AD99F-2412-4246-B90B-4EAA41C64699}&quot;)] Windows_Communication_Foundation_WCF,
    [Description(&quot;{60DC8134-EBA5-43B8-BCC9-BB4BC16C2548}&quot;)] Windows_Presentation_Foundation_WPF,
    [Description(&quot;{C252FEB5-A946-4202-B1D4-9916A0590387}&quot;)] Visual_Database_Tools,
    [Description(&quot;{A9ACE9BB-CECE-4E62-9AA4-C7E7C5BD2124}&quot;)] Database,
    [Description(&quot;{4F174C21-8C12-11D0-8340-0000F80270F8}&quot;)] Database_other_project_types,
    [Description(&quot;{3AC096D0-A1C2-E12C-1390-A8335801FDAB}&quot;)] Test,
    [Description(&quot;{20D4826A-C6FA-45DB-90F4-C717570B9F32}&quot;)] Legacy_2003_Smart_Device_CSharp,
    [Description(&quot;{CB4CE8C6-1BDB-4DC7-A4D3-65A1999772F8}&quot;)] Legacy_2003_Smart_Device_VBNET,
    [Description(&quot;{4D628B5B-2FBC-4AA6-8C16-197242AEB884}&quot;)] Smart_Device_CSharp,
    [Description(&quot;{68B1623D-7FB9-47D8-8664-7ECEA3297D4F}&quot;)] Smart_Device_VBNET,
    [Description(&quot;{14822709-B5A1-4724-98CA-57A101D1B079}&quot;)] Workflow_30_CSharp,
    [Description(&quot;{D59BE175-2ED0-4C54-BE3D-CDAA9F3214C8}&quot;)] Workflow_30_VBNET,
    [Description(&quot;{06A35CCD-C46D-44D5-987B-CF40FF872267}&quot;)] Deployment_Merge_Module,
    [Description(&quot;{3EA9E505-35AC-4774-B492-AD1749C4943A}&quot;)] Deployment_Cab,
    [Description(&quot;{978C614F-708E-4E1A-B201-565925725DBA}&quot;)] Deployment_Setup,
    [Description(&quot;{AB322303-2255-48EF-A496-5904EB18DA55}&quot;)] Deployment_Smart_Device_Cab,
    [Description(&quot;{A860303F-1F3F-4691-B57E-529FC101A107}&quot;)] Visual_Studio_Tools_for_Applications_VSTA,
    [Description(&quot;{BAA0C2D2-18E2-41B9-852F-F413020CAA33}&quot;)] Visual_Studio_Tools_for_Office_VSTO,
    [Description(&quot;{F8810EC1-6754-47FC-A15F-DFABD2E3FA90}&quot;)] SharePoint_Workflow,
    [Description(&quot;{6D335F3A-9D43-41b4-9D22-F6F17C4BE596}&quot;)] XNA_Windows,
    [Description(&quot;{2DF5C3F4-5A5F-47a9-8E94-23B4456F55E2}&quot;)] XNA_XBox,
    [Description(&quot;{D399B71A-8929-442a-A9AC-8BEC78BB2433}&quot;)] XNA_Zune,
    [Description(&quot;{EC05E597-79D4-47f3-ADA0-324C4F7C7484}&quot;)] SharePoint_VBNET,
    [Description(&quot;{593B0543-81F6-4436-BA1E-4747859CAAE2}&quot;)] SharePoint_CSharp,
    [Description(&quot;{A1591282-1198-4647-A2B1-27E5FF5F6F3B}&quot;)] Silverlight,
    [Description(&quot;EF7E3281-CD33-11D4-8326-00C04FA0CE8D&quot;)] BizTalk,
    [Description(&quot;32f31d43-81cc-4c15-9de6-3fc5453562b6&quot;)] Workflow_40
    };

    /// &lt;summary&gt;
    /// Helper Class to manage Visual Studio Project’s types
    /// &lt;/summary&gt;
    public static class ProjectTypeExtensions
    {
    public static Guid ToGuid(this ProjectType val)
    {
    DescriptionAttribute[] attributes = (DescriptionAttribute[])val.GetType().GetField(val.ToString()).GetCustomAttributes(typeof(DescriptionAttribute), false);
    return attributes.Length &gt; 0 ? Guid.Parse(attributes[0].Description) : Guid.Empty;
    }

    public static ProjectType Parse(string val)
    {
    return Parse(Guid.Parse(val));
    }

    public static ProjectType Parse(Guid val)
    {
    ProjectType? type = null;
    FieldInfo[] fis = typeof(ProjectType).GetFields();
    foreach (FieldInfo fi in fis)
    {
    DescriptionAttribute[] attributes = (DescriptionAttribute[])fi.GetCustomAttributes(typeof(DescriptionAttribute), false);
    if (attributes.Length &gt; 0)
    {
    if (Guid.Parse(attributes[0].Description) == val)
    {
    if (Enum.IsDefined(typeof(ProjectType), fi.Name))
    type = (ProjectType)Enum.Parse(typeof(ProjectType), fi.Name);
    break;
    }
    }
    }
    if (type.HasValue)
    return type.Value;
    else
    throw new FormatException(string.Format(&quot;'{0}’ is not a valid Project Type’s Guid&quot;, val.ToString()));
    }

    public static List&lt;ProjectType&gt; GetMSBuildProjectTypes(string localProject)
    {
    var projectCollection = new ProjectCollection();
    Project project;
    try
    {
    project = projectCollection.LoadProject(localProject);
    }
    catch (Exception ex)
    {
    throw new Exception(string.Format(&quot;Project Type cannot be determined as ‘{0}’ is not a valid VS project.&quot;, localProject), ex);
    }

    var projectTypes = GetMSBuildProjectTypes(project);

    projectCollection.UnloadAllProjects();

    return projectTypes;
    }

    public static List&lt;ProjectType&gt; GetMSBuildProjectTypes(Project project)
    {
    try
    {
    var projectTypeGuids = (from property in project.Properties
    where property.Name == &quot;ProjectTypeGuids&quot;
    select property.EvaluatedValue).FirstOrDefault();

    List&lt;ProjectType&gt; projectTypes;
    if (string.IsNullOrEmpty(projectTypeGuids))
    projectTypes = new List&lt;ProjectType&gt;();
    else
    projectTypes = (from guid in projectTypeGuids.Split(‘;’) select Parse(guid)).ToList();

    return projectTypes;
    }
    catch (Exception ex)
    {
    throw new Exception(string.Format(&quot;Unable to determine the project type of ‘{0}’ due to: {1}&quot;, Path.GetFileNameWithoutExtension(project.FullPath), ex.Message));
    }
    }
    }
    }
    [/csharp]

    Loading

    ,
  • Cannot remove/cancel/delete Print jobs

    I did recently had to restart the “Print Spooler” Service to clear the Print job queue where a job was stuck and refused to abort.

    Click to Read More

    I did download the free software – HP Photo Creations – from HP to print at home calendars, greetings cards, etc… It’s missing some essentials features IMO, like “align” pictures/text/etc… but it’s not that bad.

    I just add one issue while printing one of my creation on my PhotoSmart C6280, which is most probably related neither to that model nor to HP Photo Creations, but to the HP Drivers and/or Windows 7: One of the print job in the queue never started to print…

    When print jobs are currently queued/printing, you should see a printer icon :printer: in the notification area. Click on this one to open the print queue. If you don’t see this icon, you can still open the queue  by clicking the Start button :start:, clicking Control Panel, clicking Hardware and Sound, and then clicking Devices and Printers. There, double-click your Printer to open its status window and access the Print Job Queue.

    In that queue, I found my print job in first position, apparently stuck… So I decided to cancel it (right click the job and select “Cancel”). Its status became something like “Deleting – Error – Printing” but the job never disappeared from the queue. Usually, the printer is displaying an error message (e.g.: no paper or ink any more) and once this error solved, the job disappears. But if you don’t find what’s wrong, the easiest solution consists in clearing the queue (including all the other pending jobs if any):

    1. Click Start-R to run a command and type services.msc to open the Service Administration console.
    2. Find the services “Print Spooler” in the list of services (As a tip: Select the first service and type “Print”. The cursor will move directly to the first matching name in the list)
    3. Right-click this “Print Spooler” service and Select “Restart”
    Et voilà. The Print Job Queue is now empty…

    Loading

  • Target multiple environments with only one TFS Build Server

    I had customize our Build Process Template to support multiple target environments on a single Build Machine. I.e.: to resolve the “file references” at Build time depending on the environment targeted for the deployment.

    Click to Read More

    At work, we have mainly four distinct environments: Integration, Qualification, Pre-Production and Production. Each application (and its referenced assemblies) are promoted from one environment to the next one via tasks (Release Distribution jobs) scheduled according to a predefined monthly Release Plan…

    TFS Build Machines not only compile the applications to be deployed via the standard Release Distribution, but also the urgent fixes to be deployed directly in Pre-Production without passing through Integration and Qualification environments. It also happens, although really quite seldom, that a Build skips the Integration and goes directly to Qualification.

    It’s also to be noticed that none of our applications (assemblies) are strong named and deployed in the GAC, neither on development workstations nor on servers. Instead, all referenced assemblies are always copied within the application’s bin folders, also on the servers.

    Therefore, basically, we would need Build Machines dedicated for each target environment with the adequate assemblies made available on them, for reference resolution purpose. That would be a pity to have such Build Machines (and the related setup, maintenance, backup costs, …) for at most one build per month (Fix in Production and Qualification are fortunately not common).

    To avoid that,  I did customize our Build Process Template to take a Reference Path as input and to pass it to MSBuild. Actually, when editing a Build Definition, the Builder can select the target Environment, and the Build will simply receive a path to the location containing the related assemblies.

    Ex.: MSBuild mySolution.sln /p:ReferencePath=”c:\RefAssemblies\Qualification\”

    How can I be sure that this Reference Path won’t interfere with any Hint Paths defined in the Visual Studio projects?

    First, note that the location provided to MSBuild via the “ReferencePath” parameter will be probed to resolve all “file references” before any other location on the standard probing path. But we also pay attention to not make the assemblies available on the Hint Path on the Build Machines:

    • On Development Workstations, all our assemblies are made available in a single “Reference Assemblies” folder. Developers add references on assemblies in there for development and local testing purpose. They can also start a task at will to update this “Reference Assemblies” folder with the latest version of the assemblies (the versions used in the Integration Environment) or with the version currently deployed in the Qualification or Production Environments (e.g.: for bug fixing purpose).
    • On the Build Machines, there is one “Reference Assemblies” folder per environment (i.e.: updated by the Release Distribution with the assemblies currently in use in that environment). None of those folders is located at the same path as the “Reference Assemblies” folder of the Development Workstations. As a result, MSBuild cannot use the Hint Paths found in the Visual Studio projects to locate the referenced assemblies. Instead, it uses the path of the “Reference Assemblies” folder passed to it via its parameter /p:ReferencePath.

    In addition to the “Reference Assemblies” folders per environment, we also have one  extra folder containing the output of each latest successful Build. This one is used for “Continuous Integration“. No need to update the references in the Visual Studio Projects, MSBuild always find in that folder the latest version of each assembly recently built on any Build Machine (if requested to do so via the Build Definition). This is by the way the default “target environment” for all “Rolling Builds” defined on “Development Branches”, so any breaking features in a new version of a referenced assembly is immediately detected. Builds “candidate” to be promoted use by default the Reference Path with the assemblies from the Integration environment.

    Loading

    ,