Search This Blog

Wednesday, 16 November 2011

What’s New in .Net 4.5? Part -1

Visual Studio Enhancements

Project Compatibility:-

This is the one feature that I liked a lot. If you have worked on a long running project which involved up gradation to a higher version then you have seen that once you open a project created in earlier version to a new version then it gets converted to new version via Visual studio conversion wizard. Problem with this approach was that a project once upgraded cannot be opened in earlier versions of visual studio. This created nuisance more so since sometimes it takes time to procure licenses for your entire time and we also wanted to save time by converting project at earliest to avoid any issues arising out of conversion. With VS 2011 developer preview Microsoft has done away with conversion wizard and improved compatibility.

Current Cursor line Code Highlighting:-

This is a cute little enhancement which actually saves a lot of time. While working on project many times you do a find which shows results in find window. On double clicking the result it takes you the line where it found the matches but many times I lost the cursor and then used down arrow key to track the movement and position of cursor. Now visual studio highlights line on cursor is placed currently. In below image you can easily find out where cursor is…

clip_image002

Solution Explorer Enhancements

Solution explorer now combines Class view so that you can get more details about the class as you are working..

clip_image005

Quick Launch Box

This is another cool addition to visual studio menu bar which makes it easier to execute commands. As you can see the toolbar is much light weight now with only the commands that you use most often. Rest of the commands can be found by clicking the small dropdown button as shown below. Also see the highlighted Quick Launch(Ctrl+) box

clip_image008

You can see in image below as I type Form in Quick Launch it gives me plethora of options to choose from.

clip_image010

Search feature has been included in many other places also like ToolBox , Error List and solution explorer window as shown below

ToolBox

clip_image013

Error List

As you can see in below image, error list window shows 3 error but on typing Messageb it filters out the error which contains Messageb..

clip_image015

Solution Explorer

clip_image017

In next part we will take a look at solution explorer and document management enhancements.

Tuesday, 15 November 2011

Seminar on New Features in .Net 4.5

Seminar on What's new in .Net 4.5 on 26th Nov 2011...If you are intersted send in an email to shaktisingh.tanwar@gmail.com to book your seat and to get further information regarding timings and location..Since there are limited seats entry strictly on first come first server basis for first 30 candidates..

Friday, 4 November 2011

.Net Framework 4.5 Developer Preview

I know its a stale news but for those who have missed it..Microsoft has released developer preview of .Net framework 4.5.
With this release the focus is primarily on creating metro style application for windows 8 and also on HTML5..
Major features included with the release for ASP.Net are:-
  • Support for new HTML5 form types.
  • Support for model binders in Web Forms. These let you bind data controls directly to data-access methods, and automatically convert user input to and from .NET Framework data types.
  • Support for unobtrusive JavaScript in client-side validation scripts.
  • Improved handling of client script through bundling and minification for improved page performance.
  • Integrated encoding routines from the AntiXSS library (previously an external library) to protect from cross-site scripting attacks.
  • Support for WebSockets protocol.
  • Support for reading and writing HTTP requests and responses asynchronously.
  • Support for asynchronous modules and handlers.
  • Support for content distribution network (CDN) fallback in the ScriptManager control.
For complete set of features and download please follow this link




Thursday, 30 June 2011

JetBrains dotPeek EAP is Open!

dotPeek is a new free-of-charge .NET decompiler from JetBrains, the makers of ReSharper and more developer productivity tools.

What's Cool about dotPeek?

  1. Decompiling .NET 1.0-4.0 assemblies to C#
  2. Quick jump to a specific type, assembly, symbol, or type member
  3. Effortless navigation to symbol declarations, implementations, derived and base symbols, and more
  4. Accurate search for symbol usages
    with advanced presentation of search results
  5. Overview of inheritance chains
  6. Support for downloading code from source servers
  7. Syntax highlighting
  8. Complete keyboard support
  9. dotPeek is free!
You can download it here

Tuesday, 28 June 2011

Windows Azure Seminar on 31st July 2011


Hi,

I am arranging a free seminar on Windows Azure on 31st july. There are
limited seats and session is strictly for my old students..

