Using Git as source control provider


1. Get repository from remote repository. Right click on a directory location which wanted to make as working directory. Select Git Clone option from the context menu.

clip_image002

 

2. To get project from remote repository, provide the URL into the URL field.

 

clip_image004

 

3. Start downloading the remote repository.

clip_image006

 

4. Now open the project with visual studio. To work visual studio with git, another tool Git Source Control Provider is needed to install.

 

clip_image008

 

5. Follow the steps provided in the picture to download and install Git Source Control Provider.

clip_image010

clip_image012

 

6. After installation make Git Source Control Provider as default source control plug in.

clip_image014

 

7. Now the project is controllable from visual studio.

clip_image016

clip_image018

 

8. Right click on project, context menu shows TortoiseGit and Git Extension related commands to control project.

clip_image020

 

9. To add local changes into local repository, use any of the Commits either from GitExtensions\TortoiseGit.

clip_image022

 

10. To add local changes/local branches to Remote repository/Server, use Push command.

clip_image024

 

11. After applying Push command a dialog opens asking the remote branch name, to which the local changes would be applied.

clip_image026

 

12. To get latest from server (Merge local changes with server branch).

clip_image028

clip_image030

13. Checkout Branch à Can be also used to take latest version from both local/Remote repository.

clip_image032

clip_image034

 

14. Now suppose you worked on an issue, but want to commit and push it in a branch for future use.

 

clip_image036

clip_image038

clip_image040

 

15. After pushing you want to continue work on master.

clip_image042

clip_image044

 

16. Started working on master. Now decision taken to implement Issue-383. And move away the changes that you made on master. To move the changes use stash (stash is like a branch, it saves the changes in a separate place).

clip_image046

clip_image047

Git configuration/Installation on Windows


 

1. Install Git Extensions, It would provide options to install MsysGit(git for windows) and KDiff(merege tool).

clip_image002

 

2. During installation it would prompt GuI to install KDiff.Complete the installation.

 

clip_image004

 

3. Then it would also prompt to install msysGit. Complete the installation.

clip_image006

 

4. Now check GitExtension Settings.

clip_image008

 

clip_image010

 

5. If any of the settings in the above picture shown as red text with repair then fix these settings.

6. Now set the Global Settings and Local Settings.

clip_image012

 

7. Now install TortoiseGit.

 

clip_image014

 

8. Check TortoiseGit–à Settings.

clip_image016

 

9. Set Git credentials.

clip_image018

clip_image020

 

10. Installation is completed. Now it is time to use Git as a source control provider.

Setup Subversion and store projects to use by team


To setup SVN server follow the steps below :

1. Download VisualSVN from the link : http://www.visualsvn.com/server/ , choose the standard free version.

4.DownloadVisualSVN

2. Click to start download, Follow the steps

5.Download

6.InstallVisualSVN

7.Install_Step2

8.Install_Step3

9.Install_step_4

3. Change the port no as 80 port may be used by other services.

10.Staep_5_

4. Select ‘VisualSVN Server Manager’ from start menu.

11.Start-VisualSVN_Server_Manager

SVN Installation is completed!!!!!!!!!!!!!!!!!!!!!!!!!

<!––nextpage––>

To Create repository to the SVN server, Follow the steps below :

12.Create_new_repository

13.Provide_repository_name

14.SelectEmptyRepository

15.SelectCustomizePermmission

16.CustomToAssignUser

17.CreateUserToAssign

18.UserCreated

19.Select_user_to_Add

20.Complete_UserAssignment

21.Complete_RepCreationAndSecurity

22.RepoCreatedWithFollowingInformation

23.RepoCreatedShowingOnList

Repository creation is completed!!!!!!!!!!!!!!!!!!!!! URL is http://user-PC:70/svn/MyRepository/

<!––nextpage––>

Add project to the created repository

To add project to SVN follow the steps below :

1.  First install AnkhSvn-2.5.12116 (as visual studio SVN client)

2.  To add a solution to SVN, open it through visual studio.

3. Now make SVN as default source control.

1.Select_option

2.MakeSVNAsDefaultRepo

4.  Right click on the solution node, from the Solution Explorer.

3.SelectToAddSolnToSVN

4.URLandAuth

5.ChooseToAddProjectInTrunk

6.CompleteAddingProject

Solution Added to SVN repository!!!!!!!

Retrieve Project From SVN

1. Intall TortoiseSVN-1.8.1.24570-x64-svn-1.8.1

About TortoiseSVN

TortoiseSVN is an Apache Subversion (SVN)® client, implemented as a windows shell extension. It’s intuitive and easy to use, since it doesn’t require the Subversion command line client to run. Simply the coolest Interface to (Sub)Version Control!

Now Follow the steps below :

Right click on the directory where want to add the project.

1.RightClickONTheDirectoryTOGetProject

