Deploying a database via dacpac from a VSO build by creating a custom build/release task

While using the new scriptable build system in VSO, there have been countless times I wanted to create my own custom build/release task.  That day has finally arrived.  The ability to upload custom build and release tasks to VSO has now been made public by Microsoft.  It is still in the “pre-release” stage so you … [Read more…]

I’m using Release Management with PowerShell scripts to deploy my app and it’s corrupting my configuration files

So I’m using RM with powershell scripts to deploy a simple web app.  One of my scripts was modifying the Web.config file with Out-File.  Everything seemed to be working just fine except after the deployment, I got a 500 server error. The Web.config file looked perfectly fine, but after some excruciating analysis, I finally figured out … [Read more…]

Using Microsoft Fakes, how do you fake a method with generics? (Mocking UpdateModel() )

Using MSTest and Fakes as my mocking framework,  I was writing unit tests against an MVC controller and I needed to mock Controller.UpdateModel<TModel>(TModel).  How do you do that?  How do you fake out methods with generics?  In my example, in my controller action,  I’m pulling a Series object from my repository and I want UpdateModel() … [Read more…]

DSC–Importing module failed

I was trying to run a simple DSC where I create an app pool so I downloaded the xWebAdministration module, dumped it into C:\Program Files\WindowsPowerShell\Modules directory, set up my configuration, ran it and got this error: Importing module MSFT_xWebAppPool failed with error – File C:\Program Files\WindowsPowerShell\Modules\xWebAdministration\DscResources\MSFT_xWebAppPool\MSFT_xWebAppPool.psm1 cannot be loaded because you opted not to run … [Read more…]

TFS 2015 RC Build v.next walkthrough– Creating a simple build for a web app

After downloading TFS 2015 RC, I wanted to create a simple build of my web app.  The goal was to have a v.next build do the same thing as my xaml build.  I wanted the build to get the latest code from source control, compile everything, run unit tests, then drop the build artifacts in … [Read more…]

Playing With TFS 2015 RC and Release Management with DSC

I have a standard demo that I created to demo the capabilities of Release Management using TFS 2013 update 4 and Release Management (using the workflow deployment).  It’s a solution which contains a web app and a database project.  TFS builds the solution (both web and database) and then RM picks up the bits from … [Read more…]

Can I test private methods with MSTest?

As a good little developer, I try to write unit tests for every line of code that I write.  But what about private methods?  Can I write unit tests against private methods?  If you are using MSTest, absolutely you can. Just use the PrivateObject class.  For instance, If you have this class:

You can … [Read more…]