Date: 31st july 2011
Time : 9 am start
Duration: 4 hrs
Place: TBD

Entry by registration only for first 20 on first come first server basis

Monday, 20 June 2011

Warming up to WCF -- Web Services Part 3

How will make your web services stateful?
Or
This question can be asked as how to implement session in your web services?

Web services run on HTTP with underlying message protocol as SOAP, now since HTTP in its nascent form is stateless so are XML web services in .net. Now the question arises if web services are stateless, then how can we make our web services store user session information… Let’s look at the approach.

First Things first, we will make use of some of the properties of WebMethod attribute to enable session in a web service as follows


    [WebMethod (EnableSession=true)]
    public void SessionStart()
    {
        Session["username"] = "Shakti";
      
    }

    [WebMethod(EnableSession = true)]
    public string SessionEnd()
    {
        return "Hello  " + Session["username"];
    }

Now create a new project which will act as a client, it can be a windows form application or a Web site. For this sample I am taking a windows form..

In client add a reference to the service created above.

Add below code to access the service

       localhost.Service obj = new localhost.Service();
     obj.CookieContainer = new System.Net.CookieContainer();

     obj.SessionStart();

     Console.WriteLine( obj.SessionEnd());

And here is the output

Hello  Shakti

If you look at client code closely you will see below line

obj.CookieContainer = new System.Net.CookieContainer();

How it works?

We are storing session information in the proxy itself which is a part of client process so nothing is being stored on the server.
 

Sunday, 19 June 2011

OOPS Session Updates Held on 19th June

Another great session..In all 25 people attended the session which included a mix of freshers and experienced candidates from companies like HCL, CKlear, FISERV, WNS , GlobalLogic etc..
So if you haven't been able to attend the last 2 sessions, now is the last chance for you,..Next session will be on 26th june after which I will take a break since it becomes very hectic working on weekends :)

Please spread the word to your friends and attend to gain some invaluable experience..

Thanks,
Shakti

Thursday, 16 June 2011

Warming up to WCF -- Web Services Part 2

Now, since we have already covered some basics let’s jump to questions that we asked at the very beginning:-

Do web services support method overloading?

Web services do support method overloading but it’s turned off by default due to web service internationalization. Since web services are designed so that they can be used everywhere (all technologies) so some standards must be followed while creating your service so that they follow basic language rules followed by all programming languages.

This is how your web service looks like…

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

public class Service : System.Web.Services.WebService
{
    public Service () {

        //Uncomment the following line if using designed components
        //InitializeComponent();
    }

    [WebMethod]
    public string HelloWorld() {
        return "Hello World";
    }
   
}

Have a look at WebServiceBinding attribute above... What is it doing here?
It says that web service conforms to BasicProfile1_1 which is actually the standards that you must follow to internationalize your web service.

WS-I is web service internationalization. You can find more information here

Since this is the default value of attribute, if you try to overload the service it will throw error when you try to run the service. Reason is simple enough… Not all programming languages of world support method overloading so if your web service is internationalized it should also not expose overloaded methods. What if I am developing web service for my company’s intranet and I know that all my clients are going to be .Net clients… In that case you can modify your service to enable method overloading but you need to follow below steps:-

1.)   As a first step you need to change WsiProfiles.BasicProfile1_1 to WsiProfiles.None

2.)   Secondly, Provide a MessageName attribute to one of your methods.
           
        [WebMethod (MessageName="Test")]
      public string HelloWorld() {
           return "Hello World";
      }

    [WebMethod]
    public string HelloWorld(string name)
    {
        return "Hello World " + name;
    }


        What is the purpose of this MessageName attribute?
   
    It all boils down to WSDL. As you should know that all web services expose a WSDL file to clients which contains all the operations (methods) exposed by the service and their equivalent SOAP representations. So for a method accepting an input and returning an output there will be one SOAP INPUT element and one SOAP OUTPUT element in WSDL. The SOAP INPUT will have same name as that of operation (method) and SOAP OUTPUT will be operation name with Response appended to it…Lets see the SOAP part of method after overloading…


<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
<s:element name="Test">
  <s:complexType />
  </s:element>
