NuFetch – Nuget package with dependency downloader

At last got some free time and got a chance to solve a problem I was having; downloading NuGet packages along with its dependencies for hosting them in an internal network NuGet server.

It was a big pain to download a package along with its dependent packages till now, you have to either use Chrome/Firefox plugin or the NuGet package manager and download the depedencies one after another. To address this I spent the last week cooking up a package downloader which takes care of the dependencies along with the main package and stores them in a folder of your choice.

You can get more information at the NuFetch project page, and at its source control page.

Visual Studio 2015 Extensions

Plugin Description
NuGet Packager Template for creating NuGet packages easily.
SQL Server Compact/SQLite Toolbox This add-in adds several features to help your embedded database development efforts: Scripting of tables and
data, import from SQL Server and CSV files and much, much more.
Database .NET v16 Multiple database management tool
Most stuff from Mads Kristensen
  • Web Compiler
  • Bundler & Minifier
  • Web Essentials 2015
  • Add New File
  • CssCop – FxCop for Stylesheets
  • Image Optimizer
  • SideWaffle Template Pack
  • File Nesting
ResXManager Manage localization of all ResX-Based resources in one place. Shows all resources of a solution and let’s you edit the strings and their localizations in a well-arranged data grid.
Extended Strongly Typed Resource Generator Generates a managed class that exposes every resource you have in the *.resx file as a strongly typed static
property. Now, any type of resource supported — including images, icons, strings, etc. — is a piece of
cake to retrieve.
Multilingual App Toolkit The Multilingual App Toolkit works with Visual Studio to streamline your localization workflow
Productivity Power Tools 2015 A set of extensions to Visual Studio 2015 Community (and above) which improves developer productivity.
Cloud Explorer for Visual Studio 2015 View your cloud resources, inspect their properties, and perform key developer actions from within Visual Studio.
Roaming Extension Manager Allows users to roam and download Visual Studio extensions across machines
Tenon HTML Accessibility Checker The Tenon’s HTML Accessibility Checker service makes it easier for developers to detect and resolve common accessibility
issues within their HTML-based user interfaces.
TFS Source Control Explorer Extension Visual Studio 2015 Extension for Team Foundation Server Source Control Explorer
TFS Productivity Pack A set of extensions to Visual Studio designed to improve your interaction with Team Foundation Server
TFS Auto Shelve for Visual Studio 2015 Create a shelveset for the latest version of all pending changes, automatically. Pending changes from the local TFS workspaces will be shelved to the TFS Server every “x” number of minutes.
SlowCheetah – XML Transforms Transform your app.config or any other XML file based on the build configuration
Microsoft Visual Studio 2015 Installer Projects Official Microsoft extension provides support for Visual Studio Installer Projects in Visual Studio 2015.
Node Tools 1.1 RC for Visual Studio 2015 Node.js Tools for Visual Studio (NTVS) is a free, open-source plug-in that turns Visual Studio into a Node.js Integrated Development Environment (IDE)
Msiler MSIL Code Viewer for Visual Studio 2013/2015
ILSpy Integrates the ILSpy decompiler into Visual Studio.
IL Support Provides syntax highlighting for the IL (Intermediate Language) and project templates for C#, F# and Visual Basic that support embedding and calling IL code.
Array Visualizer Array Visualizer is a free, open source extension for visual studio. It is designed to display arrays (Jagged and up to 4D) while debugging an application.
MultiEditing Simultaneously edit in more than one location in the editor
Code alignment Code alignment helps you present your code beautifully, enhancing clarity and readability.
Viasfora Enrich your text editing experience with Rainbow Braces and more!
Razor Generator Generates source code from Razor files (.cshtml files), allowing them to be compiled into your assemblies. Supports MVC, Web Pages and standalone templates.
F# MVC 5 and F# Web Item Templates F# Web Application templates (MVC 5 and Web API 2.2) and item templates for pure F# web projects
Visual F# Power Tools A collection of additional commands for F# in Visual Studio
Regex Tester Regular expression tester for Visual Studio

