Visual Studio 2017 – New features and updates

Introduction Visual Studio is a very giant integrated developing environment for all the Microsoft t

Introduction

Visual Studio is a very giant integrated developing environment for all the Microsoft technologies from desktop apps to websites to mobile apps to gaming. Written in c++ and c#, it provides a developer and asp.net software companies to enhance the productivity with many advanced features like intellisense support for all the integrated languages, the debugger which can debug on machine level and source level, tools and controls for creating User Interface and many more.

The Latest version is Visual Studio 2017 RC, it has many new features and upgrades from the previous version, startup time and load time of the projects is very less compared to previous version and has the preview version of the Microsoft’s new cross platform .NET Core and Docker. All the new features are included in the next section.

New Features and Updates

  • Offline Installation:

    Visual studio 2017 now supports offline installation which doesn’t require internet during installation process. The offline executable can be created by the system administrator with a simple command “vs_enterprise.exe --layout c:\mydownloadfolder”,it will download all required packages in c:\mydownloadfolder for the offline installation. After downloading, you can easily install by running the executable present in the folder “mydownloadfolder”.

  • EditorConfig:
    Support for EditorConfig is now included in 2017 version, this will allow a developer and c# software development companies to create their own user defined setting for better coding style in a project and will be available to all the developers working on a particular project. All the project will have this file with extension .editorconfig
  • Connected Services:

    This feature is the updated version of "Add Connected Service" or "Add Service Reference". A new node in the solution explorer with a new icon will be shown in the solution explorer, you can view all the available service from Microsoft to connect to through this feature.

  • Folder View:

    This feature in particular has improved drastically which takes 50% load time as compared to the previous version of VS. Also new icons and folder views are included like for Connected Services. Overall the project loading is fast and improved.

  • Go To:

    In this version the Go To feature is improved a lot, like It will let you quickly find files, classes, Methods and other reference objects, the search will show the list of all the objects from different files just while you are typing. Go to line will now show you the total number of line present in the document of which where you want to navigate. “Navigate To” option is now included in Go To feature.

  • IntelliSense:

    Intellisense is now more advanced and filters the result and gives you options according to the language you are writing on. Dot-To-Arrow feature is now advanced along with other features like Expand Scopes and Expand Precedence. New mode are added in the filter area of the Intellisense.

  • Debugging enhancement:

    The very first point which is “Run to Click”, it will save lots of developers and vb.net software development companies time to put a temporary breakpoint while debugging the code. Just click on the icon before the line where you want to debug and it can be disabled from the debug options. Another important feature is Chrome debugging which is very important for the Web developers which lets you debug the JavaScript code from VS running in the Chrome.

  • IDE Experience and Productivity:

    As per the release notes of the Visual studio 2017, many enhancement is done in this area

    • Object Initializer: It will allow you to create the instance of a class along with its properties without writing the whole code line by line.
    • Out keyword: declaration of out variable can be done inline, new in C#.
    • Null-coalescing operator can be replaced easily in place of if statements.
  • Preview of .NET Core and Docker:

    Option included during installation to install .NET core preview in the new version of VS. Web publish is moved from powershell to MSBuild in .NET Core Projects. You can also cross reference between .NET Framework project or Xamarin project. Asp.NET Core projects will have Docker support, building the project and delivering it to Azure all within Visual studio. This feature is still in development, there are many points missing for starting a full development.

  • Live Unit Testing:

    First, this feature is available on Enterprise edition only. It will allow you to see unit test result when you are writing your code and works perfectly in C# and VB projects even when there are other projects in solution. The usability of this feature has been improvised.

  • XAML Editor:

    It is also improved in Visual studio, which now support for including namespace and creating prefix of the type while writing the code for Xaml document. Rename refactoring is now also possible for the namespace prefix. Unnecessary and no longer used namespace can be removed with just a simple command. .editorconfig support is included for Xaml documents, you can easily define various styles for xaml documents in .editorconfig. Overall, it has been improved in performance and for better development.

Summary

With all the new great features for development and see final results with great productivity, Visual studio 2017 stand out to be the best integrated developing environment for .NET software development companies in India. There is also a preview of Visual studio available for mac mostly for development of native mac apps and mobile apps. It is more focused on cloud development, so developer can share their source between Windows and Mac. There is a full list of features included in Visual studio 2017 which can be found here.

ASP.NET SignalR for real time applications

Introduction SignalR is a new library for .NET software development companies that is used to a

Introduction

