Monday, 28 March 2016

How to Check Which Version of Microsoft .NET Framework is Installed in Windows?

There are 3 easy way to find out the version of .NET Framework installed in your system:
  • Using Windows Explorer
  • Using Registry Editor
  • Using Command Prompt


Method 1: Using Windows Explorer

All Microsoft .NET Framework versions are installed in following directory:

%windir%\Microsoft.NET\Framework\


Where "%windir%" represents "Windows" directory present in the system drive where Windows is installed in your system e.g. C:\Windows\.
So just type the above mentioned path in RUN dialog box or in Windows Explorer address bar and press Enter. It'll open the directory as shown in following screenshot:


Here in this folder, you can find out which versions are installed.


Method 2: Using Registry Editor

You can also find out .NET Framework version using Registry Editor:
1. Type regedit in RUN or Start Menu search box and press Enter. It'll open Registry Editor.
2. Now go to:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP
3. Under this key, you'll see separate keys for each .NET Framework version installed in your system.


Method 3: Using Command Prompt

Here is another method to find out all Microsoft .NET Framework versions installed in your Windows:
1. Open Command Prompt from Start Menu and execute any of following commands:
wmic /namespace:\\root\cimv2 path win32_product where "name like '%%.NET%%'" get version
dir %windir%\Microsoft.NET\Framework /AD
You can copy the above mentioned command and then open Command Prompt, right-click on its titlebar and select "Edit -> Paste" option. It'll quickly paste the whole command.
2. Wait for a few seconds and it'll show a list of all .NET Framework versions installed in your system as shown in following screenshot:




Sunday, 13 March 2016

Visual Studio 2015 Update 2 RC Announced



The Release Candidate (RC) of Visual Studio 2015 Update 2 has been announced. The release focuses on the feedback given by developers across the globe on RTM and Update 1 and responds to it. It also focuses on stability and also includes enhancing performance and responsiveness.
 
Here are some significant changes.
 
Visual Studio Tools for Apache Cordova
 
The new release includes Visual Studio Tools for Apache Cordova Update 5 and brings several bug fixes, command line integration for project creation, and iPhone 6s simulator support.
 
Visual C++: Compiler and IDE
 
The C++ compiler and standard library is updated with improved support for C++11 and C++14 features. Also, more than 300 compiler bugs are fixed.
 
With Update 2, new Visual Studio installations use the new database engine introduced in Update 1 by default.
 
For upgrading from Update 1 to Update 2, you’ll continue to use whatever engine you already had selected. You can select the engine via Tools, Options, Text Editor, then click C/C++ > Experimental as in the following:




.NET Framework 4.6.1 - ClickOnce Bootstrapper package
 
In the new update, the .NET Framework 4.6.1 ClickOnce Bootstrapper package for Visual Studio 2015 in Update 2 has been added.
 
Visual Studio IDE - TextMate Snippet Support
 
Now support is provided for consuming tmSnippet files by placing them into a snippet folder and accessible through the IntelliSense completion.
 
Team Explorer and Git Updates
 
Now, opening Team Explorer and browsing work item queries in Visual Studio is faster with update 2.
 
There are some Git updates also:
 
Git SCC status to the status bar have been added, including the number of modified files and unpushed commit.
 
Visual Studio is now compatible with Git repos that are configured to use Git LFS (Large File Storage).
 
The Changes page now supports staging, with simple actions—such as double-click—to stage all and view diffs for changed files.




SQL Server Data Tools
 
Visual Studio 2015 Update 2 includes the latest updates of SQL Server Data Tools. This enables support for the most recent features in Azure SQL Database and SQL Server 2016.
 
TypeScript
 
Visual Studio 2015 Update 2 includes the 1.8.1 release of TypeScript. It addresses bug fixes for publishing web applications and enhanced compiler performance. 
 


Tuesday, 8 March 2016

.NET Development

