Installing Windows 8.1 to a Samsung Series 7 Slate

2013-12-24

Note: I already had the latest firmware version installed. If you haven't upgraded your firmware, do so before installing Windows 8 or 8.1 RTM. For the //Build tablets this is firmware version 05WJ. If you don't your tablet will be unable to start after the installation of the RTM bits

Samsung strongly urges retail slate users to also update to the latest firmware version before installing Windows 8. Also note that Samsung will not provide support for a slate that was originally installed with Windows 7. Why I do not know, I don't like it either.

I recently sold my Samsung 7 slate, but not before upgrading it to Windows 8.1. The easiest way is to just download the ISO equivalent to your Windows 8 installation (Pro or Enterprise) and performing an in-place upgrade, but the process to install cleanly hasn't changed much since Windows 8:
  • Make a backup of your content (Skydrive comes to mind)
  • Format a bootable USB key of 4GB. I used Fat32
  • Download the Windows 8.1 iso, or insert the disk into your machine
  • Copy the contents of the iso file to the empty usb disk (some slates can even boot by copying the iso file to the usb key as is). 
  • Now you have a usb installation key for Windows 8.1. Put it in the slate's usb port.
Depending on whether you have the //Build Developer Device or a retail Samsung 7 Slate, the next steps differs:
//BuildRetail
  • Restart your slate while holding [vol-up+vol-down] 
  • Disable CSM and Safe Boot in the bios.
    • Navigate, change value: vol-up, vol-down
    • Enter sub menu: Rotate lock
    • Confirm selection: Rotate lock
    • Cancel: vol-up+vol-down
  • Save the changes and restart the slate again while holding  [vol-up+vol-down].
  • Choose Boot from USB
  • Restart your slate while holding [pwr+winkey]
  • Enable UEFI, Legacy USB
    • Navigate on page, change value: vol-up, vol-down.
    • Enter sub menu: Rotate Lock
    • Confirm Selection: Rotate Lock
    • Navigate between pages: Rotate lock + vol-up/down
    • Cancel: Winkey
  • Save changes and reboot.
  • Hold winkey+pwr
  • Go to the last tab and choose to boot from the usb key you have connected to the slate.
This should start the installation process for Windows 8.1. 
  • In the drive selection screen click advanced and delete all the partitions of the slate.
  • Choose to create a new partition. I opted for one big one.
  • Setup will also create an Emergency Partition and some other partition used for the boot loader and BitLocker, this is normal..
  • Next, next, finish, reboot reboot reboot.
Ok, so now you're in Windows. In my case all drivers loaded themselves. While the touch drivers are updated, your slate may act weird. Wait for the driver installation to happen silently in the background. Touch should return to normal function automagically.

When I tried to activate it said "DNS not found". And I couldn't find any place to enter my key (I installed Windows 8.1 Enterprise, this is easier with  Pro). So I entered it from an Administrative command line (ctrl-shift-enter in the start menu, or slide tile down and start it as administrator from the options bar).

slmgr.vbs -ipk insert-your-product-key-here
slmgr.vbs -ato

After activation a couple of drivers were updated. Nothing fancy.

Most drivers are detected automatically. Some can be installed with drivers from the original manufacturer for a newer version.

So far I've added the following additional device drivers to the system:
Note: Intel releases new drivers regularly. I've stopped updating the above list of links. To check whether you have the latest driver versions, visit the Intel Driver Update Utility page.

