Wednesday, December 25, 2013

Friday, November 22, 2013

Baseless Merge with TFS 2010

In VS 2012 we got UI for Baseless code merge But for VS2010 we need to use command line tool.

When you would like to use Source Control Merge Wizard in Visual Studio (e.g.; by right clicking a branch folder then going to 'Branching and Merging' -> 'Merge') and you find that the intended target is not in the 'Target branch' selection that means the source does not have any relationship with the target. You can proof this from 'Branching and Merging' -> 'View Hierarchy' option. This is when we need to do baseless merge operation.

 To perform this operation, we can use the merge command on TFS command line tool. The syntax is
Tf merge /baseless /recursive /version:[versionspec] [source path] [target path] 
- path can be physical folder or source control location.
- [versionspec] can be a changeset, range of (inclusive) changesets separated by '~' character, a label, a date or versions. If we don't specify /version then it will merge all changes.

Below are some examples:
- Merge all changes from branch to trunk
D:\My_Project>tf merge /baseless /recursive "$/My Project/branch/one" "$/My Project/trunk" 

- Merge all changesets up to changeset 1000
D:\My_Project>tf merge /baseless /recursive /version:1000 "$/My Project/branch/one" "$/My Project/trunk" 

- Merge only changeset 1000
D:\My_Project>tf merge /baseless /recursive /version:1000~1000 "$/My Project/branch/one" "$/My Project/trunk" 

- Merge changesets 1000 to 1010 inclusively
D:\My_Project>tf merge /baseless /recursive /version:1000~1010 "$/My Project/branch/one" "$/My Project/trunk" 


If it is happened that the merge causing a lot of checkouts of unmodified files then we can use TFS Power Tools to undo the checkouts.
D:\My Project\trunk>tfpt uu /r /noget *
'uu' - undo unchanged
'/r' - recursive
'/noget' - do the operation without getting latest


If this one is still not working and leaving a lot of unmodified files checked out, we have to do Undo Changes manually. This can be done through the Pending Changes view, right click on any file from the list then select 'Undo'. The Undo Pending Changes dialog will pop up. Check all the files then click 'Undo Changes' button. A confirmation dialog with the message "... has changed. Undo check-out and discard changes?' will be shown. Click 'No to All' button. Then all unmodified files will be reverted while the modified ones from the merge operation stay.

Tuesday, October 22, 2013

Tracing in Windows Communication Foundation

Tracing mechanism in Windows Communication Foundation is based on the classes that resides in System.Diagnostic namespace.Important classes are Trace, TraceSource and TraceListener.

Following are the steps to enable tracing in WCF:


1. Configuring WCF to emit tracing information/Define Trace Source, we have the following options:

  • System.ServiceModel 
  • System.ServiceModel.MessageLogging 
  • System.ServiceModel.IdentityModel
  • System.ServiceModel.Activation 
  • System.Runtime.Serialization 
  • System.IO.Log
  • Cardspace
      In configuration file, we will define a source to enable this configuration as follows:

     

2. Setting Tracing Level, we have the following available options, we need to set this tracing level to available options other than default "Off":

  • Off
  • Critical
  • Error
  • Warning
  • Information
  • Verbose
  • ActivityTracing
  • All


      In configuration file, we can choose above values for switchValue attribute as follows:

                                     switchValue=”Information”>

3. Configuring a trace listener

    For configuring a trace listener, we will add following to config file.
    
                                  type="System.Diagnostics.XmlWriterTraceListener"
                 initializeData="d:\logs\messages.svclog" />
      


4. Enabling message logging


     
        
                                logEntireMessage="true"
                    logMalformedMessages="false"
                    logMessagesAtServiceLevel="true"
                    logMessagesAtTransportLevel="false"
                    maxMessagesToLog="3000"
                    maxSizeOfMessageToLog="2000"/>
        

    


logEntireMessage: By default, only the message header is logged but if we set it to true, entire message including message header as well as body will be logged.
logMalformedMessages: this option log messages those are rejected by WCF stack at any stage are known as malformed messages.
logMessagesAtServiceLevel: messages those are about to enter or leave user code.
logMessagesAtTransportLevel: messages those are about to encode or decode.
maxMessagesToLog: maximum quota for messages. Default value is 10000.
maxSizeOfMessageToLog: message size in bytes.


Putting all this together, configuration file will appear like this.

--------------------------------------------------------------------------- 


   

   

     

       

         
               type="System.Diagnostics.XmlWriterTraceListener" initializeData="d:\logs\myMessages.svclog">

       

     

   

 

           

     

       
                        logMessagesAtServiceLevel="false"

                        logMessagesAtTransportLevel="false"

                        logMalformedMessages="true"

                        maxMessagesToLog="5000"

                        maxSizeOfMessageToLog="2000">         

       

     

   

---------------------------------------------------------------------------



Note: In this case, information will be buffered and not published to file automatically, So, we can set the autoflush property of the trace under sources as follows:


Tuesday, June 4, 2013

modes of channel operation - Simplex, Half-Duplex and Full Duplex

Simplex
Data in a simplex channel is always one way. Simplex channels are not often used because it is not possible to send back error or control signals to the transmit end.

Simplex channel It's like a one way street. An example of simplex is Television, or Radio. The simplex channel also corresponds directly to Shannon's model of communication discussed earlier.