You can use the .NET Framework to develop apps for the desktop, web, and mobile devices, including Windows Store and Windows Phone Store apps:

  • The .NET Framework can be used with such core app development technologies as Windows Presentation Foundation (WPF), Windows Communication Foundation (WCF), and Windows Workflow Foundation (WF).
  • To read about creating Windows 8.x Store apps in Windows 8 Windows 8.1 and Windows 10, see the Windows Dev Center.
  • To read about creating Windows Phone apps, see the Windows Phone Dev Center.
  • For information about creating portable .NET Framework assemblies that work without modification on Windows,Windows Phone, and other platforms, see Cross‐Platform Development with the .NET Framework.
  • For additional information about developing apps, visit the Windows desktop apps and web development sections of the MSDN Library.
  • You can use Visual Studio for your development tasks and select from a wide range of programming languages



The .NET Framework also releases out‐of‐band packages with new functionality and improved cross‐platform support. For information about these, see The .NET Framework and Out‐of‐Band Releases.

You can extend the capabilities of your apps with the following .NET Framework technologies:

Silverlight
A cross‐browser, cross‐platform implementation of the .NET Framework for building media experiences and rich interactive apps for the web, desktop, and phone.

WCF Data Services
A technology that enables you to create services that use the Open Data Protocol (OData), which exposes and consumes data over the web or intranet by using the semantics of representational state transfer (REST).

Entity Framework
A technology that supports the development of data‐oriented software applications. The Entity Framework enables developers to work with data in the form of domain‐specific objects and properties, without having to concern themselves with the underlying database tables and columns where this data is stored. With the Entity Framework, developers can work at a higher level of abstraction when they deal with data, and can create and maintain data‐oriented applications with less code than in traditional applications.

Reactive Extensions
A library for composing asynchronous and event‐based programs for the .NET Framework, Silverlight, and Windows Phone 7 by using observable sequences and LINQ‐style query operators.

Microsoft Surface
A development platform that helps you create interactive Microsoft Surface apps by using the .NET Framework. This technology supports high‐end graphics and multiuser interaction through natural gestures, touch, andphysical objects.

Windows Identity Foundation (WIF)
A set of .NET Framework classes that help you build claims‐aware,relying party applications and security token services. In the .NET Framework 3.5 SP1 and the .NET Framework 4, the WIF runtime was downloaded separately. Beginning with the .NET Framework 4.5, WIF is fully integrated into the .NET Framework, and WIF content is available in the .NET Framework documentation set.

Windows Server AppFabric
A set of integrated technologies that make it easier to build, scale, and manage web and composite apps that run on Internet Information Services ﴾IIS﴿.


.NET Framework Class Library

The .NET Framework class library is a library of classes, interfaces, and value types that provide access to system functionality. It is the foundation on which .NET Framework applications, components, and controls are built. The namespaces and namespace categories in the class library are listed in the following table and documented in detail in this reference. The namespaces and categories are listed by usage, with the most frequently used namespaces appearing first.


Namespaces

System
The System namespace contains fundamental classes and base classes that define commonly used
value and reference data types, events and event handlers, interfaces, attributes, and processing exceptions.

System.Activities
The System.Activities namespaces contain all the classes necessary to create and work with activities in Window Workflow Foundation.

System.AddIn 
The System.AddIn namespaces contain types used to identify, register, activate, and control addins, and to allow add‐ins to communicate with a host application.

System.CodeDom
The System.CodeDom namespaces contain classes that represent the elements of a source code document and that support the generation and compilation of source code in supported programming languages.

System.Collections
The System.Collections namespaces contain types that define various standard, specialized, and generic collection objects.

System.ComponentModel
The System.ComponentModel namespaces contain types that implement the run‐time and design‐time behavior of components and controls. Child namespaces support the Managed Extensibility Framework ﴾MEF﴿, provide attribute classes that define metadata for ASP.NET Dynamic Data controls, and contain types that let you define the design‐time behavior of components and their user interfaces.

System.Configuration
The System.Configuration namespaces contain types for handling configuration data, such as data in machine or application configuration files. Child namespaces contain types that are used to configure an assembly, to write custom installers for components, and to support a pluggable model for adding functionality to, or removing functionality from, both client and server applications.

System.Data 
The System.Data namespaces contain classes for accessing and managing data from diversesources. The top‐level namespace and a number of the child namespaces together form the ADO.NET architecture and ADO.NET data providers. For example, providers are available for SQL Server, Oracle, ODBC, and OleDB. Other child namespaces contain classes used by the ADO.NET Entity Data Model ﴾EDM﴿ and by WCF Data Services.

