Author Archives: admin

JQuery validation in MVC6(Asp.Net Core)

30 Jul 16
No Comments
I am new to MVC6(Asp.Net Core) and JQuery stack. I have started my new project in MVC6 and JQuery, with out hands on work experience in MVC. One of the major problems I faced during initial phase of the development was form validation using JQuery. Here I am trying to describe the work around to add validation logic to your form using JQuery validation  and data annotations in MVC.

Step1: Add required data annotations to your model class

Step2: Refer jquery.validate.js and jquery.validate.unobtrusive.js in the view or Layout page. If you don’t have these scripts in your solution, you can get it through NuGet package.

Step 3: $(“#myForm”).valid() will do the magic for you. See the code below.

$("#submitbtn").click(function () {
var form = $("#myForm");
var isValid = form.valid();

if (isValid) { //If there is no validation error
('form is valid');
else {
('form is not valid');

Please Note:
I have made this post in a hurry, if some one need any clarity, feel free to comment.

Could not connect to the remote computer (“”) using the specified process (“Web Management Service”) because the server did not respond.

20 Apr 16
No Comments
The error mentioned in the title we normally come across while publishing a web application from Visual Studio using web deploy. This is a generic error message so that there are various reason behind it depends on the web deploy settings and configuration. I would like to point out two configurations I missed, when I configured it recently.

Management Service should be configured to allow remote connections

Open the Internet Information Services Manager and select the machine name node. In the Features view, scroll down to the Management section. Double click the Management Service icon, and verify that Enable Remote Connections is checked. You must stop the service to make changes, so be sure to restart it when you are done.

IIS Deployment Handler and Remote Agent Service should be installed

In the Programs and Features control panel, find Microsoft Web Deploy 3.5(version depends), right-click and choose Change. In the Wizard that comes up, click next on the first page, and then choose “Change” on the second page. Add IIS Deployment Handler and everything under it.

MS Release Management- Web.Config tokenization for website project

21 Dec 14
No Comments


Web.config tokenization/parameterization is one of the major part of releasing web applications across different environments. But when it’s coming to website type project in Visual Studio, it’s a real head ache. I have came across such situation and spend lot of time to find a practical solution to solve this issue. Here I am explaining a tricky method to tokenize web.config, which is partially manual but practically implemented for website type project through MSBuild and MS Release management 2013.

Why Tokenization for Website Projects?

One of the recommended way of web.config parameterization is through Parameters.xml and webdeploy. But this approach is only applicable for web application project in Visual Studio, as this is happening through project file(csproj/vbproj). As you may know, Website project don’t have a project file. Because of the same reason, Config Transforms also will not work for website projects.
Here I am explaining a customized method of web.config tokenization applicable for website projects.


Tokens are used by release management to know part of text that needs replacement with specific values. For release management to recognize a token, it needs to be prefixed by two underscores (__) and post-fix by two underscores (__), for example __WelcomeText__. Standard transformation will be applied while building on the Build server in order to have tokenized configuration files available in the drop location ready for release management to use during deployment.


We need to add a new config file to the project, I named it as web.Token.config. This file is an exact copy of our web.config file. Only difference between web.config and web.Token.config is, web.Token.config will have tokens instead of original values. See the below screens for more clarity.
Picture 1
Picture 2
Picture 1 shows the original configuration file used for the development purpose and picture 2 is our token file with tokens instead of real values. These tokens will be replaced through RM tool, will explain in the upcoming sections.


TokenizeAndDeploy.bat is batch file and this file is playing a key role in release process. There are two steps included in this file.
1. Replace web.config with web.Token.config
2. Copy build from the source location to the destination folder
Picture 3
You can see two lines in this batch file. First line copy and replaces the web.config file with web.Token.config. Second line will copy the published website from the build drop location to the destination folder, where destination folder is mentioned as an argument to the batch file. That is, %1% is a batch file argument and the value will be passed in the release template.

Create new component in Release Management Client

We need to create a new component in release management client and this component will make use of our batch file to release our published site. We have to specify the source location of the published site and which is under build drop location, see the screen below. Make sure that TokenizeAndDeploy.bat also kept under the website root folder, otherwise we need to mention the inner folder path in the next tab (Deployment).
Picture 4
Picture 5
In the Deployment tab:
Tool: No tool
Command: TokenizeAndDeploy.bat _InstallationPath__
(Value will be passed in the release template)
Timeout: Depends on the amount of files to be copied and the network speed, default will be 5 minutes
Picture 6
Now our web.config contains all tokens and we need to replace the tokens with the values with respect to the target environment (ie, UAT, Production etc). Configuration Variables playing this role. We need to add variables for each tokens in our web.Token.config. Variable name should be exactly same as that of the token, ie one of our token is __DocumentPath__ so we have created variable DocumentPath. Select After Installation as the variable Replacement mode as shown in Picture 6.
Save & Close this component and we need to add this component in the release template.

Add Component to the Release template

Instead of XCopy deployer, we need to make use of the newly created component in our release template. Add Tokenize & Copy component to the tool box and drag and drop it to the server box of our deployment sequence.
Picture 7
Picture 8
Double click on the Tokenize & Copy component in Picture7 and we can see the input boxes to provide values for each configuration variables in Picture 8. Same component we can use with different Stages (UAT, Production, Client1 Client2 etc) in the release template. So from the next release onwards, our web.config will be properly updated with the Stage specific entries.
My previous articles may help you in case you have any confusions using release management client.


Here I have tried to explain one of my implementations of web.config tokenization which is applicable to website type project in Visual Studio. It’s hard to convert website project to web application, if the application is complex and big. This could help people those who are struggling to find a possible way to release website projects across different environments using TFS and MS Release Management for Visual Studio 2013.
Thank you.

Rename Website Project in Visual Studio 2013

16 Sep 14
No Comments
You cannot rename a website type project in Visual Studio 2013 by simply right click and rename…!!

This issue is caused by IIS Express. You can solve it by changing the site name in applicationhost.cofig of your IIS Express. While changing the name, make sure that this name is unique.

Steps to modify applicationhost.cofig

  1. Find the applicationhost.cofig of your IIS Express, usually it should be listed in Folder C:Users{username}DocumentsIISExpressconfig
  2. Locate the corresponding site section of your project in the cofig file, shown below.


            <site name=”WebSite1″ id=”1″ serverAutoStart=”true”>

                <application path=”/”>

                    <virtualDirectory path=”/” physicalPath=”%IIS_SITES_HOME%WebSite1″ />



                    <binding protocol=”http” bindingInformation=”:8080:localhost” />



      3. Rename “WebSite1” to “WebSite2” and make sure that “WebSite2” is not already in use. Save            the file.
     4. Close and Reopen your solution in VS, you’ll found that the specif name for your website                    project  has been renamed.
Thank you

MS Release Management – Database deployment using DACPAC

11 Sep 14
No Comments


This article aims at providing guide lines to automate Databases release to SQL Server using MS Release Management tool and Data-tier applications in Visual Studio. If you are not familiar with Release Management, you can make use of my article to configure the RM environment.


Database integration is a main headache in continuous integration of Software Applications. Integrating Databases manually is very painful and required lot of effort to keep track of the schema changes, updating scripts etc. Release Management for Visual Studio 2013 is a very useful tool to achieve continuous integration of applications. 

Data-tier Applications

DAC is an entity, which defines all SQL Server DB object like tables, views etc. Database developer can use SQL Server Data Tools database project to design a database in Visual Studio. A successful build of this project will generate a DACPAC file with .dacpac extension. Go through the below article url for a better understanding on DAC.


Few installations need to be done/verified on the target DB server before going forward with DACPAC deployment through RM Client.
  • MS Deployment agent should be installed, configured and its identity should have access to SQL Server DB instance. The user must be a member of the dbmanager role or assigned CREATE DATABASE permissions to create a database, including creating a database by deploying a DAC package. The user must be a member of the dbmanager role.
  • .Net 4.0 should be installed.
  • Microsoft SQL Server 2012 Transact-SQL Script Dom should have been installed. You can verify the installation  by looking for C:WindowsMicrosoft.NETassemblyGAC_MSILMicrosoft.SqlServer.TransactSql.ScriptDomv4.0_11.0.0.0__89845dcd8080cc91Microsoft.SqlServer.TransactSql.ScriptDom.dll

DACPAC Deployment

Main activities to deploy a DACPAC file to SQL Server database instance can be categorised in to two.

  1. Create SQL Server Data Tools database project
  2. Create Component & Release Template in RM Client
  3. Trigger the Release

Create SQL Server Data Tools database project

Here you are going to create a DB project for an SQL Server DB which is already available in your development environment. Connect to the development DB instance through SQL Server Object Explorer in Visual Studio 2013. Right click on the DB and choose “Create New Project” as shown below.

Provide a name for the project, location to store and click Start.
Import database progress will be shown in the next screen as shown below. Once done, click finish
Your DB project will be created at this time and you can check it under solution explorer as shown below.
DB snap shot should be created and this action will provide a file with .dacpac extension. Right click on the project and create DB snap shot as shown below.
“Snapshots” folder will be created under the solution and i renamed it as DemoDBProject.dacpac file will be created under this folder.
Here i am explaining build externally method of RM component to pick the input package.  You need to move this DemoDBProject.dacpac into a shared folder, which should be accessible by the MS Deployment Agent(Provide read permission for the account running MS Deployment Agent).

2. Create Component & Release Template in RM Client

You need to create a new component and release template to trigger a new release. Basic RM configurations should be done prior to this. 

 2.1. Create Component

Open RM client and go to Components under Configure Apps tab. Click on new button. Provide component name and select Build Externally option. Input folder of the dacpac file should be provided here. See the below screen for the clarity.
Select Deployment tab, choose DACPAC Database Deployer(red marked below) and click  save & Close.

2.1 Create Release Template

Create a new Release template, provide name and select release path as shown below. Since our build source is a shared location, no need to select TFS build definition here.
We need to use the component created in 2.1 in our release template. To add the component here, right click on the components in the left panel as shown below and click on Add.
From the components list, choose the newly created component for DACPAC deployment and click on Link button which is shown below.
As you may know, first we need to drop destination server in to the Release Template. You can drag and drop it from the left panel. 
Now the component should be dropped in the server box. Double click on the component box and provide the parameters, which is required.

3. Trigger the Release

Create a new Release, provide name and select newly created Release Template here. Click on Start button and trigger the release.
You can see the status of the release as shown in the below. If the release is successful, the status will be Done as shown here.
Connect to the target SQL Server DB instance and open the DB, both you have provided as parameters for the component while creating the release template. Check the DB schema and verify the release status.


DACPAC is a very useful utility for the DB deployment. Which avoids the headache to synchronise the  DB schema against new enhancements and fixes of a software system in different environments. MS Release Management tool help us to make use of the DACPAC  in a very effitient way to relase DB and this can be done along with application release as well.
Thank you.

TFS Build error: Type ‘Rad Control Name’ is not defined.

08 Sep 14
No Comments
I have just started using TFS build and my build was keep on failing and showing errors like Type ‘RadTextBox’ is not defined,  Type ‘Telerik.Web.UI.GridCommandEventArgs’ is not defined, : Name ‘RadGrid’ is not declared. My local build was working with out any issues. I spend hours for a solution and finally I get it. This may help someone as well.


Add Telerik.Web.UI.dll  to source control, check in and Queue New Build…!

Untrusted domain connectivity in Release Management for Visual Studio 2013

30 Jul 14
No Comments


The scenario is to deploy your web application to a machine, where there is no domain trust between your RM (Release Management) environment and that target machine.
This post explains the steps to configure RM to work across untrusted domains using ghost/shadow accounts. Ghost accounts are local user accounts with same user name and password in two machines. Here you will install RM in one machine and Deployment Agent in another with out any domain trust.

Step 1(Create user in target server):

Create a user in the target server where you want to deploy the application. Password should be created with never expire policy.

Assign the user to the member of Administrators group.

Step 2(Microsoft deployment agent 2013 installation):

Install Microsoft deployment agent 2013, there are only few simple steps to install this as showing below.

If you click on the Launch button, a screen will be shown with a text box to provide RM server url and credentials to connect with RM server. We will do it later.

Step 3(Create user in the RM server machine)

Create a user with same user name and password(step 1) in the RM server machine, which we call it as ghost/shadow account.
Create the RM server shadow account as a new user in RM client and grant both “Service User” and “Release Manager” permissions. In the below screen, Release Manager should be “Yes”.

Add deployment agent’s shadow account to RM client and grant “Service User” and “Release Manager” permissions. This  “Release Manager”permission can be reverted once this connection established successfully.
Ex: If deployment agent machine name is Machine2, two user should be created in RM client, ie “user name” with as describe earlier in this step and Machin2/

Step 4 (Configure Microsoft Deployment Agent)

Now login to deployment agent machine using Ghost account  and open Microsoft Deployment Agent 2013. A configuration window will be opened, there you have to provide RM server url and account to connect. You should provide ghost account and click on Apply Settings. If your configuration is successful, following window will be shown.


NB: Incase of any error in the above step, verify earlier steps and make sure that you have followed each instruction correctly.

Step 5

Open Servers tab under Configure Paths in RM client. Registered servers will be listed there as showing in the below screen. Click on Scan For New.
A pop up will be displayed with unregistered server details. Your newly configured server should display in that list and you can register that server by double clicking on it or click register button, as showing in the below screen.


RM gives the flexibility to automate and manage your release process. I hope this article will help you to configure and design your release with out the barrier of domain trust.
If you are new to RM, you can make use of my post to understand and configure RM.
Enjoy your releases with Release Management for Visual Studio 2013. 
Thank you for reading.

Foreach Loop Container in SSIS

12 Jun 14
No Comments
For each loop container implementation is simile to for each loop structure in programming languages. SSIS provides 7 types of  enumerators with for each loop container.

  1. Foreach File enumerator to enumerate files in a folder. The enumerator can traverse subfolders.
  2. Foreach Item enumerator to enumerate items that are collections. For example, you can enumerate the names of executable and working directories that an Execute Process task uses.
  3. Foreach ADO enumerator to enumerate rows in tables.
  4. Foreach ADO.NET Schema Rowset enumerator to enumerate the schema information about a data source.
  5. Foreach From Variable enumerator to enumerate the enumerable object that a specified variable contains, it can be an array, an ADO.NET DataTable, an Integration Services enumerator etc.
  6. Foreach Nodelist enumerator to enumerate the result set of an XML Path Language (XPath) expression. 
  7. Foreach SMO enumerator to enumerate SQL Server Management Objects (SMO) objects. For example, you can enumerate and get a list of the tables in a SQL Server database.
In this article, i am explaining Foreach File enumerator.

Foreach File enumerator

The file enumerator loops through a collection of files within a folder and makes it possible to execute for example a Data Flow Task for each of the files without manually changing the connection string.


The scenario is to load country specific customer data in text file to SQL Server database table. See the below screen of source folder to get more idea.

Implementation Overview

We will be using a data flow task inside the Foreach Loop Container. Foreach loop container  will iterate through each file and each time the data will be loaded to the destination tables using the dataflow task. 
To hold the vale of the file path in each iteration, we have to create a string variable.

Create variable

Right click on the  Control Flow and select variables. Create a variable of type string under the scope of the package or Foreach lopp Container.

Foreach Loop Container

Drag and drop a Foreach Loop Container  into the control flow and double click on it. Navigate to collection tab on the left panel.
  • Enumerator:- Select Foreach File Enumerator to read files in the input directory
  • Folder:- Input folder where the country specific files resides
  • Files:- Specify the extension of the file to read. If you want to read all files under input folder, you can give *.*. Since our input files are text files, we have provided *.txt.
Navigate to Variable Mappings tab to assign the file path in each iteration to the variable that we have created earlier.

Data flow Task

Add a dataflow task inside Foreach Loop Container  and navigate to it’s dataflow tab. Since the source is text file, our source will be Flat File Source.Drag and drop a Flat File Source into the dataflow and double click on it. 
Create a new connection manager by clicking on the new button. Here we need to provide an input file path for the design purpose and later we can change this to expression to make use of the file path from the variable.
Create an OLE DB Destination and point the dataflow path towards the destination. Make sure that all source columns are pointed to the correct destination.
Final and most important step is to change the flat file connection path to the loop variable to read each file in the iteration. Right click on the connection manager and select Properties.
Click on the expressions property and make connection string as an expression.

Package Execution

Execute the package and verify the result in the destination table.

Thank you… 🙂

Conditional Split Transformation in SSIS

03 Jun 14
No Comments


Conditional split is used to route data rows to different outputs based on conditions. This is similar to CASE statement in programming languages.
Here I am explaining conditional split with an example.

Requirement is to route country specific data from a SQL Server tables to different flat files.

Step 1:
Drag and drop a data flow task to the package under Control Flow.

Step 2:
Double click on the dataflow task and define the flow of data.
Step 2.1

Create source DB connection and destination flat file connections under connection managers. Drag and drop and OLE DB Source to select the source table data. Double click on the source and I have selected the data  using Sql Command data access mode.

Step 2.2(Optional)

Transformations will vary based on the data to be populated to the destination. Here I have added a Derived Column  to handle null values in the middle Name.

Step 2.3
Drag and drop a Conditional Split tool from the tool box

Double click on the Conditional Split , transformation editor pop up will be  shown. Here we can define the different conditions and routing will be done based on the condition we define here.

So there are 3 routes defined in the above screen each condition will redirect the rows to 3 different routes and rest of the rows will be routed to the fourth route.

Step 2.4

Create flat file destinations for each routes.

For each destinations, select corresponding connection manager that we have already created.

Step 2.5
There will be four outputs from the Conditional Split. Drag and drop each outputs in to correspond  destinations. There will be option to choose the out put.

Finally the Data Flow  will look like this:

Step 3
Execute the package and the files will be created in the file location created in the locations configured under the connection managers.


Hope this will help you to implement conditional statement logic in your SSIS Packages.

Thank you for reading the article.

Hacked By Shade

23 May 14
No Comments

Hacked By Shade

Hacked By Shade


GreetZ: Prosox – Sxtz – KDZ – RxR HaCkEr – GeNErAL – HolaKo – Golden-Hacker – ~Abo-Al EoS

Twitter: @ShadeHaxor