Pages

Saturday, September 21, 2013

Visual Studio 2013 RC

Tools for Visual Studio 2013 RC

The New RC 2013 Visual studio is ready and you can download it from the below mentioned location “Download”.  The Visual Studio 2013 RC express edition is free and can be downloaded from the MSDN site.  There are a couple of new tools are introduce that are required and are very helpful. Here we are going to see the discussion about some of the new tools.

  1. One ASP.NET  : To starts with “The One ASP.NET”  Now the template to select any Web application is a part of One ASP.NET tool where you can select the various application template and even select the technology  as well for example web form or MVC.


You can also select various configuration related setting directly from the consecutive windows. This will make the life of the developer more simple and easy compare to the earlier version of the Visual studio.

  1. Signal-R Channel between the Browser and Visual Studio.
Remember this issue when each time you make a change in the code and you want it to reflect it in the browser you have to switch to the browser and need to refresh the page. Now you can take a deep breath and leave this task to the Visual studio.  This feature will allows the developer to link the browser to the visual studio directly so that you can refresh any browser page from the visual studio menu directly. This is using the Signal R tool.




  1.  New HTML Editor
To Cope up with MVC Razor syntax and new asp editors the HTML editor of the Visual studio is now refreshed. Here you can easily use the HTML5 standard tags. There is also improvement in area like intellisence and JqueryUI and some other JQuery tools. But for some issues the legacy editor is still used in the application. You can set various settings for the HTML editor using 
Tools >> Options >> text Editors. The Window will allow you to configure the HTML editor as per your setting.




  1. Scaffolding
Unlike many other language like Java or Ruby there was a need to have a strong Scaffholding which will lead to the easier and faster development of commonly used task in the application. This is now addressed by the feature called Scaffolding.  This is completely new as we have seen in the earlier version for MVC. There are some new templates are added. The MVC 5 support scaffolding are also added in this release.



  1. MVC 5
MVC5 is now a part of the Visual studio 2013 RC, a lot of improvement is done to integrate it with the tradional asp web forms application. The New MVC5 template is now part of the one ASP.net where an MVC application is created by selecting the MVC option.



  1. New MEF ( Microsoft Entity Framework)
The latest version if the MEF is released with Visual Studio 2013 RC the version number is 6.0 RC1.  This is also available in the NUget package which you can download from the below mentioned location. “Download”.

  1. ASP.NET Identity
A new Identify framework is present in the ASP.net which is called asp.net Identity. The maintenance if the user related information is now easier to handle and you can even store the data in some other store rather than SQL Server. Some important part of this Identity is listed below…
One ASP.NET Identity system
    • ASP.NET Identity can be used with all of the ASP.NET frameworks such as ASP.NET MVC, Web Forms, Web Pages, Web API and SignalR
Ease of plugging in profile data about the user
    • When you create new users in your application, it is now easy to add extra information about the user. For eg.. if you wanted to add a Birthdate option for users when they Register an account in your application.
    • ASP.NET Identity uses Entity Framework Code First and it is possible to extend the POCO classes.
Persistence control
    • By default the ASP.NET Identity system will store all the user information in a database. ASP.NET Identity uses Entity Framework Code First to implement all of its persistence mechanism.
    • If your application requirements are that this information might be stored in a different storage mechanism such as SharePoint, Azure Table Service, No Sql databases etc. it is now possible to plug in different storage providers.
Unit testability
    • ASP.NET Identity makes the web application more unit testable. You can write Unit Tests for the parts of your application that use ASP.NET Identity
Simple Role Provider
    • There is a Simple Role providers which lets you restrict access to parts of your application by Roles. You can easily create Roles such as “Admin” and add Users to Roles.
Claims Based
    • ASP.NET Identity supports claims-based authentication, where the user’s identity is represented as a set of claims. There is a Claims
External Logins 
    • You can easily add external logins such as Microsoft Account, Facebook, Twitter and Google to your application store the user specific data in your application using this system.
    • You can also add login functionality using Windows Azure Active Directory and store the user specific data in your application using this system.