System.Deployment
The System.Deployment namespaces contain types that support deployment of ClickOnce applications.

System.Device.Location
The System.Device.Location namespace allows application developers to easily access the computer's location by using a single API. Location information may come from multiple providers, such as GPS, Wi‐Fi triangulation, and cell phone tower triangulation. The System.Device.Location classes provide a single API to encapsulate the multiple location providers on a computer and support seamless prioritization and transitioning between them. As a result, application developers who use this API do not need to tailor applications to specific hardware configurations.

System.Diagnostics
The System.Diagnostics namespaces contain types that enable you to interact with system processes, event logs, and performance counters. Child namespaces contain types to interact with code analysis tools, to support contracts, to extend design‐time support for application monitoring and instrumentation, to log event data using the Event Tracing for Windows ﴾ETW﴿ tracing subsystem, to read to and write from event logs and collect performance data, and to read and write debug symbol information.

System.DirectoryServices
The System.DirectoryServices namespaces contain types that provide access to Active Directory from managed code.

System.Drawing
The System.Drawing parent namespace contains types that support basic GDI+ graphics functionality. Child namespaces support advanced two‐dimensional and vector graphics functionality, advanced imaging functionality, and print‐related and typographical services. A child namespace also contains types that extend design‐time user‐interface logic and drawing.

System.Dynamic
The System.Dynamic namespace provides classes and interfaces that support Dynamic Language Runtime.

System.EnterpriseServices
The System.EnterpriseServices namespaces contain types that define the COM+ services architecture, which provides an infrastructure for enterprise applications. A child namespace supports Compensating Resource Manager (CRM), a COM+ service that enables non‐transactional objects to be included in Microsoft Distributed Transaction Coordinator ﴾DTC﴿ transactions. Child namespaces are described briefly in the following table and documented in detail in this reference.

System.Globalization
The System.Globalization namespace contains classes that define culture‐related information, including language, country/region, calendars in use, format patterns for dates, currency, and numbers, and sort order for strings. These classes are useful for writing globalized (internationalized) applications. Classes such as StringInfo and TextInfo provide advanced globalization functionalities, including surrogate support and text element processing.


System.IO 
The System.IO namespaces contain types that support input and output, including the ability to read and write data to streams either synchronously or asynchronously, to compress data in streams, to create and use isolated stores, to map files to an application's logical address space, to store multiple data objects in a single container, to communicate using anonymous or named pipes, to implement custom logging, and to handle the flow of data to and from serial ports.

System.Linq 
The System.Linq namespaces contain types that support queries that use Language‐Integrated

Query (LINQ)
This includes types that represent queries as objects in expression trees.

System.Management
The System.Management namespaces contain types that provide access to management information and management events about the system, devices, and applications instrumented to the Windows Management Instrumentation ﴾WMI﴿ infrastructure. These namespaces also contain types necessary for instrumenting applications so that they expose their management information and events through WMI to potential customers.

System.Media 
The System.Media namespace contains classes for playing sound files and accessing sounds provided by the system.

System.Messaging
The System.Messaging namespaces contain types that enable you to connect to, monitor, and administer message queues on the network and to send, receive, or peek messages. A child namespace contains classes that can be used to extend design‐time support for messaging classes.

System.Net 
The System.Net namespaces contain classes that provide a simple programming interface for a number of network protocols, programmatically access and update configuration settings for the System.Net namespaces, define cache policies for web resources, compose and send e‐mail, represent Multipurpose Internet Mail Exchange ﴾MIME﴿ headers, access network traffic data and network address information, and access peer‐to‐peer networking functionality. Additional child namespaces provide a managed implementation of the Windows Sockets ﴾Winsock﴿ interface and provide access to network streams for secure communications between hosts.

System.Numerics
The System.Numerics namespace contains numeric types that complement the numeric primitives, such as Byte, Double, and Int32, that are defined by the .NET Framework.

System.Printing
The System.Printing namespaces contain types that support printing, that provide access to the properties of print system objects and enable rapid copying of their property settings to another object of the same type, and that support the interconversion of managed System.PrintTicket objects and unmanaged GDI DEVMODE structures.