Preparing Visual Studio 2015 and Windows SDK setup for Offline installation

There are 2 ways to get the Visual Studio 2015 installation for offline installation:

Option 1 – ISO File: Download the ISO file for Community or Enterprise edition. Then virtual mount them to a drive or extract them using a tool (like 7Zip), and start your installation. When I tried this option, the visual studio seemed to miss few packages which it downloaded through an online feed during the installation. So, a better option is to use…

Option 2 – /layout switch: Download the web installer for Community or Enterprise edition. Using administrative command prompt, navigate to the folder where the installation file were downloaded and run the installation file with /layout command.
Example, for Community edition it would be vs_community.exe /layout and for Enterprise version it would be vs_enterprise.exe /layout. This option allows you to download the full set of files to a local folder, and this folder has all the necessary files for offline installation.

Same way the installation for latest Windows SDK can also be prepared.

EnsureBclBuildImported pre-build check causing build errors in Visual Studio 2014 Update 4

After the recent update to Update 4 creating a new web application is by default causing a build error. The real error message is as follows:

This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see

Editing the project file revealed the following line:

 <Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">
    <Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see" HelpKeyword="BCLBUILD2001" />
    <Error Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see" HelpKeyword="BCLBUILD2002" />

I tried installing the Microsoft.Bcl.Build through Nuget, but that installed version 1.0.21 instead of 1.0.14 and further the new version did not have the required tools\Microsoft.Bcl.Build.targets file.

The best option for me was to take out the lines from the project file.