Half Duplex
A half-duplex channel can send and receive, but not at the same time. It's like a one-lane bridge where two way traffic must give way in order to cross. Only one end transmits at a time, the other end receives. In addition, it is possible to perform error detection and request the sender to retransmit information that arrived corrupted. In some aspects, you can think of Internet surfing as being half-duplex, as a user issues a request for a web document, then that document is downloaded and displayed before the user issues another request.

Half-duplex channel Another example of half-duplex is talk-back radio, and CB Radio (Citizens Band). You might have seen movies where truckies (drivers of very big trucks) communicate to each other, and when they want the other person to speak they say "over". This is because only one person can talk at a time.



Full Duplex
Data can travel in both directions simultaneously. There is no need to switch from transmit to receive mode like in half duplex. Its like a two lane bridge on a two-lane highway. Have you ever watched these television talk shows where the host has a number of people on the show, and they all try to talk at once. Well, that's full duplex!

Full-duplex channel

Wednesday, April 24, 2013

Format code shortcut for VS2010

Visual Studio WITH C# KEY BINDINGS
To answer the specific question, in C# you are likely to be using the C# keyboard mapping scheme, which will use these hotkeys by default:

Ctrl+E, Ctrl+D to format the entire document.
Ctrl+E, Ctrl+F to format the selection.

You can change these in Tools > Options > Environment -> Keyboard (either by selecting a different "keyboard mapping scheme", or binding individual keys to the commands "Edit.FormatDocument" and "Edit.FormatSelection").
If you have not chosen to use the C# keyboard mapping scheme, then you may find the key shortcuts are different. For example, if you are not using the C# bindings, the keys are likely to be:

Ctrl + K + D (Entire document)
Ctrl + K + F (Selection only)

To find out which key bindings apply in YOUR copy of Visual Studio, look in the Edit > Advanced menu - the keys are displayed to the right of the menu items, so it's easy to discover what they are on your system.

ASP.NET MVC Self-Training in 15 Days

Day 1

Complete Tutorial Set 1: Getting Started
http://www.asp.net/mvc/tutorials/getting-started-with-mvc-part1
Read Material Set A: Overview / Execution Process
http://www.asp.net/mvc/tutorials/asp-net-mvc-overview-vb
http://www.asp.net/mvc/tutorials/understanding-the-asp-net-mvc-execution-process-vb

Day 2, 3, 4

Complete Tutorial Set 2: MVC Music Store (Use Converter to VB)
http://www.asp.net/mvc/tutorials/mvc-music-store-part-1

Day 5:

Read Material Set B: Models and Controllers / MVC Routing
http://www.asp.net/mvc/tutorials/understanding-models-views-and-controllers-vb
Complete Tutorial Set 3: Routing / Custom Routing
http://www.asp.net/mvc/tutorials/asp-net-mvc-routing-overview-vb
http://www.asp.net/mvc/tutorials/creating-custom-routes-vb
http://www.asp.net/mvc/tutorials/creating-a-custom-route-constraint-vb
http://www.asp.net/mvc/tutorials/creating-a-route-constraint-vb
Complete Tutorial Set 4: MVC 3 with Razor View Engine
http://www.asp.net/mvc/tutorials/creating-a-mvc-3-application-with-razor-and-unobtrusive-javascript

Day 6:

Complete Tutorial Set 5: Creating Custom HTML Helpers
http://www.asp.net/mvc/tutorials/creating-custom-html-helpers-vb
Complete Tutorial Set 6: Using Tagbuilder for HTML Helpers
http://www.asp.net/mvc/tutorials/using-the-tagbuilder-class-to-build-html-helpers-vb

Day 7:

Complete Tutorial Set 7: Validation Methods. Simple / iDataError / Service / Data Annotation
http://www.asp.net/mvc/tutorials/performing-simple-validation-vb
http://www.asp.net/mvc/tutorials/validating-with-the-idataerrorinfo-interface-vb
http://www.asp.net/mvc/tutorials/validating-with-a-service-layer-vb

Day 8:

Read Material Set C: Passing Data to View Master Pages
http://www.asp.net/mvc/tutorials/passing-data-to-view-master-pages-vb
Complete Tutorial Set 8: Caching Output / Dynamic Content
http://www.asp.net/mvc/tutorials/improving-performance-with-output-caching-vb
http://www.asp.net/mvc/tutorials/adding-dynamic-content-to-a-cached-page-vb
Read Material Set D: JavaScript Injection Attacks
http://www.asp.net/mvc/tutorials/preventing-javascript-injection-attacks-vb
Complete Tutorial Set 9: Unit Testing
http://www.asp.net/mvc/tutorials/creating-unit-tests-for-asp-net-mvc-applications-vb

Day 9, 10, 11, 12

Complete Tutorial Set 10: Content Management
http://www.asp.net/mvc/tutorials/iteration-1-create-the-application-vb

Day 12, 13, 14, 15

Optional Complete Tutorial Set 11: Nerd Dinner Tutorial
http://www.asp.net/mvc/tutorials/introducing-the-nerddinner-tutorial

Wednesday, January 16, 2013

Microsoft® Certified Professional Developer (MCPD) Web Developer 4


 

  I am glad to share my certification information  “Microsoft® Certified Professional Developer (MCPD) Web Developer 4 by providing you with Transcript ID and Access Code.

 I have completed MCPD Web Developer 4 Certification in this month.

 You can see complete list of Microsoft Certification till now I have completed on below site using Transcript ID and Access Code.


 Transcript ID : 807271
Access Code : abcde12345

Popular Posts

Recent Posts

Unordered List

Text Widget

Blog Archive