<s:element name="TestResponse">
<s:complexType>
<s:sequence>
  <s:element minOccurs="0" maxOccurs="1" name="TestResult" type="s:string" />
  </s:sequence>
  </s:complexType>
  </s:element>
<s:element name="HelloWorld">
<s:complexType>
<s:sequence>
  <s:element minOccurs="0" maxOccurs="1" name="name" type="s:string" />
  </s:sequence>
  </s:complexType>
  </s:element>
<s:element name="HelloWorldResponse">
<s:complexType>
<s:sequence>
  <s:element minOccurs="0" maxOccurs="1" name="HelloWorldResult" type="s:string" />
  </s:sequence>
  </s:complexType>
  </s:element>
  </s:schema>
  </wsdl:types>


Thus if you have two methods with same name without a MessageName attribute, in that case there will be 2 same soap request and response generated in WSDL which is not a valid scenario… Thus that won’t compile.

Warming up to WCF -- Web Services Part 1

The world has moved to WCF but still when you go for an interview, most of the people ask you questions on web services before actually moving out to WCF...

Some very common and important question that people generally ask regarding web services are:-

1.) Do web services support method overloading?
2.) How will make your web services stateful?
3.) How will you design your service in a way that you can change the deployment     address with minimal fuss?
4.) What are the disadvantages of DCOM over web services?
5.) Why did MS created web services when there was a proprietary standard already available in form of DCOM?

Let’s start diving into the beautiful world of .Net web Services also known as XML web services...
.Net web services are a successor to DCOM (Distributed component object model)...So let’s first understand the limitations of DCOM which led to creation of Web Services:-

Limitations and Problems with DCOM:

1.)      DCOM was created with assumptions that all the nitty-gritty’s will be managed by the organization. Means all the components that will make up the application as a whole will be managed by the organization creating the application, which is not always the case since we are dependent on lots of third party apps, and how they are creates (technology) and managed (platform) is out of our immediate control.

2.)      Since DCOM is based on a proprietary standard (invented by Microsoft), its only good for windows operating systems and not well suited for heterogeneous environments.

3.)      Tight coupling between client and server is another reason for not liking DCOM. Any changes to server will mean a ripple effect on client side component as well.

4.)      Since DCOM supports binary data and TCP protocol, it’s not suited well enough for internet based applications. Remotable applications created using DCOM comes with extra burden of opening and maintaining ports, which generally sit behind firewalls in normal internet scenarios using HTTP.

Thus Xml web services came into picture. Advantages of web services included

1.)     Interoperability:-
                  Web services work out of private networks, generally deployed on a shared or           dedicated hosting environment and managed separately and thus the offer               better return on investments since one solution          can be used from multiple              places reusability) and by multiple clients since web services use SOAP over               HTTP. Web services are used to build platform independent solutions.

2.)     Reusability:-
                  With web services entire business logic can be separated into multiple web                services and let the client choose which business logic they want. So client is                  free to choose what they need instead of giving them everything as a bunch.

3.)     Deployability:-
                  Since web services are deployed over standard internet technologies, they               can be deployed over firewalls and there is no need to open additional ports                   since it’s accessible via Http ports 80 for http and 443 for https.

Still there were some disadvantages of web services:-

1.)   Security was not built into web services. Though it used built in windows authentication as well as forms authentication, we needed a well defined security framework for web services. Microsoft and IBM worked on a joint initiative which is later called WSE (Web Services Enhancements) which works as a layer over web services providing it features like security, transaction management, policy management etc.
2.)   SOAP, the underlying protocol on which web service is based is both a boon and a bane. It allows disparate system and technologies to interact with each other but if my client server is same (technology wise) then this is an overhead due to parsing of request and response at both ends. Web services doesn’t provide the flexibility to choose/switch between messaging standards i.e. SOAP for non .net client and XSD for .Net client.
3.)   Since web applications are stateless so are web services and there is extra work that’s needed at client side to make it work like a stateful service.

Feel free to comment if some more pros and cons come to your mind. I know there are lot more…

Monday, 13 June 2011

Has HTML5 Actually killed Silverlight