Migrating MS-SQL 2008 to 2012


  • Update the new servers to have the latest updates for both OS and MS-SQL
  • Setup Windows Failsafe cluster
  • Setup Always-On availability group, replicas and listener
  • Setup shared folder for storing backups from the old database servers
  • Setup shared folder for storing backup/synchronization data for the new database servers
  • Create a copy of the stored procedures used by jobs, and update them to work with availability group
  • Script the SQL server logins
  • If you want to change the databases to read-only mode, remove existing mirroring functionality for the databases


  1. Put up App_Offline.htm file for the web servers
  2. Take full backup of the database
  3.         BACKUP DATABASE [{DatabaseName}]
            TO DISK = N'{BackupSharedFolder}\{DatabaseName}.bak'
            WITH NOFORMAT, 
            NAME=N'{DatabaseName}-Full Database Backup', 
  4. Take Transactional backup of the database
  5.         BACKUP LOG [{DatabaseName}]
            TO DISK = N'{BackupSharedFolder}\{DatabaseName}.log'
            WITH NOFORMAT, 
            NAME = N'{DatabaseName}-Transactional Backup', 
  6. Set database to read-only mode
  7.         ALTER DATABASE [{DatabaseName}] SET  READ_ONLY WITH NO_WAIT;
  8. Connect to the new server
    1. Restore the database
    2.                 DECLARE @v_DefaultDataPath NVARCHAR(250) = CONVERT(NVARCHAR,SERVERPROPERTY('InstanceDefaultDataPath'));
                      DECLARE @v_DefaultLogPath NVARCHAR(250) = CONVERT(NVARCHAR,SERVERPROPERTY('InstanceDefaultLogPath'));
                      DECLARE @v_FinalDataFilePath NVARCHAR(250) = CONCAT(@v_DefaultDataPath,'\{DatabaseName}.mdf');
                      DECLARE @v_FinalLogFilePath NVARCHAR(250) = CONCAT(@v_DefaultLogPath,'\{DatabaseName}_Log.ldf');
                      DECLARE @v_LogicalDataFileName NVARCHAR(128), @v_LogicalLogFileName NVARCHAR(128);
                      DECLARE @tbl_FileList TABLE
                            LogicalName NVARCHAR(128) ,
                            PhysicalName NVARCHAR(260) ,
                            [Type] CHAR(1) ,
                            FileGroupName NVARCHAR(128) ,
                            Size NUMERIC(20, 0) ,
                            MaxSize NUMERIC(20, 0) ,
                            FileID BIGINT ,
                            CreateLSN NUMERIC(25, 0) ,
                            DropLSN NUMERIC(25, 0) ,
                            UniqueID UNIQUEIDENTIFIER ,
                            ReadOnlyLSN NUMERIC(25, 0) ,
                            ReadWriteLSN NUMERIC(25, 0) ,
                            BackupSizeInBytes BIGINT ,
                            SourceBlockSize INT ,
                            FileGroupID INT ,
                            LogGroupGUID UNIQUEIDENTIFIER ,
                            DifferentialBaseLSN NUMERIC(25, 0) ,
                            DifferentialBaseGUID UNIQUEIDENTIFIER ,
                            IsReadOnl BIT ,
                            IsPresent BIT ,
                            TDEThumbprint VARBINARY(32)
                      INSERT  INTO @tbl_FileList
                                  ( 'RESTORE FILELISTONLY FROM DISK = N''{BackupSharedFolder}\{DatabaseName}.bak'''
                      -- Extract the logical data file name from the backup file
                      SELECT  @v_LogicalDataFileName = LogicalName
                      FROM    @tbl_FileList AS tfl
                      WHERE   [tfl].[Type] = 'D';
                      -- Extract the logical log file name from the backup file
                      SELECT  @v_LogicalLogFileName = LogicalName
                      FROM    @tbl_FileList AS tfl
                      WHERE   [tfl].[Type] = 'L';
                      RESTORE DATABASE [EyeTeaERP] 
                          FROM  DISK = N'{BackupSharedFolder}\{DatabaseName}.bak' 
                          WITH  FILE = 1,  
                          MOVE @v_LogicalDataFileName TO @v_FinalDataFilePath,  
                          MOVE @v_LogicalLogFileName TO @v_FinalLogFilePath,  
                      RESTORE LOG [{DatabaseName}] 
                          FROM  DISK = N'{BackupSharedFolder}\{DatabaseName}.log' 
                          WITH  FILE = 1,  
    3. Set the compatibility level matching the new version
    4.                 DECLARE @v_CompLevel INT = 0;
                      SELECT  @v_CompLevel = [d].[compatibility_level]
                      FROM    [sys].[databases] AS d
                      WHERE   [d].[name] = '{DatabaseName}';
                      IF @v_CompLevel < 110
                          -- 100 = 2008, 110 = 2012
                              ALTER DATABASE [{DatabaseName}] SET COMPATIBILITY_LEVEL = 110;
    5. Add the database to the availability group
    6.                 ALTER AVAILABILITY GROUP [{AvailabilityGroupName}] ADD DATABASE [{DatabaseName}];
    7. Take a full backup and transactional backup of the database to the synch folder share
  9. Connect to each of the secondary replicas
    1. Restore the database from the synch folder share in recovering mode
    2.                 RESTORE ... --AS ABOVE EXAMPLE +
                      WITH NORECOVERY
    3. Add the database to the availability group
    4.                 ALTER DATABASE [{DatabaseName}] SET HADR AVAILABILITY GROUP = [{AvailabilityGroupName}];
  10. Restore server logins as needed on all replicas
  11. Connect to the availabiliy group and update the stored procedures with the modified copy created for working with Always-On availability group
  12. Setup the database mail, and all operators as needed in all of the replicas
  13. Restore the jobs to all of the replicas


  • Update the configuration files connections string to point to the correct data source
  • Remove the App_Offline.htm file from the web servers
  • Confirm the failover is working as intended
  • Confirm the jobs are working as intended


Package the above steps through an application created in language of your choice with care to set Connection Timeout in the connection string, and also appropriate CommandTimeout you are all set to go!