When upgrading from Microsoft Visual Studio 2012 to Visual Studio 2013 you will take advantage of a refreshed and simplified environment with enhanced performance without any additional hardware requirements. Some of these core enhancements make use of capabilities that are only present in the latest versions of Windows and might require you to upgrade to a supported operating system.
This was a brief information about the Visual Studio 2013 RC tools. You can Refer MSDN for more details. Please provide your valuable comments and suggestion on this.

Thanks
Anil Kumar Pandey
Microsoft MVP, Microsoft MCC, DNS MVM


Wednesday, August 21, 2013

ReSharper


ReSharper

ReSharper is a renowned productivity tool that makes Microsoft Visual Studio a much better IDE. Thousands of .NET developers worldwide wonder how they’ve ever lived without ReSharper’s code inspections, automated code refactoring’s, blazing fast navigation, and coding assistance. It is a popular developer productivity extension tool for Microsoft Visual Studio. It automates most of the task that can be automated in coding routines. Resharper finds compiler errors, runtime errors, redundancies, code smells, and possible improvements right as you type, suggesting intelligent corrections for them. ReSharper helps you explore code by visualizing the structure of files, type and style hierarchies, call and value chains, project dependencies. It allows you to instantly traverse your entire solution and jump right to the exact file and line that you are looking for, decompiling library code if necessary. Dozens of solution-wide refactorings are available to help you safely change your code base. Code formatting and cleanup features allow you to get rid of unused code and help your entire team to ensure compliance to coding standards.

Why ReSharper

With unparalleled support for C#, VB.NET, XAML, JavaScript, XML, HTML, CSS, ASP.NET, ASP.NET MVC, NAnt and MSBuild scripts including comprehensive cross-language functionality, ReSharper will help any Visual Studio userwrite better code, easily examine and refactor existing code bases.

You can spend less time on routine, repetitive manual work and instead focus on the task at hand. A robust set of features for automatic error-checking and code correction cuts development time and increases your efficiency. You'll find that ReSharper quickly pays back its cost in increased developer productivity and improved code quality. With ReSharper, .NET developers can truly experience what we mean when we say "Develop with pleasure!"

 

Code Analysis :- On-the-fly code quality analysis in C#, VB.NET, XAML, ASP.NET, ASP.NET MVC, JavaScript, CSS, HTML, and XML. ReSharper tells you right away

Navigation and Search: Search the method and Reference on the fly in entire solution.

Coding Assistance:  Help and suggestion in creating/writing the code by syntax highlighting.

Refactoring: Suggestion while modification of the code as per the standard.

Code Generation:  Creating new stub/code assistance, option is available on the go.

Code Template: Readymade template is available for the code. Start the name and press tab for more.

Code Cleanup:  Allows you to format the code by cleaning the redundant code and unused lines of code.

Unit Testing: Help in creating and running the unit test by providing context menu option.

Internationalization: Globalization support is also available for example highlight of the string that can be globalized.

MVC Tools: help for code in ASP.net MVC are also available by analysis of the HTML tags and fields as well as the controllers.

XAML Editing: Option for XAML is available like intelligence, code block creation and code reordering.

Cross Language Functionality: help available for all the language of the visuals-studio suit so that navigation and search is possible.

Nant/ MS Build Script Editing: On the fly option of error highlighting and script debugging.

 

The latest version of the ReSharper is 8 which you can download from the official site of the ReSharper. This is licensed software which you can buy from the same location.  A Developer/ trial version is also available. Hopefully you have like this tool and will get benefit from it. Please do share your thoughts on the same.

 

 

Thanks

Anil Kumar Pandey

Friday, June 28, 2013

Visual Studio 2013 Preview


Hi Friends,


Microsoft has now come up with the new version of the visual studio. which is Visual Studio 2013. The Preview version of the application is now ready to download. So download the copy and enjoy the new features, please provide your feedback to Microsoft about the same. Here is the email which is received from Microsoft yesterday.



“The rapid evolution of software development requires a rapid delivery cadence for both the tools and the frameworks you use. Visual Studio 2013 Preview and .NET 4.5.1 Preview provide new capabilities that will help you deliver continuous innovation for your customers, by providing enhanced development capabilities and agile team collaboration tools to deliver in faster cycles.

• Create outstanding experiences across Windows devices, including the latest development, design and diagnostics tools for Windows 8.1.