SignalR is a new library for .NET software development companies that is used to add real time web functionality to ASP.NET applications. Real Time functionality is the ability to have put your server side code content to connected clients instantly as it becomes available, rather than having the server wait for a client to request a new data.

SignalR provides a bidirectional communication channel between (web) clients and a server side (web) application. SignalR is not limited to web application. A client can be every application or web page which uses JavaScript or .NET Framework 4.5 (or 4 with some restrictions) - like Windows Phone apps, SilverLight or Console applications. A SignalR server application has to be build with .NET Framework 4.5 (or 4 with some restrictions).

                        

SignalR provides two communication levels:

  • Persistent Connection API - low level, message-oriented communication
  • Hub API - high level, allows direct call of client and server methods

The Hub API offers the most convenient and preferred communication API. The Persistent Connection API might only be interesting, if you need to integrate with an existing message based server application or if you need for some reason detailed control on the message level.

How it is different?

SignalR is the latest library in ASP.Net, the 'real-time' framework that allows the server to execute methods on the client.  We are not limited to this interaction, and we can expose server-side methods to our clients.  This potentially allows for a much cleaner interaction between client and server, as all data is passed through arguments or the result of a method call.  SignalR clients are available for a variety of platforms, and a client-side is generated for all of the server-side methods that are exposed to the clients.

Analysis of ASP.NET SignalR

Advantages

  • Not restricted to web clients
  • Selection of the best available communication mechanism automatically
  • Binding complex objects (JSON)
  • Open-source solution available on GitHub that can be installed via NuGet
  • Bidirectional communication for (web) clients
  • Easy to setup
  • Install by issuing NuGet command: “install-package Microsoft.AspNet.SignalR“. 
  • SignalR can run inside a web application or self-hosted.
  • Easy to debug. It can run in IIS Express. All the powers of Visual Studio just wait to be utilized.
  • Very good documentation and tutorials

Disadvantages

  • Not a reliable communication
  • ASP.Net Software development companies should not use it if a guaranteed delivery of messages is mandate. Bank Transaction are a negative example.
  • It uses dynamics. Some syntactical errors can only be detected at runtime. However, only a few lines of code are affected. So, it’s not a real problem detected all errors related to the usage of dynamics.
  • At times, it’s difficult to attach a debugger to the running process, especially, under heavy load.
  • Allows only 10 connections when running in IIS in desktop systems.
  • Web clients and the server use different technologies so there is not much code reuse between them.

Simple Chat Application with MVC

  • In Visual Studio, create new project with C# ASP.NET Web Application and click ok.

                          

 

  • In the New ASP.NET Project window, select MVC, and click Change Authentication.

 

  • SelectNo Authentication in the Change Authentication window, and click OK.

 

  • Click OK in the New ASP.NET Project 
  • Open theTools | Library Package Manager | Package Manager Console and run the following command. This step adds to the project a set of script files and assembly references that enable SignalR functionality.

install-package Microsoft.AspNet.SignalR

 

  • In Solution Explorer, expand the Scripts folder. Note that script libraries for SignalR have been added to the project.

                                                                   

 

  • In Solution Explorer, right-click the project, select Add | New Folder, and add a new folder named Hubs.
  • Right-click theHubs folder, click Add | New Item, select the Visual C# | Web | SignalR node in the Installed pane, select SignalR Hub Class (v2) from the center pane, and create a new hub named cs. You will use this class as a SignalR server hub that sends messages to all clients.

 

 

  • Replace the code in theMessageHub class with the following code.

 

  • Create a new OwinStartup class called Startup.cs and press Add.

 

  • Change the contents of the Startup.cs file to the following.

 

  • Edit theHomeController class found in Controllers/HomeController.cs and add the  following method to the class. This method returns the Chat view that you will create in a later step.

                                                            

 

  • Right-click the Views/Home folder, and select Add | View.

 

  • Replace the contents ofcshtml with the following code.

 

  • Save All for the project.

Run the SignalRDemo

  • Press F5 to run the project in debug mode.
  • In the browser address line, append/home/chat to the URL of the default page for the project. The Chat page loads in a browser instance and prompts for a user name.

 

                                                      

 

  • Enter a name.
  • Copy the URL from the address bar of the browser and use it to open two more browser instances. In each browser instance, enter a unique user name.
  • In each browser instance, add a comment and click Send. The comments should display in all browser instances
  • The following screen shot shows the chat application running in a browser.

 

 

  • Type message and press sent and check with two different browser instance

 

