Friday, January 9, 2015

MSBuild Extension Pack's new home

If you have been a long time user of the MSBuild Extension Pack, you may have noticed that they have moved from CodePlex to GitHub.

Fortunately, the project is still under active development and new releases can now be found here: https://github.com/mikefourie/MSBuildExtensionPack/releases

Identity and Access Tool for Visual Studio 2013

If you have been working with Windows Identity Foundation in the past, you may have known about the Identity and Access Tool that was available with Visual Studio 2012 (that was previously available through the Windows Identity Foundation SDK in Visual Studio 2010).  You could download the Identity and Access Tool from Visual Studio Gallery here: https://visualstudiogallery.msdn.microsoft.com/e21bf653-dfe1-4d81-b3d3-795cb104066e

However, if you check Visual Studio Gallery, you will notice that there is no update for the Identity and Access Tool for Visual Studio 2013 even though several features/functionality are missing in the Visual Studio 2013 release that were previously available through the Identity and Access Tool extension.

According to another article, Microsoft is aware of the deficiencies in Visual Studio 2013: http://bartwullems.blogspot.com/2013/11/visual-studio-2013-where-is-identity.html

Therefore, if you are continuing to develop with Identity-based solutions that require Claims authentication, for the time being, you are forced to use Visual Studio 2012.

In addition, you can vote for this UserVoice item so that hopefully Microsoft includes this functionality in a future release of the Visual Studio IDE:

Thursday, January 8, 2015

The name already exists dialog in Microsoft Excel

I was recently tasked with manually consolidating data from several Excel spreadsheets into a single Excel spreadsheet.

Of course, as you can guess, this meant manually COPYING over table data from other spreadsheets into a single new Excel spreadsheet.

However, as I started wading through more and more of the Excel spreadsheets, I started getting a strange Excel dialog stating something similar to the following:



The name 'XXXX', already exists. Click Yes to use that version of the name, or click No to rename the version of 'XXXX' you're moving or copying.

I could not figure out why this issue suddenly started occurring when it had not been occurring before.  Fortunately, a quick Google search indicated that I would have to Delete all of the existing named entries using Name Manager (Ctrl + F3)


NOTE: If you are copying from multiple Excel spreadsheets, you may have to repeat this operation over and over (like I did).  

In any case, once I did that, I could once again resume copying and pasting information from the other Excel spreadsheets without the annoying dialog boxes!!

Setting up a Microsoft.Net Autobuild machine

If you are in the process of setting up an Autobuild machine to execute your .NET Builds, here are some of the tools that I like to have on my autobuild machines to be able to easily build my .NET solutions:

  1. If you are not planning on using a separate autodeploy server (highly recommended), you will also want to ensure that you have IIS properly configured on your autobuild machine so that you can test your deployment strategy as part of your autobuild process.
  2. An edition of Visual Studio that can build and run all of your tests such as Premium or ideally Ultimate edition
  3. MSBuild Extension Pack to add additional functionality to the MSBuild engine
  4. Attrice MSBuild Sidekick to easily create and edit MSBuild files
  5. Jetbrains Resharper to provide Intellisense while editing existing MSBuild files
  6. A plain old text editor such as EditPlus or JGSoft EditPad Pro to view and load large log files as well as generalized text editing
  7. A CI Build server such as TFS Build or Jetbrains TeamCity.  My preferred build engine overall is still Jetbrains TeamCity since it offers numerous features still not available in TFS Build as well as being much easier to get set up and running with customized builds.
  8. Access to a SQL Server if you are doing any database testing or storing your build configuration information in SQL Server (such as with Jetbrains TeamCity).
  9. An installation or packaging tool such as Advanced Installer or InstallShield.  If you have access to InstallShield, you will only need to install the InstallShield Standalone Build executable to build your InstallShield packages.  If you have licensing for InstallShield, it might be worthwhile to also have the full version of InstallShield on the build server so you can design and troubleshoot any packaging problems you encounter.

Once you have all of the necessary software installed on your autobuild machine, your MSBuild file and your CI Server are going to be the glue that holds everything together.  If you are using a CI Server such as Jetbrains TeamCity, TeamCity will basically manage pulling all of the source code from your repository and then executing your MSBuild file to run your specific Targets.  TeamCity can automatically build Visual Studio solutions using a built-in build runner as well as execute Tests using the MSTest engine, but any other customized build processes will need to be included in your MSBuild file such as autodeployment, assembly versioning, packaging etc.

That is pretty much all there is to it!

Tuesday, January 6, 2015

Upgrading from Windows Server 2012 to Windows Server 2012 R2

Normally, I always perform clean installations of my environments in virtual machines and therefore have never attempted to perform an upgrade installation from one OS to another in the past.

However, I had set up an Active Directory Domain Controller with ADFS on Windows Server 2012 that took me quite a bit of time to set up and I was hoping to preserve my effort by simply performing an upgrade to Windows Server 2012 R2.

So, I began the installation from the Windows Server 2012 R2 media and while the installation was proceeding with the compatibility check, I received the following error message:






Of course, the link mentioned in the dialog refers to this article: http://technet.microsoft.com/en-us/library/1d502209-cdb9-4e13-9a6c-57ad6c9d1e8b

As you can tell, this is an outdated article that refers to Windows Server 2008 R2 instead of Windows Server 2012 R2.

I could not proceed with the upgrade without completing this step, so instead of attempting to figure out how to resolve this issue with outdated documentation, I just went ahead and re-installed my OS with Windows Server 2012 R2 instead.

If someone knows how to get around this issue, I would love to hear your solution!!

Sunday, January 4, 2015

Getting started Unit Testing with Moq

If you are just starting to learn about Unit Testing using Mocking Frameworks such as Moq, unfortunately, the documentation out there for Moq is pretty sparse.  It consists of some basic code samples with very little explanation of what they mean or how to properly use them in different situations.

You can check out the Moq Quickstart over here: https://github.com/Moq/moq4/wiki/Quickstart

Fortunately, there is a fairly good blog post on how to use Moq here:

http://www.deanhume.com/Home/BlogPost/basic-introduction-to-writing-unit-tests-with-moq/16

http://deanhume.com/home/blogpost/basic-introduction-to-writing-unit-tests-with-moq---part-2/23

Of course, you can also check out PluralSight's courses on Moq as well (requires a subscription): http://www.pluralsight.com/courses/mocking-with-moq

Thursday, January 1, 2015

Unit Testing ASP.NET Web API

If you are looking for guidance on how to Unit Test ASP.NET Web API Controllers, you can find some excellent guidance here:
http://www.asp.net/web-api/overview/testing-and-debugging/unit-testing-with-aspnet-web-api

This example also includes using Moq as your Mocking framework to mock out functionality in your Web API Controllers:
http://www.asp.net/web-api/overview/testing-and-debugging/unit-testing-controllers-in-web-api

This is also another good article on Unit Testing Web API Controllers: http://blogs.msmvps.com/theproblemsolver/2013/11/13/unit-testing-a-asp-net-webapi-2-controller/