Posts

Showing posts from January, 2015

Baseless Merging of different branches of your srouce code

Image
The process of merging items that are not directly branched from each other is called a  baseless merge . For example: you might want to merge a change between two release branches (Iteration 1 and Iteration 2), which are siblings of each other, without merging up to the parent branch (Main). You can only perform a baseless merge by using the  Tf merge command. In Visual Studio 2010 and prior, you cannot perform a baseless merge from within the Visual Studio IDE. But in Visual Studio 2012, this feature (Baseless merge) is integrated with VS IDE merge wizard. We will see this merge wizard in the last. Just perform following 4 steps and merge your baseless branches. Step 1 – Evaluate Whether a Baseless Merge Is Needed Step 2 – Perform a Baseless Merge Using Tf.exe Step 3 – Resolve Merge Conflicts Step 4 – Check-In the Merged Changes Before performing the merging, get latest code of both branches. Now o pen a Visual Studio command window, and r un the following Tf.exe c

“Method1 hides inherited member Method2. Use the new keyword if hiding was intended” - Compiler Warning

Usually when we compile our C# code, sometimes we see a warning message in output window: Method1 hides inherited member Method2. Use the new keyword if hiding was intended. This warning means that Method1 is declared with the same name as a method in a base class. And the new is not used. This warning informs us that we should use new modifier. using System; namespace abc { public class MyBaseClass { public int i = 1; public DataTable ViewCriteria() { // } } public class MyDerivedClass : MyBaseClass { public void ViewCriteria () // Warning Line Code { // Some New Code For Derived Class } } } Here in above code, since we don't use a new keyword therefore we will face a warning during the code compilation. To remove the warning we need to add a new modifier as shown below. public new void ViewCriteria () // Warning Line Code { // Some New Code For Derived Cla