Conclusion

SignalR identifies the process of building real-time applications. It includes an ASP.NET Site server library and a JavaScript client library to make it easier to manage client-server connections and push content updates to clients from SignalR Hub. You can add the SignalR library to an existing ASP.NET application to gain real-time functionality.

 It also enables completely new types of applications that require high frequency updates from the server, e.g. chat application, real-time gaming, Application Monitoring, etc.

 

 

.NET Core by Microsoft - New step towards cross-platform software development

What is .NET Core? .NET Core is a subset of .Net framework but modular, cross-platform, open source


What is .NET Core?

.NET Core is a subset of .Net framework but modular, cross-platform, open source for building more comprehensive software that can be used over a numerous platforms. Being cross-platform, gives advantage to asp.net software development companies to develop all .net applications on Windows, Mac and Linux. It comprises of several components such as managed compilers, base class libraries, the runtime and different application models. The .NET Core doesn’t depend directly on base libraries as a dependency but rather they are distributed in NuGet packages which can be accessed on any platform. The goal of .NET Core is to have a single code base that can be used to build and support all the platforms including Windows, Linux and Mac OSX.

Features of .NET Core

  • Cross-Platform: Any application built using .NET Core can run across different platforms like Mac, Windows and Linux. The best choice for software development companies to develop cross-platform software, web apps, or websites with Visual Studio Code for various platforms like Windows, Mac and Linux.
  • Open source: .Net Core project is available on Github as an open source Project to be accessed for versatile and more transparent development. The active community serves as a powerful support for the development of .NET Core build applications.
  • Modular: Instead of the libraries in dll to be available for dependencies, it is available in different small modules as NuGet. For specific feature requirement, one does not require including the whole core assembly as dll but can directly import the small module from the NuGet.
  • Native Development Environment: Microsoft has introduced very lightweight and cross-platform development tool which is available for Windows, Linux and Mac called Visual Studio Code. It has Intellisense for better development and help you in every step during code writing. Inbuilt debugger makes it more powerful. The most important part of the Visual Studio Code is availability of various extensions. Several extensions are available for the development as per your need. It has support for npm and bower as well.
  • Developer Productivity: Microsoft has packaged their own lightweight web server called Kestrel. It has many uses, from development to cross-platform compatibility and help run the website on Mac OS and Linux environment. The process of compiling the project before viewing it on the browser has been eliminated in this server.

 

Comparison with .NET Framework

Features .Net Core .Net Framework
Platform Available on Linux, Mac and Windows Available only on Windows Only
Project Source Open Source available on Github Closed Source, Maintained privately by Microsoft
Development Environment Visual studio Code and command line Interface which is very lightweight Visual Studio, Visual Web Developer for web application
Portability Upgrade different application side by side Have to update the all the application
Runtime CLR CoreCLR
Compiler Just in Time Compiler RyuJIT, Improved JIT Compiler
Web Apps Supports Yes Yes
Command-line apps Yes Yes
Universal Windows Platform apps Yes Yes
Windows Forms No Yes
Windows Presentation Foundation No Yes
Update Update from NuGet Package separately Comes with Microsoft windows update

 

Comparison with Mono 

.Net Core Mono
Subset of .NET Framework rewritten for cross-platform compatibility Implementation of .NET Framework for Linux
Modular architecture Integrated architecture
Develops various range of applications Mostly develop mostly Mobile based application
Supports WPF Does not WPF support
Supports many language available on NuGet Supports only C# for development
Does not support WPF or Windows Form Supports WPF and windows forms
Supported by Microsoft Supported by Xamarin

 

Advantage over other technologies

  • It works on file system which allows faster development cycle. It detects changes, compiles in memory and load the application.
  • Project based configuration and setting, for example, you have 2 different projects which need different versions of the framework under the same server, unlike in Java which shares a common framework to work on application.
  • It uses completely new lightweight and modular HTTP request pipeline.
  • It uses JSON over XML for configuration settings because it is very lightweight and faster. For example, json and Project.json.
  • It is designed to work with various client-side frameworks including AngularJS, KnockoutJS and Bootstrap.
  • A very lightweight and new development environment for easy development on all three major platforms Windows, Linux and Mac.
  • Supported by Microsoft all way with an active community on Github along with the .NET Core project.

Conclusion

Microsoft has taken first step towards cross-platform development that has inherent properties of .NET framework. This platform has potential to revolutionize the development of cross-platform applications for asp.net software development companies in India.