2.ProvideSVNUrl

3.BrowseProject

4.Authenticate

5.SelectProjectFolderTOGet

6.StartGettingTheFoder

7.DownloadComplete

 

Use NuGet as package manager visual studio


Following steps shows how to use NuGet with visual studio:

1.  Tools—>Extension Manager..

1.ExtensionManager

 

2.  Click open gallery and download NuGet Package Manager

2.Download_NuGetManager

 

3. Wait to complete the download process.

3.Downloading

 

4.

4.Installation_complete

 

5. Now from Tools—>Options—>Package Manager—–> General , Check Allow NuGet to download missing package. 

5.CheckForMissedPackages

 

6.  Click yes to allow NuGet to automatically download the missing package components during build.

6.ConfirmNuGetControl

 

7.  Now right click on the solution node, and click ‘Enable NuGet package Restore’

6.EnableNuGetPackageRestore

8.  Configures the solution to restore NuGet packages on build.

7.Configuring_the_application_to_restore_nuget_package

 

 

9.  Now to add jquery to your project, just open the Tools—>Extension Manager..—>Online Gallery—-> Search for jquery. From the result view click install on jQuery.

7.InstallJquery

 

10. Now click OK to confirm adding Jquery to the project.

8.AddJquery_to_the_Project

 

11.  Now to add log4net to your project, just open the Tools—>Extension Manager..—>Online Gallery—-> Search for log4net. From the result view click install on log4net.

9.InstallLog4net

 

12. After installation confirm adding to the solution.

10.Log4net_is_added

13. Package folder is added out side of the solution folder.

11.PackageFolder_added

 

 

14. Manage the installed projects through NuGet.

13.ManagePackages

 

15.  Click the installed packages tab, now its easy to manage.

14.Installed_package

Query profiler for MySQL


In the current age when developers are writing LINQ queries rather than Sql queries, a query profiler must plays vital role. When we write Sql queries we can easily tune the performance. But In case of writing LINQ queries its very important to make sure that it results a good sql query. It is easy to see the generated query in SQL server by using ‘microsoft sql server management studio’—> Tools—>’Sql server profiler’. But for MySql it seem hard to me to find a query profiler.

I looked around internet and found ‘Neor Profile SQL’  as a useful Query profiler for MySQL. Download it from

http://www.profilesql.com/download/ . Its very easy to install. Follow the Quick start from the link http://www.profilesql.com/use/. Enjoy life is very easy now to feel comfortable to write LINQ queries.

How to create and configure application pool by script


 

Application pool can be created and configured by command line scripts. Here is a sample showing how to create an Application pool and configure its  idle time out period :

Add_ConfigureAppPool_001

See the effect of the above commands in IIS.

 

Changed_value

Getting started with Log4net


This document provides how to use log4net. Its just an intro to getting started with log4net in a project for logging purpose. Follow the steps below :

1. Download log4net from the link http://logging.apache.org/log4net/download.html

2. Add reference of log4net.dll to the project  where to log, .

3.  In Web.config or App.config add following chunk of configuration :


<configSections> 
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/> 
</configSections>

<log4net> 
<appender name="rootRollingFile" type="log4net.Appender.RollingFileAppender,log4net"> 
<threshold value="ALL"/> 
<param name="File" value="E:\temp\Log.txt"/> 
<param name="AppendToFile" value="true"/> 
<param name="RollingStyle" value="Date"/> 
<param name="DatePattern" value=".yyyy.MM.dd.'log'"/> 
<param name="StaticLogFileName" value="false"/> 
<layout type="log4net.Layout.PatternLayout,log4net"> 
<param name="ConversionPattern" value="%date [%-5thread] %-5level %logger - %message%newline %exception"/> 
</layout> 
</appender> 
<root> 
<level value="ALL"/> 
<appender-ref ref="rootRollingFile"/> 
</root> 
</log4net>

remember to add the above configuration inside <configuration></configuration> tag. And change the File param value according to your choice.

4. At the start of your application call the following method :

 

log4net.Config.XmlConfigurator.Configure();

For web application the application starts from

protected void Application_Start(object sender, EventArgs e) {

log4net.Config.XmlConfigurator.Configure(); 
}
 

method in Global.asax.

For windows/console application application normally starts from the main method of program.cs, so place the code like :

[STAThread] 
static void Main() 
{ 
log4net.Config.XmlConfigurator.Configure(); 
Application.EnableVisualStyles(); 
Application.SetCompatibleTextRenderingDefault(false); 
Application.Run(new CheckNetStatus()); 
}

5. Its time to use log4net for logging.

6. Just use the following piece of code to log :

ILogger log = LoggerManager.GetLogger(this.GetType().Assembly, this.GetType());

log.Log(this.GetType(), Level.Info, "Error occured", null);

 

This is simply done!!!!!!!!!!!!