System.Reflection
The System.Reflection namespaces contain types that provide a managed view of loaded types, methods, and fields, and that can dynamically create and invoke types. A child namespace contains types that enable a compiler or other tool to emit metadata and Microsoft intermediate language (MSIL)

System.Resources
The System.Resources namespaces contain types that enable developers to create, store, and manage an application's culture‐specific resources.

System.Runtime
The System.Runtime namespaces contain types that support an application's interaction with the common language runtime, and types that enable features such as application data caching, advanced exception handling, application activation within application domains, COM interop,
distributed applications, serialization and deserialization, and versioning.

Advanced Reading for the .NET Framework.




Dynamic Programming in the .NET Framework

Provides information about reflection, reflection emit, the dynamic language runtime ﴾DLR﴿, dynamic source code generation and compilation, and the Code Document Object Model (CodeDOM).

Add‐ins and Extensibility
Provides information about using the add‐in model for extensible applications.

Managed Extensibility Framework (MEF)

Describes the basics of using the Managed Extensibility Framework ﴾MEF﴿ to enable extensible applications.

Interoperability

Describes services provided by the .NET Framework for interaction with COM components, COM+ services, external type libraries, and many operating system services.

Memory Management and Garbage Collection in the .NET Framework

Discusses how the garbage collector manages memory and how you can program to use memory more efficiently.

Unmanaged API Reference

Includes information on unmanaged APIs that can be used by managed‐code‐related applications, such as runtime hosts, compilers, disassemblers, obfuscators, debuggers, and profilers.

XAML Services
Discusses System.XAML, which is an assembly that implements XAML services for the .NET Framework.

Wednesday, 2 March 2016

.NET Back to Basics: The String Class

Last month, we went back to basics with the Int class. This month, we look at the textual equivalent, the string class.
The String & Int data types, single-handed, are the two most used data in the .NET platform. Between them, they handle about 90% of all the data we use.
Strings are nothing complex; they are just simple sequences of characters that make up words and sentences. The string class exists to allow us to chop up these sentences, replace parts of them, search them, and a whole bunch of other things that make handling strings of text easier for us as developers.



So, what can a string do?
The string class has a phenomenal amount of functionality in it, all of which is grouped into about three categories as follows:

  • String tests
  • Searching
  • String modification and building

We'll start with "String Tests."
When we talk about string tests, we are in fact talking about checking to see if a string is present, or if that string has a certain sub string contained within it.
Many developers will instantly recognize that, in this case, an appropriate test would be:

if (myname == "shawty") { }

String, like most classes that are also basic data types, implements the equality operator, allowing you to perform simple straight-forward tests like this inline in your application code.
There is, however, a number of useful specialist tests too. Consider this fragment of code:

if (myname == "" && myname == null) { }

In language terms, we are saying, IF the variable myname has no contents, that is it is empty and if it is null, that is devoid of any value, then consider our decision logic to be true.
The string class makes this much easier with a static method called 'IsNullOrEmpty'

if (String.IsNullOrEmpty(myname)) { }

To me, the string method version reads much better, and makes better sense from a syntax point of view because the name of the expression tells you the exact test you're performing.
Other tests are usually performed as an extension to the string itself. For example 'contains':

string myname = "shawty";
 if (myname.Contains("shaw")) { }

Will pass, because 'shawty' does contain 'shaw'.

      string myname = "shawty";
      if (myname.Contains("peter")) { }

will, however, fail. Rather than looking in the string, if you're looking for prefixes or suffixes, 'StartsWith' and 'EndsWith' have your back covered.

      string myname = "Mr Peter Shaw";
      if (myname.StartsWith("Mr") &&
         myname.EndsWith("Shaw")) { }

will become true if the first two characters are equal to "Mr" AND the last four are equal to "Shaw" but won't care about any of the other contents in the string. It's also a point to note that the test IS case sensitive, so "Mr" will never match "mr." I soon will show you a way to deal with this, however.
All of these tests can also be negated, so to test if a string does NOT start with "Mr" it's as simple as prefixing the method call with an exclamation mark.

      string myname = "Mr Peter Shaw";
      if (!myname.StartsWith("Mr")) { }

 

Copyright @ 2013 DotNet.