As it is new, so there is a shortage of tutorials and documentation but with time it will develop as .NET framework has developed in previous decade.

Crazy technology ideas to tackle Demonetization situation in India

Black money is a big menace in Indian economy. There are businesses that run heavily on black money

 

Black money is a big menace in Indian economy. There are businesses that run heavily on black money transactions like real estate, textile, fertilizer, agriculture and FMCG etc. Black money transactions for economic activities in India is the main culprit for high tax evasion, terrorist activities, fake currency in economy, low per capita income and low GDP growth in India.

It was a historic event on 8th November, when the Prime Minister of India, Mr. Narendra Modi, declared the demonetization of 500 and 1000 INR currency notes. This was historic in the execution as well as it was very sudden and did not give any chance to black money holders to adjust the same. Lot of Indian citizens are supporting this marvelous and bold move though it created some inconveniences to citizens. Time will tell if these small inconveniences are worth the economic gains that economists are predicting.  As a software development company in India, we could not resist thinking of ways a technology can assist managing the chaos and long queues at banks and ATMs.

Cash deposit scheduling system by bank or RBI

Business owners, traders, house wives, farmers are some of the citizens who might have heavy cash piped up in their businesses or houses. Deposits of cash higher than threshold amount should be planned so that it should not cause inconvenience to general public who are in genuine need of cash for their day to day operations. Big cash deposits creates havoc at bank as it takes time. This can be managed by an online scheduling system or app. If such system is in place, cash deposits can be managed more effectively. This can also save time of citizens by avoiding long queues and such transactions can be processed faster at bank.

App or website to validate fake currency notes          

One of the reason of demonetization as cited by Government was to demolish face currency notes that has piped up heavily in the economy since long. If Government or bank can develop a mobile application or website that validates fake currency notes before deposit that can help citizens a lot.  Technical feasibility of such mobile app or website needs to be verified though. We believe RBI should work on some API or web service that can help achieve this.

Nearby ATM/bank locator with cash/no-cash status

Standing in ATM queue for hours and ATM runs out of cash the moment your turn comes can be very frustrating and disturbing. If a mobile app or website that can help citizens know the status of nearby ATM or bank that has cash for replacement or withdrawal can assist them a lot. Google recently published a service whereby user can locate the nearby ATM however this does not show the status if ATM has enough cash or no.

Avoidance of recurring withdrawals using biometrics or aadhar card linkage

As cited by few local newspapers, one of the biggest reason for long queue is dummy people withdrawing money on others’ behalf multiple times. If such recurring withdrawals can be monitored and controlled, you automatically control the long queues. Biometrics with aadhar linkage is one of the technical way to address this. I understand that complete elimination of such cases is beyond control however this can surely help a lot to control the long queues.

Online grievance redressal system and helpline

The moment the Prime Minister of India announced the demonetization of 500, 1000 INR currency notes, there are thousands of various types of rumors being spread via WhatsApp, Emails and SMS. A helpline number and an online system to address the grievances and inconveniences of citizen can be a great idea. There are people who do not know how to manage their cash even though that is their genuine earnings and is totally legitimate money like farmers’ earnings, housewives savings etc. If there can be a system by RBI or banks to address such grievances, it can help Govt. to control the situation.

RBI Notifications, alerts and messaging app

It has been observed that various kinds of notifications, orders etc. are being circulated by RBI regularly. Some of the notifications are like change in withdrawal limits, relaxation on various situations etc. are not reaching till the bottom. A mobile app or online website/webpage with such notifications, alerts and messages can help people to remain updated with the situation.

Increase of online services to farmers and other citizens

Govt. agencies like GNFC, IFFCO etc. should start providing fertilizers, chemicals, seeds etc. to farmers who are in dearth of currency notes on credit. This can assist people who are in genuine needs of currency notes. This can lower the public inconveniences and can also be good for overall economy.

Technical feasibility of above applications is not thoroughly reviewed, however if implemented with help of software development companies, can surely assist in managing the long queues at ATMs and Banks. It can also help government in addressing grievances of citizens and can help them in long run. This is not addressing economic impact though as we could not comment on economic impact of this move.

  

 

Which ORM model is suitable for ASP.NET application - nHibernate vs Entity framework

What is ORM Model? Per ASP.NET software companies, Object Relation Mapping (ORM) is used for data pr

 

What is ORM Model?