Then make sure you've backed up your Bitlocker recovery keys if you use the bitlocker security feature.
    There is a firmware upgrade for the Touch sensors available which reduces tap-and-hold issues and generally improves the touch experience.


    Resolving test run issues in Visual Studio "Some or all identity references could not be translated"

    2013-12-19

    One of my devs ran into a strange bug in the Visual Studio test runner today. It manifests itself in the fact that tests won't run and you'll find the following error message in the Output\Test window:

    ------ Run test started ------
    Some or all identity references could not be translated.
    Operation is not valid due to the current state of the object.
    ========== Run test finished: 0 run (0:00:00,2280287) ==========
    

    It only occurs when your project contains a Web Application which is configured to be hosted in IIS it seems.

    Red-Gate releases Reflector .NET 8.3

    2013-12-15

    And they finally integrated the Analyzer feature into Visual Studio. Now you can find out where a specific call is bing used, right from your editor. I find this feature immensely handy when trying to figure our how to use a certain feature. This is especially handy when you're working with scarcely documented libraries like parts of the TFS Client Object Model. Find code in TFS Web Access that's using the same API to find out how you're supposed to call it.


    More information can be found on the Red-Gate Reflector .NET 8.3 Release blog.

    Resharper 8.1 goes gold & Resharper CLI

    For those of you who are using Resharper, version 8.1 was just released with Typescript support and better integration with Visual Studio 2013. The full release blog can be found here.


    With Resharper 8.1 also ships an updated version of the Resharper Commandline Interface. This allows you to integrate Resharper in your build process. 8.1 introduces support for multiple configurations/cpus for your projects, but still requires the full context of a solution to execute.

    Check out this older post to integrate Resharper CLI with Team Build 2012 (and 2010 probably). That way you can get the same warnings and errors in the IDE as in your Continuous Integration build. The Build workflow for 2013 has changed considerably and requires its own Custom Activity to execute. Judging by the Resharper ticket system, this is coming in a future release, but I might roll my own in the mean time.

    Upgrade your existing ASP.NET MVC4 application to MVC5

    2013-12-09

    To upgrade your existing MVC 4 application to MVC 5 you need to go through a number of steps to replace the references and patch the web.config. These steps are clearly explained in the original post, but when you're done you'll initially loose the handy context menu items to add controllers and views. You must take a few additional steps to complete the process.

    After walking through all the steps mentioned, make sure your project has the following ProjectTypeGuids:

    <projecttypeguids>
         {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
    </projecttypeguids>

    Now, if you want to keep using Visual Studio 2012, you'll loose the "Add View" and "Add Controller" context menu options, they'll be working just fine in Visual Studio 2013 which coomes with MVC5 support built-in. To get them back in Visual Studio 2012 you need to install the following items:

    1. Visual Studio 2012 Update 4
    2. Web Tools 2013.1 for Visual Studio 2012 (Web Platform Installer | Direct Download)

    To check what other cool features you'll gain by upgrading, check out the release post.

    Source: StackOverflow

    Enabling Mighty Moose for Visual Studio 2013

    2013-12-07

    Warning: This is probably totally unsupported, and might come with its own class of issues, but so far it seems to work...

    To enable Mighty Moose in Visual Studio 2013 do the following steps:
    1. Install Mighty Moose
    2. Create a 2013 Addin file
      1. Copy the C:\Program Files (x86)\ContinuousTests\AutoTest.VS.2012.Addin to C:\Program Files (x86)\ContinuousTests\AutoTest.VS.2013.Addin
      2. Edit the 2013 file and update the version numbers from 11.0 to 12.0
    3. Or drop the following file: AutoTest.VS.2013.Addin in your  MightyMoose installation folder.
    4. In Visual Studio open the Tools - Options - Environment - Add-in Security page and add C:\Program Files (x86)\ContinuousTests to the list of trusted add-in paths.
    5. Restart Visual Studio
    This seems to do the trick for me. Not sure if there are any issues with this, as I haven't played around with it too much. I had Visual Studio 2010, 2012 and 2013 installed side-by-side, so I didn't have to trick the installer into believing that there is a suitable version of Visual Studio anywhere.

    See also: StackOverflow.

    ALM Rangers ship the TFS Reporting guidance books and samples v1

    2013-12-05

    It has taken a lot of people a long time to work on an extensive guide on extending the TFS reporting capabilities and getting some report data out of the Team Foundation Service. Grab your copy while it's hot!

    vsarReportGuide_covers


    Enabling Resharper-CLI in Team Build

    2013-11-28

    JetBrains is working on a Commandline interface that allows you to run the Resharper Code Inspections without opening up Visual Studio. Which is pretty cool! It's still in Early Access Program mode, but you can already download it and play around with it.

    It's actually not that hard to integrate it into Team Build. Though there are a few challenges... First, let's go through the steps you'll need to take to integrate it...

    Map the $/TeamProject/BuildProcesstemplate folders to disk and get the latest version. Now doubleclick the template you want to edit and find the "Run MSBuild for Project" activity.

    Create a new "If" conditional activity underneath it:
    I named it "If compatible with Resharper-CLI", since the commandline version can only work in the context of a Visual Studio Solution file at the moment. So if you're building individual projects or are calling an msbuild script directly, the Resharper-CLI can't help you out just yet.

    Add the following expression to the if statement to check for the tell tale sign of a solution file. The extension will end on .sln:

    String.Equals(Path.GetExtension(localProject), ".sln", StringComparison.OrdinalIgnoreCase)
    

    Then drag a "Invoke Process" activity in the Then branch of the if statement and configure that to call the commandline tool:

    I've installed the Resharper-CLI tools in a well-known location on my build agent, but if you want to do fancy registry magic to look up the right location, or grab it from source control, I leave that up to you.

    Now we'll need to set the arguments to pass the solution to the process. And to tell it where to drop the output file:


    I'm actually passing it the location to write the report to (/o), the location to store the cache (/caches-home) to speed things up and the solution path.

    String.Format("/o:""{0}"" /caches-home:""{1}"" ""{2}""", System.IO.Path.Combine(outputDirectoryPerProject, System.IO.Path.GetFileNameWithoutExtension(localProject)) + ".resharper.xml", "d:\resharper-cli\cache", localProject)
    

    I wired up the Standard Output and the Standard Error like I would always do (WriteBuildMessage, WriteBuildError), but that turned out not to work. If you'd do that and check in the process template you'll see that every message is written to the Error stream. I've logged a bug at Jetbrains for that. So I added some logic to fix that, it isn't perfect, but it's as good as I could get in a few clicks.

    Remove the WriteBuildError from the "Handle Error Output" item, and instead add a switch. Let that switch trigger in the first 4 characters of the line being logged and depending on the value either log a message, a warning or an error.

    Now go ahead, check in the .xaml file and trigger your build, Resharper warnings and errors should now be added to your build output.

    You'll end up with a piece of xaml that will look exactly like this:
    <If Condition="[String.Equals(Path.GetExtension(localProject), ".sln", StringComparison.OrdinalIgnoreCase)]" DisplayName="If compatible with Resharper-CLI" sap2010:WorkflowViewState.IdRef="If_37">
      <If.Then>
        <mtbwa:InvokeProcess Arguments="[String.Format("/o:""{0}"" /caches-home:""{1}"" ""{2}""", System.IO.Path.Combine(outputDirectoryPerProject, System.IO.Path.GetFileNameWithoutExtension(localProject)) + ".resharper.xml", "d:\resharper-cli\cache", localProject)]" DisplayName="Run Resharper-CLI for Project" FileName="d:\jetbrains-CLI\InspectCode.exe" sap2010:WorkflowViewState.IdRef="InvokeProcess_1" WorkingDirectory="[SourcesDirectory]">
          <mtbwa:InvokeProcess.ErrorDataReceived>
            <ActivityAction x:TypeArguments="x:String">
              <ActivityAction.Argument>
                <DelegateInArgument x:TypeArguments="x:String" Name="errOutput" />
              </ActivityAction.Argument>
              <Switch x:TypeArguments="x:String" DisplayName="" Expression="[errOutput.Substring(0, If(errOutput.Length >= 4, 4, 0))]" sap2010:WorkflowViewState.IdRef="Switch`1_1">
                <Switch.Default>
                  <mtbwa:WriteBuildMessage sap2010:WorkflowViewState.IdRef="WriteBuildMessage_3" Importance="[Microsoft.TeamFoundation.Build.Client.BuildMessageImportance.Low]" Message="[errOutput]" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces" />
                </Switch.Default>
                <mtbwa:WriteBuildWarning x:Key="WARN" sap2010:WorkflowViewState.IdRef="WriteBuildWarning_3" Importance="[Microsoft.TeamFoundation.Build.Client.BuildMessageImportance.High]" Message="[errOutput]" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces" />
                <mtbwa:WriteBuildError x:Key="ERRO" sap2010:WorkflowViewState.IdRef="WriteBuildError_2" Message="[errOutput]" />
              </Switch>
            </ActivityAction>
          </mtbwa:InvokeProcess.ErrorDataReceived>
          <mtbwa:InvokeProcess.OutputDataReceived>
            <ActivityAction x:TypeArguments="x:String">
              <ActivityAction.Argument>
                <DelegateInArgument x:TypeArguments="x:String" Name="stdOutput" />
              </ActivityAction.Argument>
              <mtbwa:WriteBuildMessage sap2010:WorkflowViewState.IdRef="WriteBuildMessage_2" Importance="[Microsoft.TeamFoundation.Build.Client.BuildMessageImportance.Low]" Message="[stdOutput]" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces" />
            </ActivityAction>
          </mtbwa:InvokeProcess.OutputDataReceived>
        </mtbwa:InvokeProcess>
      </If.Then>
    </If>
    

    This will now drop a "[Solution].resharper.xml" in the build drop folder. I haven't yet parsed the file so that you can actually fail the build based on it, that'll be something for a future blog post.

    And without me writing that future post, I was contacted over twitter to let me know that someone else has already done it for me:



    [BuildActivity(HostEnvironmentOption.All)]  
        public sealed class ParseResharperCLI : CodeActivity
        {
            // Define an activity input argument of type string
            public InArgument<string> PathToXml { get; set; }
            public OutArgument<string[]> Warnings { get; set; }
            public OutArgument<string[]> Errors { get; set; }
     
            // If your activity returns a value, derive from CodeActivity<tresult>
            // and return the value from the Execute method.
            protected override void Execute(CodeActivityContext context)
            {
                var document = XDocument.Load(context.GetValue(PathToXml), LoadOptions.None);
                var issueTypes = document.Descendants("IssueType")
                     .Select(x => new
                     {
                         Id = x.Attribute("Id").Value,
                         Severity = x.Attribute("Severity").Value
                     })
                     .ToList();
     
                var issues = document.Descendants("Issue")
                    .Select(x => new Issue
                    {
                        File = x.Attribute("File").Value,
                        Message = x.Attribute("Message").Value,
                        Severity = issueTypes.First(t => t.Id == x.Attribute("TypeId").Value).Severity,
                        Line = x.Attribute("Line") != null ? x.Attribute("Line").Value : null,
                    })
                    .ToList();
     
                var warnings = issues
                    .Where(i => i.Severity != "ERROR")
                    .Select(i => i.ToString())
                    .ToArray();
                var errors = issues
                    .Where(i => i.Severity == "ERROR")
                    .Select(i => i.ToString())
                    .ToArray();
     
                context.SetValue<string[]>(this.Errors, errors);
                context.SetValue<string[]>(this.Warnings, warnings);
            }
        }
     
        public class Issue
        {
            public string File { get; set; }
     
            public string Message { get; set; }
     
            public string Severity { get; set; }
     
            public string Line { get; set; }
     
            public override string ToString()
            {
                return string.Format("{0}  File: {1}  Line: {2}  Message: {3} ", Severity, File, Line, Message);
            }
        }
    

    Updated MSOCAF for Visual Studio Code Analysis rules

    2013-11-18

    2 years ago I worked on a huge SharePoint project where we had to run the MSOCAF wizard  before deployment to the production  environment. And of course, every time a few rules triggered that caused huge rework efforts.

    So I ended up recompiling the FxCop 1.36 rules that ship with MSOCAF 2010 to work with Visual Studio 2010.

    Today I redid that work and compiled the following sets of rules:
    • C:\Program Files (x86)\Microsoft Visual Studio {10|11|12}.0\Team Tools\Static Analysis Tools\FxCop\Rules
    Or create a custom .ruleset file and tell it where to find the binaries.

    Team foundation Service is now known as...

    2013-11-14

    Visual Studio Online Logo
    And I've updated the tags to all posts referencing TFSvc to now also include Visual Studio Online. This helps clear up the definition of TFS is that Server or Service? So, TFS is the on premise product and VSO is the one in the cloud (with a lot of very cool features!).

    Read more on this excellent blog post by Ed Blankenship.

    Use Git commandline directly from Visual Studio

    2013-11-08

    Not many people seem to know this, but the Visual Studio Package manager is nothing more than a Powershell window inside Visual Studio with a bunch of modules loaded. Which means that you can use it to execute just about any command you'd like.

    So if you need to run git commands to stash or squash something, all you need to do is type the command right into that window.

    To make your life easier you can even add PoshGit to the Package Manager Console, this will give you command auto-completion. yay!

    Install the Git Command Line tools.

    Execute the following commands from the package manager console:

    Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Confirm
    (new-object Net.WebClient).DownloadString("http://psget.net/GetPsGet.ps1") | iex
    Import-Module PsGet
    Install-Module Posh-Git –force
    . $PROFILE
    

    Now you have command completion inside Visual Studio. Nice!

    My must-have extensions for Visual Studio 2013

    Visual Studio 2013 has been available for a while now, and next week is the official launch party. Ever since I started using Visual Studio my life has been made easier by all the great extensions that people write for it. This is the list of things I install almost as soon as I see the "Installation Completed" screen of Visual Studio itself:

    Resharper
    This product shouldn't need any introductions. It has been one of the most-used commercial Visual Studio productivity extensions. The only alternative that is equally valuable for me would be Code Rush, but somehow most of my clients have already standardized on Resharper. I miss some of the features from Code Rush (debug helpers, dynamic templates), but can do without them.

    +Plugins: AgentMulder, AgentRalph, InternalsVisibleTo Helper, JsLint, Razer Plugin, TestCop
    Resharper 8 now comes with NuGet support for plugins, which is great, as it helps you keep your plugins up to date! I have the above mentioned plugins installed to make life easier when doing a lot of Unit Testing and ASP.NET MVP development.

    VSCommands
    VsCommands adds some small features that are really handy. Think of Command Line Here, Locate in Solution Explorer, And for those of you that work a lot in MsBuild to write their own before/after build targets, the Edit Project File option is ideal. Plus it shows the current branch name in the title of your Visual studio window.

    Reflector .NET
    Resharper comes with dotPeek and Code Rush has a decompiler window, but only Reflector has one feature that's even better: Debug symbol generation. Using Reflector you can generate debug symbols for assemblies that you don't have symbols or sources for, making it possible to debug nasty issues in e.g SharePoint or any other closed source product for that matter. It has saved me on multiple occasions. To make it work with Resharper you do need to tweak the Resharper code Navigation settings:


    This will allow Reflector to hook into the F12 handling of Visual Studio so you'll still see a decompiled version of any method you navigate to, just not from dotPeek/Resharper.

    TFS Source Control Explorer Extensions
    If you're, like me, an ALM support to any team you've been added to, then you'll probably see a lot of branch plans that got completely out of hand. In these cases (and even when you do have a working branch plan), the TFS Source Control Explorer Extensions are invaluable. It adds the Branch commands that are normally only possible from the command line directly to the Source Control Explorer and enabled drag&drop for files and folders to quickly and easily move things around.

    I do disable two features:

    The change files date on Get adds a long waiting period to large gets and I never look at the dates on my file system anyway and the Files icon change changes the icons around for branches and folders, but this doesn't add any value to me.

    Branch Info Team Explorer
    Ever wondered which branch your Solution was rooted in? Ever accidentally changed code in the wrong branch and then had to roll back and backport into the right one? That's why I have this little gem installed. Unless you're using a very complex workspace mapping, this extension to Team Explorer shows you exactly which branch your solution is coming from.


    It also allows you to quickly switch to the same solution in another branch. That's very handy for people working on multiple feature branches or supporting multiple versions of the same product!

    Visual Studio Team Foundation Server Power Tools
    One more add-on for TFS. This one should be installed on all systems by default. Even just the extended commandline tools (tfpt). If you're into the command line stuff, then you'll also like the TfsTeamTools, the TfsBranchTools. If you've ever had to edit the Process Template of a TFS Project, then you're also going to love this set of extensions.

    Codelens Code Health Indicator
    If you're lucky enough to run Visual Studio Ultimate, then you'll love Codelens. It adds a lot of valuable information right into the editor, making it easier to see what has been going on with the code you're working on.

    The Code Health Indicator provides a way to show the metrics from the Metrics Tool Window directly in your source window. This little add-on gives me back one of the features from Code Rush that I missed since installing Resharper.

    The download page says it only works on Visual Studio 2013 RC, but so far it's been working on the RTM version as well with no issues (for me at least)...

    Web Essentials
    As you can tell by my inclusion of the Code Health indicator, quality code is important to me. Web Essentials adds JsHint support to Visual Studio and it helps define Stylesheets with the maximum cross-browser compatibility! Combine that with jsdoc, minification, less and coffeescript support and you can make many-a-html5-guru happy! If Sass support is important to you, install the Web Developer Workbench as well.

    JSHint

    I'd love it when Web Essentials would provide MsBuild support for minification, JsHint and CssLint as well, but though it has been on the feature request llist a long time, it hasn't been added so far. This would also allow integration of WebEssentials into Team Build.

    Chutzpah Javascript Test Runner
    When talking about WebEssentials, a way to execute Javascript tests is next on the list of achieving high quality code in a Web Development environment. Chutzpah does just that, it can execute Jasmin and QUnit tests written for Javascript and it integrates directly into the Visual Studio test runner. The beauty of that, is that it also integrates in Team Build and can thus pass or fail a build based on Javascript tests passing or failing.

    NUnit & XUnit test runners
    Should Mstest not be your tool of trade, since Visual Studio you can now add test runners to other test frameworks as well. So instead of adding a test runner for a whole different language, as is the case with Chutzpah, this adds support for additional test frameworks your managed code unit tests. Full support for team build as well, which is nice!

    With the NUnit test runner you can also execute tests that were generated by Selenium as an alternative to the standard Visual Studio CodedUI tests.

    Team Room extension
    Are you working in a Distributed team, or people work from home a lot, then this addition to Team Explorer is really nice! It puts Team Rooms, a new feature of Team Foundation Server 2013 and Team Foundation Service directly into Visual Studio. No need to leave Visual Studio to chat with your team members or see their updates. Plus is was built by my own colleagues, what more could you wish for ;)!

    Wix Toolset
    Ever since the removal of the Visual Studio Setup Projects (or actually way before that, ever since I started using Team Build), I've been using Wix for my setup requirements. Though I usually don't create fancy UI's or extensively configurable stuff, I do like my installers to register themselves into the Programs and Features window and to be able to upgrade  (and downgrade) my application gracefully. Wix can help you do that!

    StyleCop
    Yay! A Visual Studio  2013 and Resharper 8.0.2000.2660 compatible version has been released. Stylecop helps you write your code in a clean way and helps ensure that team members all use the same  coding style. In itself it's a huge  pain, since I never seem to be able to remember all the rules in the style guide, but when combined with Resharper and it's magic alt-enter, it is incredibly helpful.

    There are a few things that are still missing
    Though almost every add-on for visual studio I regularly use has been ported to Visual Studio 2013 already, there are still a few that are missing. These will probably follow suit int he near future.


    TIP: Don't run the AMD Driver Cleaner Utility on Windows 8 or 8.1

    2013-10-22

    Ok, let me repeat this a couple of times:

    Ok, got your attention?

    Check out this link on Guru3D for the details, basically it breaks a lot of things in Windows. In my case I stumbled onto it because the NTFS permissions dialog no longer opened. The only way to resolve it for me turned out to be to start setup from Windows itself and pick the Upgrade option (basically doing an in-place reinstall, keeping apps & settings).

    Visual Studio Tip: How to always launch the debugger under a different user profile

    2013-09-10

    One of my team members shared his debug workflow for a set of executables that manipulate Exchange and CRM through webservice calls. This tool always needs to run in the context of a specific service account, even when debugging and testing against the development environment. A practice that needs changing, but until that has been managed, this is how it is.

    So for now the developer in question has always used a separate commandline to start the subject under test/debug using the `runas /user` command. like so:

    c:\> c:\windows\system32\runas.exe /user:domain\username command

    Then he attaches the debugger through Visual Studio's debug, attach to process... Even though it's only a few steps, it's hard to use and requires the dev to constantly retype the credentials.

    There's a little trick that makes life easier. You still need to open a command prompt at least once and you need to specify one more commandline switch:

    c:\> c:\windows\system32\runas.exe /savecred /user:domain\username cmd

    You will be prompted for the password for the account in question. Then open the projects properties and navigate to the debug tab, set the startup executable to "c:\windows\system32\runas.exe" and the arguments to "/savecred /user:domain\user YourProjectOutput.exe".


    Now when you start the debugger, Visual Studio will automatically launch your application under the right credentials without asking you to supply the password each and every time.

    Change the "Sources", "Binaries" and "TestResults" folders in Team Build

    2013-07-18

    Team Build by default creates 2 folders on your build agent:

    • 2010
      • Sources
      • Binaries
      • TestResults
    • 2012:
      • src
      • bin
      • TestResults
    • 2013:
      • src
      • bin
      • tst
    These folder names were shortened as part of the 2012 release, partially to resolve "Path too long" issues with team build. But some of your scripts might depend on the old naming. (Or maybe you want to change the "TestResults" folder to something simpler, like "test".

    Update to WebTools 2012.2 to resolve System.ComponentModel.Composition.ImportCardinalityMismatchException

    2013-07-15

    Today one of my teams was greeted by a Visual Studio crash upon opening their solution. It happened with no changes to the solution over the weekend, but some Windows Updates were remotely installed to the machines.

    After some testing we found that the crash will go away by ensuring that the latest version of the WebTools 2012.2 is installed. Since these machines are blocking all kinds of features of Internet Explorer (such as Javascript and exectutable downloads), getting the updated version installed was quite a hassle.

    The direct link is here:
    1. Get the ASP.NET 2012.2 pieces then get one of these
    2. Web Tools 2012.2 for any regular Visual Studio 2012 or Web Tools 2012.2 for Visual Studio Web Express
    Update the ASP.NET 2012.3 and Web Tools 2012.3 are now out as well:


    (Thanks Scott)

    Properly incorporate MsBuild arguments into your build process template

    2013-07-08

    Ever wondered how to put features like Architecture Layer validation into your builds? If you bingle it you'll find loads of posts that tell you which argument to pass to msbuild. The official MSDN docs for this feature can be found here.

    Basically, the trick is to either edit your Visual Studio Modelling project to always do layer validation, but that then also happens on the client unless you add a couple of conditions to it:

    <!-- Use $(BuildingInsideVisualStudio) or $(TeamBuildConstants) to detect building inside Team Build -->
    <PropertyGroup Condition=" '$(BuildingInsideVisualStudio)' == '' "> 
        <ValidateArchitecture>true</ValidateArchitecture>
    <PropertyGroup>
    

    Or to to add the following argument to the commandline:

    /p:ValidateArchitecture=true

    Use local NuGet file repository to use NuGet on a Build Server that has no access to the webs.

    2013-06-26

    Scott Hanselman has blogged about using your local NuGet cache as your private local NuGet server in case your connection is down. And that works great when you're working locally. When working with Team Build you have multiple options, one is to enable Package restore and use Nugetter to have Team Build download the files during build, the other is to check your packages into sourcecontrol.

    We had configured Nugetter on our previous build server and on all the local workstations, but a recent change in VPN's, DMZ's and other infrastructure stuff, the Build server has ended up behind a firewall that is blocking outgoing connections... So all our builds started failing.

    Since this was going to be fixed again soon, we decided to apply the same trick Scott used to work locally to our build server. One of the developers has copied the local NuGet cache over to the build server and we've added the following item to the MsBuild Commandline Arguments:

    /p:PackageSources:d:\NuGetCache


    This will instruct NuGetter to look in that location for its packages during the package restore phase.

    Now when the internet connection has been restored, removing this line will resume normal operation. Until then we can still build :).

    Update Build Quality and Keep Indefinitely in TFS from the commandline

    As you probably know, TFS keeps all kinds of data behind when it finishes an automated build. Test Results, the stuff it copied to the drop folder, symbols etc. And by default it will keep the last 10 builds of data around and then starts cleaning up.

    When you deploy a build to production, you don't want TFS to delete the symbol files and you might want to retain the test results etc as well. On the Build Detail screen, you can click a link to tell TFS you want to 'Retain the build indefinitely'.

    This option cannot be set from the commandline, which is a pity when you want to ensure this is set correctly once your automated deployment process picks up the build and does stuff with it.

    So I've written a little utility which handles this for you.

    The actual piece of code is very simple and straightforward:

    1. Connect to TFS
    2. Request the build
    3. Change the options
    4. Save the result


    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    using CommandLine;
    using CommandLine.Text;
    
    using Microsoft.TeamFoundation.Build.Client;
    using Microsoft.TeamFoundation.Client;
    using Microsoft.TeamFoundation.Client.CommandLine;
    
    namespace TfsBuildUtil
    {
        class Program
        {
            private static CommandlineParams commandlineArgs;
    
            static void Main(string[] args)
            {
                commandlineArgs = new CommandlineParams();
                bool parseresult = CommandLine.Parser.Default.ParseArgumentsStrict(
                    args,
                    commandlineArgs,
                    () => Console.Write(commandlineArgs.GetUsage()));
                
                if (parseresult)
                {
                    var server = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri(commandlineArgs.ProjectCollection));
                    server.EnsureAuthenticated();
    
                    var buildserver = server.GetService<IBuildServer>();
                    var build = buildserver.GetBuild(new Uri(commandlineArgs.BuildUri));
    
                    bool save = false;
    
                    if (commandlineArgs.Quality != null)
                    {
                        if (!string.Equals(build.Quality, commandlineArgs.Quality, StringComparison.CurrentCulture))
                        {
                            build.Quality = commandlineArgs.Quality;
                            save = true;
                        }
                    }
    
                    if (commandlineArgs.KeepForever.HasValue)
                    {
                        if (build.KeepForever != commandlineArgs.KeepForever.Value)
                        {
                            build.KeepForever = commandlineArgs.KeepForever.Value;
                            save = true;
                        }
                    }
    
                    if (save)
                    {
                        buildserver.SaveBuilds(new[] { build });
                    }
                }
            }
        }
    
        public class CommandlineParams
        {
            [Option("collection", HelpText = "The project collection Uri", Required = true)]
            public string ProjectCollection { get; set; }
    
            [Option("build", HelpText = "The build uri", Required = true)]
            public string BuildUri { get; set; }
    
            [Option("quality", HelpText = "Quality to set", Required = false)]
            public string Quality { get; set; }
    
            [Option("keep", DefaultValue=false, HelpText = "Set keep forever", Required = false)]
            public bool? KeepForever { get; set; }
    
            [HelpOption]
            public string GetUsage()
            {
                var help = new HelpText
                {
                    Heading = new HeadingInfo("Tfs Build Utility", "1.0"),
                    Copyright = new CopyrightInfo("Jesse Houwing", 2012),
                    AdditionalNewLineAfterOption = true,
                    AddDashesToOption = true
                };
    
                if (LastParserState.Errors.Count > 0)
                {
                    var errors = help.RenderParsingErrorsText(this, 2);
                    help.AddPreOptionsLine(errors);
                }
    
                help.AddOptions(this);
                return help;
            }
    
            [ParserState]
            public IParserState LastParserState { get; set; }
        }
    }
    

    The commandline will look like this:

    tfsbuildutil --collection http://localhost:8080/tfs/DefaultCollection --build vsts:///Build/Build/1234 --keep true --quality "Deployed to Production"
    
    Download the solution here.

    Connecting Team Explorer Everywhere to TFS results in Certificate error

    2013-06-25

    When you're trying to connect Team Explorer Everywhere (or any other Java-based application for that matter) to Team Foundation Server you might run into the following, very helpful, message:

    An error occurred: sun.security.validator.ValidatorException:
         PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException:
         unable to find valid certification path to requested target
    



    First ALM Ranger guidance in Ebook format

    2013-05-29

    By based on a Visual Studio User Voice request and a lot of internal discussions we, the ALM Rangers, are proud to present our very first official ebook formatted guidance. Available in epub and mobi format. This has been a long standing wish from my side, since I really prefer ebook or real paper over reading from screen.

    If you're as happy as I am about the release of the guidance in ebook format, then please share your positive feedback. If you're seeing issues on your e-reader or other possible improvements, please also leave feedback.

    Code Review Check-in Policy for TFS 2012

    2013-05-08

    The question whether you can force that Code Reviews must be done before checking in a set of changes in TFS. And up until recently there wasn't. Colin created a check-in policy and shared it on the Visual Studio Gallery.



    It will show up like this:

    Grab it while it's hot it this is something you really want/need. I'll personally not be using it, since I currently have a co-located team with excellent communication going on at the moment.

    Connecting Visual Studio 2005 to TFS 2012 and the Team Foundation Service on XP

    2013-04-27


    In a previous post I explained how to connect Visual Studio 2005 to Team Foundation Server 2012 and the Team Foundation Services. This solution works for Windows 7 and 8, but not on Windows XP, since Team Explorer 2012 cannot be installed on Windows XP. There is a workaround for this now through the updated version of the MSSCCI provider for 2010, which now works with Visual Studio 2005 :

    The Team Foundation Server MSSCCI Provider enables integrated use of Team Foundation Version Control with products that do not support Team Explorer integration.
    This version includes:

    • Updated provider to link against VS 2010 RTM TFS assemblies
    • Improved functionality and performance when used inside PowerBuilder
    • Improved handling of branched solutions in SQL Server Management Studio
    • Decreased number of server prompts
    • Improved error reporting
    • Added support for Visual Studio 2005 to enable VS2005 clients intalled on Windows XP to connect to TFS2012

    Creating a Custom Unit Test Generator Provider Plugin for Specflow 1.9

    2013-04-26

    After getting CodedUI Code First and Specflow to play nicely together in the past week, we ran into a few issues with the distribution of the Custom Code Generator Provider assembly to all team members. The SpecFlow binaries installed under a path that contains a random character string and I felt a bit unhappy about the way that other developers had resolved this issue by placing the assembly in the NuGet package folder. Especially since we don't check in the binaries in TFS and package restore might go funcky.

    The SpecFlow documentation mentions the new way of registering your Custom Generators through the new configuration item. That is where the documentation ends. But the promise of being able to store your plugin relatively to the test project root looked very promising so I got to work.There is now a SpecFlow.CustomPlugin NuGet Package which will get you started creating your own Specflow plugin. To add the package you must create a new Class Library project using .NET Framework 4.0 or 4.5.

    Combining CodedUI Code first, SpecFlow and Visual Studio 2012

    2013-04-22

    Today we tried to combine a number of different test technologies on the latest version of Visual Studio and ran into a few small issues. We found a work around for all of them. So if you want to use the BDD style of Specflow to test the UI of your applications, hold tight.

    Make sure you have a version of Visual Studio that supports CodedUI tests (Premium or Ultimate) and install the following add-ons to enable SpecFlow:


    Create a new test project (we're using an MsTest based test project, since CodedUI requires that) and use the package manager or the package manager console to add the following NuGet packages:

    Techdays 2013 presentation - Better code through review and tools

    2013-03-08

    By request of the audience, a link to the slide deck of our Techdays 2013 presentation on Better code through review and tools (in Dutch). There isn't too much useful information in the deck itself, since Thomas Huijer and I provided a lot of anecdotal experience along with the rather barren slides. But should you have questions, please don't hesitate to ask.

    Unfortunately, the presentation wasn't recorded this year.

    Links to interesting content:


    Presentation after the break.

    Bring back the "Create Unit Tests" feature from Visual Studio 2010?

    2013-02-25

    There's a feature request on User Voice that requests Microsoft to bring back the "Create Unit Test" menu item which was removed in Visual Studio 2012. I've seen it come up as a potential Ranger solution and it's been getting a lot of votes so far.

    It turns out that the feature has been there all along, was it was just removed from the ever crowded right-click context menu? Or is there something else at work here? It's my belief, not confirmed or backed by the Product Team in any way, that it was removed to promote a better practice for writing unit tests. The fact that this feature only works for MsTest and not for the XUnit and NUnit, might also have been an influence to remove the menu item.

    The danger of generating unit tests from the implementation is that chances are likely you'll be testing the implementation and not the actual functionality. This is a common problem with writing tests after writing the code. Since you already know exactly how the 'intended' functionality has been implemented, it's really easy to fall into the trap of mimicking or even duplicating the functionality in your test. The result is that whenever the implementation changes, your test is likely to fail, even when the functionality remained the same.

    So, if you really liked the "Create Unit Test" menu item, sure, you can bring it back. But I'd strongly suggest you look at the way you write your tests.

    New Tfs Team Tools beta release

    2013-02-16

    Mattias, the main contributor to the Tfs Team Tools has published a new beta release which includes the changes I'd added to the project. So now you can download a pre-built copy of the tools that includes the ability to update user and team images and convert existing security groups to teams.

    Get it here from the Tfs Team Tools codeplex site!

    For more details in these features, check out:

    Any and all feedback is appreciated!

    Converting a Group to a Team in TFS 2012

    2013-02-02


    Some time ago I blogged about the few lines of code required to convert a TFS Group to a Team. It's now available as part of the latest beta version of the Tfs Team Tools from codeplex.

    D:\Sources\TfsTeams\Main\TfsTeams CmdLine\bin\Debug>tfsteams GroupToTeam /collection:http://localhost:8080/tfs/DefaultCollection /teamproject:Scrum /group:NoTeam
    Group [NoTeam] converted to team.
    
    D:\Sources\TfsTeams\Main\TfsTeams CmdLine\bin\Debug>
    

    Grab it while it's hot :). This is especially handy if you've upgraded an older Project Collection to TFS 2012 and where you were already using groups to distinguish teams.

    Microsoft provides full Git support for Visual Studio 2012 and Team Foundation Service

    2013-01-30

    Today Microsoft publicly introduced the first Community Preview version of the Git tools for Visual Studio and the Team Foundation Service at the ALM Summit. Microsoft is fully committed to supporting this open distributed version control platform going forward. This was one of the top requests on Uservoice. It's pretty cool to see how both Microsoft and groups like the ALM Rangers are actively looking at these suggestions and transform them in working features.

    A few features are not yet on par with 'standard' Team Foundation Server version control, any current feature that depends on Changesets will not work with Git as version control provider. I expect Microsoft will work on enabling these features going forwards. Most visible feature to not be supported in Git for now would be Visual Studio Code Review.

    Focusing on the things Git does enable is much more interesting.
    • Compared to local workspaces, Git is a lot more powerful. 
    • The Branching and Merging capabilities, especially of 'baseless' merges are a lot more powerful than in standard Version Control. 
    • It works with any Git repository out there
    • The Team Foundation Service implementation is straight Git and thus you can use Visual Studio with any Git Repository, but  you can also use any development environment that supports Git and connect to the Team Foundation Service.
    Git is not yet released as an addon or feature for the on-premise version of Team Foundation Server. Expect it in the next major release.

    Congratulations to the team that made this happen. Keep up the good work!

    If you, like me, would like to get to know Git a bit better, check out these free (and very extensive) ebooks!

     

    Convert a TFS 2010 Group to a 2012 Team after upgrade

    2013-01-20


    With TFS 2010 it was already a common practice to create security groups as subgroups of the Contributors group to define teams. When you upgrade a Team Project Collection with such a setup to 2012, there is no way to convert these existing semi-teams to fully supported 2012 teams out of the box.

    It turns out that you only need to apply a few small changes to the security group to have it upgraded.

    Connect to TFS and retrieve the group:

    collection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri(collectionUri));
    collection.EnsureAuthenticated();
    
    var identityManagementService = collection.GetService<IIdentityManagementService2>();
    
    var securityIdentity = identityManagementService.ReadIdentity(group);
    

    Set the team property and save it:

    securityIdentity.SetProperty(IdentityPropertyScope.Local, "Microsoft.TeamFoundation.Team", (object) true);
    identityManagementService.UpdateExtendedProperties(securityIdentity);
    

    I'll probably end up submitting this as another patch to the TFS Team Tools project.

    Which UIEditors are available for Team Build by default

    2013-01-16

    Types inheriting from UITypeEditor
    Recently I was asked to extend a Build Template for Team Build. There were a few fancy things which were required for this template, including picking files and folders in Source Control, selecting Work Items etc. I looked around the documentation on msdn.microsoft.com, but the information on the available editors is scarce and incomplete (or I didn't look good enough).

    I decided to fire up NDepend to find the types I was interested in and from there I used good old .NET Reflector to look for the return type of each of them. Using this I found a few gems. All nicely marked Internal and thus hidden from view. I'm guessing this means these Editors come without support and may change without warning, but if that doesn't deter you, then read on for the complete list

    Which Check-in policies do you use with your projects?

    2013-01-15


    Team Foundation Server allows an administrator to define a Check-in policy to ensure all code that is checked in conforms to a certain standard and that a minimal set of quality attributes have been applied to that code. Not all of these policies make sense in every situation and implementing them can be negatively perceived by the development team. It's often better to explain (over and over again, in person) the benefit of doing things right, them let a tool tel people what to do.

    Please comment on any great policies I might have missed or ways to be able to remove these policies in place completely!

    Red-Gate releases Reflector 8.0

    Red-Gate just released Reflector 8.0. Not with a lot of fanfare, as I only noticed because my Early Access Program Build wouldn't start and because there was no new EAP build available to download. They improved searching and filtering inside Reflector by introducing a filter bar in the tree view on the left.


    The original Search functionality is still available, but this one is a lot easier to use.

    They've also improved the debugging of 3rd party assemblies inside Visual Studio, it's a feature I rarely need, but when I need it, it's worth every penny (cent).


    If you have a license for version 7.0, you get this upgrade for free, even though the upgrade wizard will tell you it will download the 14-day trial version. That version will automatically activate with your version 7 license.



    FxCopContrib Alpha for Visual Studio 2012

    2013-01-13

    I've just ported, fixed, compiled and released a version of my FxCopContrib library that should work under Visual Studio 2012 and Team Build 2012.

    The following rules are included:
      And I've also included a 2012 port of the Microsoft Sharepoint Online Code Analysis Framework rules.

      To enable these rules, extract the .7z file to your Visual Studio 11.0\Team Tools\Static Analysis\FxCop\Rules directory. You can then create a new Code Analysis Ruleset for your Visual Studio solution to enable these rules.

      For those interested in writing their own rules, I've built a small Test Harness for Code Analysis rules based on the latest CTP of Roslyn. This makes it a lot easier to verify the rules actually work as expected. I'll write a separate blog on that later.

      Make you custom TFS tools clever by automatically figuring out the Project Collection

      2013-01-12

      As you might have noticed, most TFS Command Line tools will automatically figure out the TFS server to connect to by somehow figuring out the TFS Server from the current folder you have open. When you're anywhere in a mapped workspace, most tools will automatically connect to that TFS Server, Project Collection and Project.

      Here's how to do that yourself:

      using Microsoft.TeamFoundation.Client;
      using Microsoft.TeamFoundation.VersionControl.Client;
      
      var workspace = Workstation.Current.GetLocalWorkspaceInfo(Directory.GetCurrentDirectory());
      if (workspace != null)
      {
        teamProjectUri = workspace.ServerUri;
      
        var server = TfsConfigurationServerFactory.GetConfigurationServer(teamProjectUri);
        var projectCollection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(teamProjectUri)
        
        var cssService = projectCollection.GetService<ICommonStructureService4>();
        var project = cssService.GetProjectByName(ProjectName)
      }
      

      This way you'll be able to create command line tools that require fewer information to function. Which just makes them easier to use :).

      Set your TFS profile or team image from the commandline



      One of the cool new features of Team Web Access is that you can now set a Team and Personal mugshot. This is one more step towards making the software development experience more personal and people oriented.

      This new feature in 2012 requires each user to set their own image once per TFS instance they use and the image is automatically shares across all projects and project collections. There is, however, no simple way to bulk set the profile images for all users from the command line or through PowerShell.

      Well there wasn't, until today :).

      Team Foundation Server 2012 Update 1 Hotfix released

      If you've already upgraded your Team Foundation Server 2012 to Update 1, you might have encountered issues after attaching a project collection to your server. This is caused by a bug in Update 1 that removed all permissions from your Project Collection.

      Microsoft has just released a Hotfix for this issue. Read more about it on Brian Harry's blog.
       

      Search This Blog

      Loading...

      Most Reading

      Archives