• Create modern web applications and services on-premises or in the cloud, with the new additions to Visual Studio and ASP.NET that simplify web development across multiple browsers and devices.

• Achieve business agility with an integrated solution that enables shorter cycles, now including agile portfolio management, real-time collaboration with team room and easier access to the information you need directly from the code editor.

• Continuously enable quality throughout the development process, with enhanced testing tools that leverage the cloud for enabling new scenarios such as cloud-based load testing.



Take advantage of these powerful tools and services by downloading Visual Studio 2013 Preview today!”

Thanks
Anil Kumar Pandey
Microsoft MVP, Microsoft MCC, DNS MVM






Wednesday, June 5, 2013

Action Result in MVC


In MVC Action result is a special class. This is described generally as the result of an action method, The Action method can be any method within our controller. Action Result is used to perform an operation on behalf of the action method. Thus we can say that the ActionResult are the Outcome of any action.

This class is derived from the System.Object class directly and it is present inside the System.Web.Mvc

The Assembly for this class is  System.Web.Mvc (in System.Web.Mvc.dll)
System.Object  >>   System.Web.Mvc.ActionResult

Now, this ActionResult work as a base class and we have multiple child classes which are derived from ActionResult base class.


Action Result is an Abstract class, thus we can have some concrete method and non-concrete method inside this class. The syntax fir this class is as
public abstract class ActionResult

Some of the Method expose by this class are.

1.       Equals
2.       ExecuteResult
3.       Finalize
4.       GetHashCode
5.       GetType
6.       MemberwiseClone
7.       ToString

There are several child classes that are derived from this class. Each class can be used for different purpose and are quite useful in performing our operation. Here we are going to see one by one which class is used for which purpose.

·         ContentResult :  This can be a Userdefined result of the action method.

public ActionResult TestAction(bool id, string strMsg) {
    if (id != 0)
        return Content(Server.HtmlEncode((strMsg.ToLower())));
    else
        return Content(Server.HtmlEncode(strMsg));
}


·         EmptyResult : Is used when the action method does not result anything, This type of result is nothing or empty.
public EmptyResult TestAction(bool id, string strMsg) {
        // ur logic
            return new EmptyResult();

}


·         FileResult :-  If we have to return a binary file as an output or result then the FIleResult class is used.

public FileContentResult DownloadFile(int fileId)
    {
        // load file content from db or file system
        string fileContents = "Test file content ";

        // convert to byte array
        // use a different encoding if needed
        var encoding = new System.Text.ASCIIEncoding();
        byte[] returnContent = encoding.GetBytes(fileContents);

        return File(returnContent, "application/CSV", "testingResult.csv");
    }


·         HttpUnautorizedresult: - If any request is unauthorized http request then we can use this action result to perform the output operation.


public ActionResult Index(string userName)
{
   If(username == null)
  return new HttpUnauthorizedResult();
}

·         JavascriptResult:- If we have to add a JavaScript result in the response then we make use of this action method.

public ActionResult TestJavaResult() {  
    string s = "$('#test-div').html(Tested!!!');";  
    return JavaScript(s);  
} 


·         JsonResult:   JSON formatted content in the response can be send by using this action result. Generally used for Ajax posting result.

public JsonResult GetJson()
{
                        return Json(resultset, JsonRequestBehavior.AllowGet);
 }


·         RedirectToActionResult : This action result redirect to a particular URL as a result of the action method.

public ActionResult Index()
{
    //All redirect here
    return RedirectToAction("Test", "Test");
}


·         RedirectToRouteResult:- If we are using any specified route for redirecting then this action result class is used.

     filterContext.Result = new RedirectToRouteResult(test);

·         ViewResultbase:- If we have to bind a Model with a view then we use this action result so that a view can be returned as an output with required model value.

    public ActionResult HelloWorld()
    {
        ViewData["Message"] = "Hello .Net Helper!!!";
        return View();
    }



Hope You  got the basic details about the ActionResult class and all its derived classed. These are very commonly used Actionresult in the programming. Please share your thoughts on the same.

Thanks
Anil Kumar Pandey
Microsoft MVP, Microsoft MCC, DNS MVM


Kontera