Per ASP.NET software companies, Object Relation Mapping (ORM) is used for data processing from a relational database to modeling (logical objects or domain classes) in the programming that is more easily usable by code. In this, data-management tasks act on object-oriented objects that are almost non-scalar values. ORM models are gaining high popularity among ASP.NET software companies in India, as it is provides better performance, scalability, reliability and maintainability to software applications.

The ORM's use is to take programmers’ LINQ statements and translate them into SQL queries for ASP.NET application. This enables a developer to write complex queries against the database without ever having to write a single line of SQL Query. 

What is NHibernate?

NHibernate is an Object Relational Mapping (ORM). Its objective is similar as that of other ORM architecture. NHibernate is free as open source software architecture for ASP.NET applications.  It is used for mapping .NET classes to database tables (and from CLR data types to SQL data types). NHibernate also provides data query and retrieval facilities to ASP.NET software companies. It is the requirement of ORM tools to create a mapping specification that traces properties of objects map to columns in tables and/or views in database.

What is Entity Framework?

Entity Framework is an Object Relational Mapping (ORM) framework. This is also an open source framework. It started as commercial but then converted to freely available framework.  The objective of this framework is similar to other ORM frameworks. It gives automated mechanism for data storage and data access from database.

 Entity Framework also provides services like change tracking, identity resolution, lazy loading, and query translation so that developers can focus on their application-specific business logic rather than the data access fundamentals.

Comparison between NHibernate vs. Entity Framework

Properties NHibernate Entity Framework
Mapping It supports XML-based, Attribute-based and strongly-type code-based mappings It supports Attribute-based and strongly-type code mappings
Database Support All type of DB Providers are supported E.g. Microsoft SQL Server (including Compact Edition), Oracle, Microsoft Access etc It supports SQL Server, SQL server compact edition provider, SQL Lite, SQL azure, oracle, MySQL
Code First Mapping Support Yes Introduced from version 4.0
Lazy Loading Support Lazy loading for associated entities (one to one, many to one) Collections (one to many, many to many); Scalar properties (thing of BLOBs or CLOBs). Lazy loading for Associated entities Collections
Migrations Support Supports only initial schema generation Built-in schema migration support Also supports seeding of the initial database
Asynchronous call No Yes
Connection resiliency Third party solutions exist with NHibernate.SqlAzure This feature was added to version 6; the connection resiliency feature automates the process of retrying failed SQL statements
Code based Configuration NHibernate 3.2 with Fluent-NHibernate Available from version 4.1; Entity Framework automatically finds a class that derives from DbConfiguration; One can use the DbConfiguration class to complete configuration tasks in the source code.
Querying API Linq to Entities most used Entity-SQL-object oriented, database independent querying language Plain SQL LINQ provider for NHibernate and Query Over–Similar to Criteria API, but uses strongly-typed LINQ expressions instead of strings. This is also the most commonly used today.
Documentation Poor, but good forum support is available Good
Cascading Support Yes Yes
Caching Support second level caching Yes from version 6.0
Cascading Support Yes Yes
Tracking changes Change tracking at the unit of work level Change tracking at the unit of work level Entity Framework also offers self-tracking entities.
Events NHibernate has a very rich event model, that exposes more than 20 events, either for synchronous pre-execution or asynchronous post-execution, including Pre/Post-Load Pre/Post-Delete Pre/Post-Insert Pre/Post-Update Pre/Post-Flush Entity Framework only has two event-based extension points: ObjectMaterialized SavingChanges.
Batching Support NHibernate has full support for insertion batching, but only if the ID generator in use is not database-based (for example, it cannot be used with Identity) No
Flushing Changes NHibernate’s ISession has a FlushMode property that can have the following values: Auto Commit Never Entity Framework, changes have to be explicitly sent through a call to AcceptAllChages() SaveChanges()
Custom type and collection support Yes No
.NET 4.5 Support Yes Yes (with improved performance)
Complexity Higher Easy

Conclusion

NHibernate and Entity Framework both are equally capable Object Relation Mapping (ORM) and suitable for all types of ASP.NET software applications. In view of ASP.NET software companies, both Frameworks are used for processing relational data to domain specific objects. Entity framework is easier for someone familiar with Microsoft stack technology.

Both NHibernate and the Entity Framework provide the capabilities required to implement an ORM using the Model First approach.  The Framework creates the classes defined in the data model, NHibernate does not.  Nonetheless, from a developer point of view, creating the entities and their relationships by hand does provide greater insight into the detailed aspects of the program.