There have been lots of hue and cry over how HTML5 being superior than silverlight and how it will kill silverlight..Lots have been said regarding this but if you actually look at where silverlight actually makes sense then you will be amazed by the potential it provides for a .Net developer like me..
I have really been fascinated to mobile phone programming off late, More so since telecom industry is still an untapped industry in india( compared to other countries) and there is huge potential in gaming market whose boom is yet to come..Most of the people in india are still using mobile for receiving a call and sending an SMS but the potential for mobile application is huge and will increase with awareness..
Off late I have seen my friends using geolocator services in their mobile phones to search for routes while on a trip..
How do I create these applications as a .Net developer since what i know about mobile apps is that they are created in objective C or some other .Net languages..With the advent of silverlight it has opened a new dimension for a .net developer to start work on mobile apps...You can use silverlight to create applications for Windows Phone..
Below is an article from Tom Warren why Silverlight is not dead...
Please follow the link for complete story

OOPS Session Updates Held on 12th June

It was a great session..In all 27 people attended the session which included a mix of freshers and experienced candidates from companies like Fiserv , HCL , Miracle, RBS , NIIT etc..
Good to see some renowned trainers also attending the session..In all it was a great experience and I really enjoyed delivering it..
Thanks all for the support..
Hoping to get same kind of response in sessions that will be held on 19th and 26th june..
Please spread the word to your friends and attend to gain some invaluable experience..

Thanks,
Shakti

Sunday, 5 June 2011

Free OOPS Session in C#

Hi ,
I am organizing Free Session on OOPS in C# on 12th, 19th and 26th June. Please feel free to come... Feel free to bring in your friends..
Date: 12th/19th/26th June
Event: OOPS and .Net framework from beginner to advanced
Timing: 9.30 am -12.30
Fees: N/A Sessions are meant for information sharing
Why This Training: As a part of Microsoft's Community initiative
More about Trainer:-
· Gold level member on site http://www.dotnetspider.com/
· Star Level member on Microsoft official site www.asp.net. Currently holding 1st rank in Top Answerers list in Forums on http://forums.asp.net/

Trainings conducted
Company
Subjects
Duration
JobSeeders
Advanced ASP.Net with AJAX, OWASP
3 Months
JobSeeders
WCF, WPF & Silverlight
3 Months
JobSeeders
Advanced .Net
3 Months
Miracle
MOSS & WSS
5 days
Miracle
SharePoint Server Administration
7 days
Fiserv
.Net 4.0 , ADO.Net entity framework 4.0, MEF
4 days
Fiserv
.Net Design Patterns
3 days
Fiserv
OWASP web application security
2 days
Fiserv
.Net 3.5 including WCF,WPF,WF
5 days
RSystems
Advanced .Net 3.5
4 days
RSystems
.Net 3.5
6 days
Miracle Technologies
MCTS training
1 Month
RSystems
Advanced .Net with .Net 3.0
4 days
RSystems
Advanced Asp.net with Vb.Net
12 days
RSystems
Asp.net with C#
2 days
Fidelity, Chandigarh
Advance Xml, XSL and XSD
2 days
Tata Energy Research Institute, Delhi
Advance C#, Vb.Net and Asp.Net
3 days
TCS, Noida
Advance C#, Vb.Net and Asp.Net
4 days
CSC,Noida
1. SOAP
2. Asp.Net and Ado.Net and XML
5 days
CSC,Noida
Introduction to .Net framework using C#
1 Day
CSC,Noida
C#, Exposure to Asp.Net, Ado.Net, Xml in .Net
4 days
C-DAC, Noida
XML & Web Services
2 Days
Synergy Systems, Noida
C#, Exposure to Asp.Net,
Exposure to VB.Net
4 Days
C-DAC, Noida
C Data Structures
1 day
Location: -
12th, 19thand 26th june – Skjobseeders Training & placements, 3/2 West Guru Angad Nagar, Delhi-92 ( Near Nirman vihar Metro station,east delhi)
18th June : Aradhya Tutorials , 1st floor , Pul bangash Metro station
Feel free to contact me on 9891971113 for more information. Please pass on this information to your friends so that they also can be benefitted.


Thanks & Regards,
Shakti Singh Tanwar