Dharmesh Sharma

All Development

Languages features in C# 6 and VB 14

  • Exists: Already shipped in previous release
  • Added: Implemented for this release
  • Planned: Intended for this release
  • No: Not intended for this release
  • N/A: Not meaningful for this language

Please note that everything is still subject to change - this is a preview after all. However, we are reasonably confident about the overall feature set at this point.

Visual Studio 2015 RC has the following features. For a description of each feature see:

Feature Example C# VB Auto-property initializers public int X { get; set; } = x; Added Exists Read-only auto-properties public int Y { get; } = y; Added Added Ctor assignment to getter-only autoprops Y = 15 Added Added Static imports using static System.Console; … Write(4); Added Exists Index initializer new JObject { ["x"] = 3 } Added No Await in catch/finally try … catch { await … } finally { await … } Added No Exception filters catch(E e) when (e.Count > 5) { … } Added Exists Partial modules Partial Module M1 N/A Added Partial interfaces Partial Interface I1 Exists Added Multiline string literals "Hello<newline>World" Exists Added Year-first date literals Dim d = #2014-04-03# N/A Added Comments after implicit line continuation Dim addrs = From c in Customers ' comment N/A Added TypeOf ... IsNot ... If TypeOf x IsNot Customer Then … N/A Added Expression-bodied members public double Dist => Sqrt(X * X + Y * Y); Added No Null-conditional operators customer?.Orders?[5] Added Added String interpolation $"{p.Name} is {p.Age} years old." Added Added nameof operator string s = nameof(Console.Write); Added Added #pragma #Disable Warning BC40008 Added Added Smart name resolution N/A Added Read-write props can implement read-only interface properties Exists Added #Region inside methods Exists Added Overloads inferred from Overrides N/A Added CObj in attributes Exists Added CRef and parameter name Exists Added Extension Add in collection initializers Added Exists Improved overload resolution Added N/A

Why IIS hosted site so slow on first request?

One of the things we had to learn the "hard way" was that hosting on Microsoft IIS (in our case, 8) involved a bizarre problem. For our Web Pages, and even more noticeable, our Web APIs, the loading time for first time use was unbearable. The strange thing though, was that for subsequent use, even for other users, it went blazing fast. It took some research, but we stumbled upon the reason.

IIS operates with what they call "application pools". Application pools allow you to isolate your applications from one another, even though they are running on the same server. So if there is some critical error in one application, it won't take down the other applications. These application pools can also run in two different modes (classic and integrated) and may host different versions of the .NET framework. But why are I talking about application pools?

There is a well disguised option called Idle Time-out Action which can be changed on the advanced settings of the application pool. The time-out operation is by default set to Terminate, which means that the Windows process hosting the site will be terminated. If this termination happens, the site must be built and the process started on the next visit, resulting in a very slow first-time load.

You may be sitting there wonder why the hell this Idle Time-out Action exists. The reason that it exists is that it frees up memory and is great for those hosting several web pages with little or no "action". Or as Microsoft describes it, "Idle time-out can be helpful in the following situations":

  1.     The server has a heavy processing load.
  2.     Specific worker processes are consistently idle.
  3.     No new processing space is available.


So if you are running a dedicated server for just your service or a small number of sites, then its obviously cramping your style. Setting it to 0 is the way to go in those cases. Other argue that 1740 minutes. Why? it’s the smallest prime number (in hours) over 24...

  1. Here is "how to"-guide for changing the Idle Time-out Action to 0 on a Microsoft Windows Server 2012 R2 Datacenter using IIS 8:
  2.   Access the Internet Information Service (IIS) Manager through the Server Manager
  3.  Select the Application Pool serving your site and select Advanced Settings in the menu to the right
  4.  Locate the Idle Time-Out (minutes) option
  5. Change it to 0 and press OK
  6. And that’s it! Now your site won't be terminated and it will be fast at all times. But be advised, monitor your memory and CPU closely :)

IIS 8 and IIS 8.5 SSL Certificate Installation

SSL Certificate Installation in Microsoft IIS 8 and IIS 8.5

If you have not yet created a Certificate Signing Request (CSR) and ordered your certificate, see SSL Certificates CSR Creation :: IIS 8 and IIS 8.5.

After DigiCert issues your SSL Certificate, you will first need to install it to the server from which the certificate request was generated. Instructions for:

How to install and configure your SSL Certificate on Windows Server 2012 - IIS 8 and Windows Server 2012 R2 – IIS 8.5 (Single Certificate)

  1. Open the ZIP file containing your certificate. Save the file named your_domain_name.cer to the desktop of the web server you are securing.

  2. From the Start screen, click or search for Internet Information Services (IIS) Manager and open it.

  3. Click on the server name.

  4. From the center menu, double-click the "Server Certificates" button in the "IIS" section (it is in the middle of the menu).

  5. From the "Actions" menu (on the right), click on "Complete Certificate Request..." This will open the Complete Certificate Request wizard.
  6. Browse to your_domain_name.cer file that was provided to you by DigiCert. You will then be required to enter a friendly name. The friendly name is not part of the certificate itself, but is used by the server administrator to easily distinguish the certificate. Choose to place the new certificate in the Personal certificate store.
  7. Clicking "OK" will install the certificate to the server.

  8. Once the SSL Certificate has been successfully installed to the server, you will need to assign that certificate to the appropriate website using IIS.

  9. From the "Connections" menu in the main Internet Information Services (IIS) Manager window, select the name of the server to which the certificate was installed.

  10. Under "Sites," select the site to be secured with SSL.

  11. From the "Actions" menu (on the right), click on "Bindings..." This will open the "Site Bindings" window.

  12. In the "Site Bindings" window, click "Add..." This will open the "Add Site Binding" window. 
  13. Under "Type" choose https. The IP address should be the IP address of the site or All Unassigned, and the port over which traffic will be secured by SSL is usually 443. The "SSL Certificate" field should specify the certificate that was installed in step 7.

  14. Click "OK."

  15. Your SSL certificate is now installed, and the website configured to accept secure connections.

To enable your SSL certificate for use on other Windows servers, see our PFX export instructions for help.

How to install and configure your SSL Certificate on Windows Server 2012 - IIS 8 and Windows Server 2012 R2 - IIS 8.5 (Multiple Certificates Using SNI)

  1. Open the ZIP file containing your certificate. Save the file named your_domain_name.cer to the desktop of the web server you are securing.

  2. From the Start screen, click or search for Internet Information Services (IIS) Manager and open it.

  3. Click on the server name.

  4. From the center menu, double-click the "Server Certificates" button in the "IIS" section (it is in the middle of the menu).

  5. From the "Actions" menu (on the right), click on "Complete Certificate Request..." This will open the Complete Certificate Request wizard.

  6. Browse to your_domain_name.cer file that was provided to you by DigiCert. You will then be required to enter a friendly name. The friendly name is not part of the certificate itself, but is used by the server administrator to easily distinguish the certificate. Choose to place the new certificate in the Web Hosting certificate store.

  7. Clicking "OK" will install the certificate to the server.

    Note: There is a known issue in IIS 8 giving the following error: "Failed to remove the certificate" If this is the same server that you generated the CSR on then, in most cases, the certificate is actually installed. Simply cancel the dialog and press "F5" to refresh the list of server certificates. If the new certificate is now in the list, then it did install to the server, but you may want to check and make sure the certificate is in the Web Hosting certificate store. If not, you can move it there (see our How to Move Certificate to Another Certificate Store instructions) If it is not in the list, you will need to reissue your certificate using a new CSR (see our CSR creation instructions for IIS 8). After creating a new CSR, login to your DigiCert account and click the re-key button for your certificate.

  8. Once the SSL Certificate has been successfully installed to the server, you will need to assign that certificate to the appropriate website using IIS.

  9. From the "Connections" menu in the main Internet Information Services (IIS) Manager window, select the name of the server to which the certificate was installed.

  10. Under "Sites," select the site to be secured with SSL.

  11. From the "Actions" menu (on the right), click on "Bindings..." This will open the "Site Bindings" window.

  12. In the "Site Bindings" window, click "Add..." This will open the "Add Site Binding" window.

  13. Under "Type" choose https. The IP address should be the IP address of the site or All Unassigned, and the port over which traffic will be secured by SSL is usually 443. The "SSL Certificate" field should specify the certificate that was installed in step 7.

  14. Click "OK."

  15. Your first SSL certificate is now installed, and the website configured to accept secure connections.

  16. Repeat the steps for creating a CSR for your 2nd+ site.

  17. Install the certificate file as mentioned above, up through step 12.

  18. Under "Type" choose https. The IP address should be the IP address of the site or All Unassigned, and the port over which traffic will be secured by SSL is usually 443. Enter the host name you will be securing and check the box that says Require Server Name Indication. This is required for all additional sites (not required on the primary site as shown in step 13) The "SSL Certificate" field should specify the certificate that was installed in step 7 for your additional certificate.

  19. Click "OK."

  20. Your second SSL certificate is now installed, and the website configured to accept secure connections.

  21. Repeat steps sixteen through nineteen to set up any other additional sites.

SQL Data Warehouse

Industry’s first enterprise class cloud data warehouse that can grow, shrink, and pause in seconds

Historically, data warehouses require fixed combinations of storage and compute, often underutilizing expensive resources. With SQL Data Warehouse, data and compute scale independently. You can dynamically deploy, grow, shrink, and even pause compute, taking advantage of best-in-class price/performance. Additionally, SQL Data Warehouse utilizes the power and familiarity of T-SQL to easily integrate query results across relational data in your data warehouse and non-relational data in Azure blob storage. To sign up for our limited public preview, go to the Azure portal and click add new.

NASCAR and Hendrick Motorsports Accelerating Microsoft Relationship with Windows 10

Updated July 1, 2015 10:02 am - I started following NASCAR in my teens. The movie, “Days of Thunder” got me hooked. Next thing you know, I was spending my Sundays watching races. So writing this post – to announce the Windows 10/NASCAR/Hendrick Motorsports partnership  – is a dream come true for me. (Not to mention my seven year old son, who is a huge fan of Dale Earnhardt, Jr.)

It makes me proud to work with two amazing organizations: NASCAR and Hendrick Motorsports. They share one of the most passionate fan bases in the world (much like Windows) and a long, proud history. And throughout the sport, there are many People of Action moving the world forward, by doing great things, both big and small.

Hendrick Motorsports is one of the more decorated teams in the sport, and one of the standout leaders and examples of People of Action is Dale Earnhardt Jr., who has been voted NASCAR’s most popular driver 12 times by his loyal fan base! He’s also very committed to education and helping underprivileged youth realize their full potential through his foundation. And like myself, he loves his Xbox. In fact, I’ve heard that his new RV features a custom casing for his Xbox One. So I’m so proud to have Dale Jr. driving the Windows 10 logo’d #88 car at Sonoma Raceway June 28, and at Pocono Raceway Aug. 2.  In doing so, Hendrick and Dale Jr. will help us provide broader awareness of the FREE upgrade to Windows 10 that will be available  July 29.*

NASCAR 1

Just like Windows democratized personal computing, NASCAR has made a wonderful sport incredibly accessible. Fans can visit pit road, meet the drivers and hang out for the entire weekend.

Being able to get so close has always given fans a chance to see the considerable amount of technology in NASCAR at work. Where this partnership provides an upgrade for NASCAR is by providing better tools and solutions to help analyze all that data through Microsoft Azure, and render the analytics and data to make faster decisions on and off the track on Windows-powered devices. Last year, we worked with NASCAR to deliver a Windows touch enabled mobile line of business application  that was used throughout the race car inspection process across all three NASCAR series (Camping World Truck, Xfinity and Sprint Cup), which reduced inspection times by nearly half.

With Windows 10, NASCAR can run one code base for apps across all types of devices and race operations. This gives officials and NASCAR operations the freedom to move around the track to make better decisions, versus being locked down in a hauler inside, or outside, the track. In the future, our partnership will let NASCAR bring this data to its fans quicker – be it on jumbo screens at the track, on TV or on fans’ mobile devices.

For Hendrick Motorsports, it’s the same principle. The team will be able to capture and analyze terabytes of data and run simulations in Azure to make better decisions on tire wear, fuel consumption and chassis/car setups. And building Windows 10 universal apps will let the crew chief and engineers be more mobile at the track and stay connected with engineers back at the race team’s shop to make real-time decisions.

Nascar 2

I could go on and on about how excited we all are at Windows about these two partnerships.

But as you may have heard, all of us at Windows are driving hard towards the release of Windows 10 and the free upgrade* July 29th.

So I’ll leave you with the words of another legendary driver, Ricky Bobby, “it takes team work to make the dream work.”

And be sure to check out the announcement today and stories from NASCAR and Hendrick Motorsports.

* Some hardware/software requirements apply and feature availability may vary by device and market. The availability of Windows 10 upgrade for Windows Phone 8.1 devices may vary by OEM, mobile operator or carrier.  See windows.com/windows10upgrade for details.

Widnow 10 Learn these 10 core skills for Enterprise Mobility to future proof your enterprise

With a new version of Windows coming down the pipe, Microsoft have started to release information about some of the key technologies you need to know a little more about. Those technologies aren’t just key to helping your users have an amazing Windows experience though.  No matter what device they use these core skills for enterprise mobility will help all your users have a better experience.

Enterprise Mobility Management is a massive subject domain, subdivided into multiple solution domains to meet that holy grail of outcomes: maximize personal and organizational productivity while minimizing organizational risk (and minimizing personal privacy invasion). I include the section in parenthesis because it’s important, IT needs to respect user privacy to gain user trust.

Now is the time to invest in your “core skills” for enterprise mobility so you are at the center of your organization’s future, just like you were when you moved from Windows NT to Windows 2000…remember how you felt then? I felt pretty epic, it was a career highpoint for me!

So I decided to break it down into 10 core skills for Enterprise Mobility!

If you have a severe case of TL;DR you can just look at the pictures and skip to the bottom.


Identity

Identity, not device management, is where I think you want to begin your journey. Why? Well, it’s the cornerstone of being able to set up some sort of trust. So what are the top three things you need to know about identity in the modern world?

1 – Cloud-based Directory: Azure AD

You need to start out by understanding why you need to extend your directory to the cloud and this is where devices come in. Today’s devices move around a lot, they go everywhere. As a result, they connect to different types of networks and they can’t always work in the synchronous way we recognize with on-prem. Even if you think you don’t have a highly mobile environment, it probably has highly mobile characteristics: high latency, lossy network connections.

Maximize personal and organizational productivity while minimizing organizational risk (and minimizing personal privacy invasion). tweet

Azure AD is designed from the ground up to work in this environment. Also, because Azure AD was born in this new world you don’t need to wait for improvements to come along – which means you can quickly take advantage of an improvement and test it when it’s in Public Preview and move to production when the feature does. With on-prem you’d have waited a couple of years, then you’d have done the paperwork to get a change window to upgrade the domain functional level.

Not having to wait means you don’t get left behind when your organization wants to try new things!

Users aren’t the only things with identity in your organization though; each device that a user enrolls also has identity and Azure AD can automatically track that information for you, as long as you’ve enabled it to. This is a critical core skill because it helps you leverage something we will come to later: Conditional Access. But this is the foundation.

2 – Cloud Based Activity Reporting

User accounts are of course much more than just about matching a password to an identity. They are also about matching other attributes, such as where and when a person works to that identity. One of the coolest things about Azure AD is that it can learn those things about your users – don’t get me wrong, Azure AD won’t learn your users’ job functions and add that to their accounts!

Azure AD will do something increadible– it will learn what your users are doing and let you know when they do something strange. tweet

That’s why reporting is a core skill…that and the fact that your manager wants to see reports!

3 – Manage and Maintain Sync

Getting your existing users into Azure AD is the first step to setting things up correctly. Signing into Windows is something that most people are so used to doing they don’t even realize what they’re doing when they sign in. They don’t realize that being logged on means that they’ve been authenticated for a specified period (and that Windows renews it); they don’t realize that they’ve been seamlessly signed into multiple systems they use daily; file, print, email.

The first step and, therefore, one of the most critical skills is setting up and maintaining a sync relationship between your on-prem AD and Azure AD.

4 – Nurture Active Directory Federation Services

This is a super valuable core skill. Knowing how AD FS works, how to deploy, manage and troubleshoot it is a core skill for now and the future. Many organizations that use Office 365 or otherwise have connected to Azure AD use AD FS for authentication. With AD FS in place no authentication actually takes place in the cloud – you don’t need to securely synchronize password hashes – and many organizations find that comforting. Instead of Azure AD handling the sync the client is actually directed to your on-prem AD FS servers.

AD FS actually forms another massively important part of your user’s daily life though: it handles single sign on requests. When a user connects to a service that has a trust relationship with your AD FS you will be automatically allowed access if you’ve already been granted the token by another trusted broker. So, say you’ve signed into Windows, AD has issued your token. When you want to use a site secured by AD FS you pass the AD FS service the token, it trusts your AD so you get single sign on – no password prompting.

AD FS actually forms another massively important part of your user’s daily life though: it handles single sign on requests. tweet

It is possible to get lots of AD FS style functionality without AD FS by using just Azure AD but for some advanced scenarios you’ll want the extra detail of AD FS.

There are tons of other things that I’d consider core skills for enterprise mobility related to Identity, but that’s enough to get you started, let’s move onto the topic of management.

Management

Organizations need management capabilities for a multitude of reasons and topping that list now is security. Organizations want to maintain a level of security that will stop data breaches, or at least show that they exercised due diligence!

When we look at the world of management we can see that Windows is the most manageable OS on the planet and has the ability to tweak almost every characteristic remotely. While some want to get to that level of detail, not everyone does – so you need to have the skill of selecting the most appropriate level of management. Windows management using SCCM is pretty well-known, so while I think that’s a core skill it’s probably something you, like me, have internalized over the years.

As we moved into the mobile world a new, lighter, level of management more appropriate for BYOD scenarios that adapts to company owned scenarios developed.

5 – Mobile Device Management (MDM)

MDM is the ability to take a device, enroll it into management and then change settings at the device level. The ability to, for example, turn on encryption is something that most MDM platforms support. Microsoft has Intune for MDM and it supports doing exactly that on iOS, Samsung KNOX, Android and Windows Phone – anywhere that the device OS supports that management.

The core skill here is knowing how to translate the requirements for device level management into the MDM solution. For example when you want to protect your company data you might decide that you need to turn off the camera on all enrolled devices…but then you need to think how your users feel when they suddenly can’t, legitimately, take a picture of their kids. Angry is how they feel. So the core skill with Mobile Device Management is being able to translate what’s possible to what’s appropriate, and it will always vary.

6 – Mobile Application Management (MAM)

MAM is the exciting new area of Enterprise Mobility Management that involves managing at the application level. In the case of Microsoft Intune this is actually exceptionally cool because the product is the only product that works with Microsoft Office. As a result you can manage the iOS and Android applications for Word, Excel, PowerPoint, OneNote and OneDrive. All have the Microsoft Intune SDK integrated.

This SDK integration means you can group together those applications and allow each of them to only allow data egress to each other. More specifically, when managed, you can only open a document from SharePoint online in the managed Microsoft Word application and you can only save from Microsoft Word to OneDrive for Business. However, unlike other MAM solutions, you can opt to allow users to bring in data from anywhere.

Extending the scenario – you’re updating a business proposal in Word, saved on OneDrive for Business and you want to put in a pretty picture from Instagram. Fine! You can do that because we control data egress from the apps and optionally allow data ingress by default.

This is exactly the behavior users want and your core skill is knowing how to enable that.

7 – On Premises Integration

Integrating your identity is only one part of the solution. You might want to enable integration at the management level too, meaning productivity gains for you in IT, from a single console. Configuration Manager can control Microsoft Intune to give you a single pane of glass between your existing managed Windows, OSX and Linux devices and any mobile devices in Intune.

The core skill is knowing how to architect your solution to make this possible.

Content Management

As the Enterprise Mobility Management space continues to evolve and mature, content management becomes an ever more interesting area. If you want to future proof, you need to understand the core skills for enterprise mobility that relate to content management.

8 – Conditional Access Management

When you have knowledge of a user’s identity and knowledge of the state of a device, you can start to leverage that to allow conditional access to company resources. Quite literally, this core skill is about protecting your assets.

Conditional Access allows you to set up rules that do functions such as:

  • Don’t allow users in marketing access to email unless their devices are encrypted and are managed.
  • Don’t allow users in sales access to OneDrive for Business unless their devices are managed and not rooted.

Conditional Access policy can become an automatic gate-keeper for your information. tweet

9 – Rights Management

Rights management, on the other hand, is able to control what people can do with the information. RMS is the leading service in the world for this type of thing, trusted by lawyers and those who want to protect intellectual property (IP) the world over. When a file is protected with Rights Management it can be configured with rules that allow different people differing levels of access. Some can print; some can save; some can only read; and much more.

Because the rights travel with the file, either directly in the file or in the files wrapper, they will go wherever the file goes. This is great because if your users manage to avoid the system and store their files with a cloud storage provider you weren’t expecting, the information is still safe. The user is made to authenticate (to AAD, with MFA and auditing if required) each time they need access to the file – no authentication, no access. Also, the files can expire automatically after a specified period.

The core skill you need is knowing how to configure appropriate levels of rights management templates to make information protection decisions easy, or automatic, for end users.

10 – On premises integration

As always you’ll need to integrate with what you already have. In the case of Azure RMS, that means that a core skill becomes deploying new, hybrid architecture, such as the Azure RMS connector. This connector performs a “call home connection” to Azure AD and enables integration between Azure RMS and on-premises Exchange, SharePoint and file server farms.

What next?

So there you have them, my 10 core skills for Enterprise Mobility Management. If you can gain and internalize these skills you’ll get to a really successful architecture for the future and you’ll probably keep the money coming and the rent paid for a few more years. Of course you need to know how to get them…

That’s why I’ve designed this Enterprise Mobility Core Skills Jumpstart series for Microsoft Virtual Academy that I’m really excited to be the first to tell you about. Over the course of the four episodes, one each month from March to June, I’ll be taking you through the core skills for enterprise mobility that you need – LIVE!

I’m really excited by this series and joining me each month will Brad Anderson, Corporate Vice President, Enterprise Client Management and Mobility at Microsoft who’ll be explaining and showing what you can do…then myself and my far more knowledgeable co-host will break down the solution into the key skills you need to take away. Not only that but to get you started we’ll have instructor led virtual labs.

Go here, sign up – get involved.

Also tell me what you’d love me to cover in the comments below – honestly you will be helping me to target this content just for you!

Source

Advanced in OpenCart: The Architecture

If you're familiar with Model-View-Controller (MVC), then you've got a head start; otherwise, don't worry about it we'll discuss MVC architecture in our upcoming articles in thorough detail.

The OpenCart Framework is quite easy as it was designed to catch the attention of entry-level developers. OpenCart follows an easy URL Routes, like that: route=aa/bb. The "route" query string consists of at least two parts which gives instruction to framework what to load.

For example, in our above example I used aa as a first part and bb as second part. In the MVC architecture, it works like this:

First, the controller is loaded. In this case, the controller is identified by the first and second parameters in the query string. The first part of the query string identifies the directory, the second part of the query string identifies the filename of the controller (though without the relevant PHP extension).

So the above query string parameter relates to the file as given below:

(STORE ROOT DIRECTORY)/catalog/controller/aa/bb.php 

Note: Route parameter can contain the third part i.e., route=aa/bb/cc. Third part will be discussed in future articles when we look at understanding controllers.

Libraries play a very important part in OpenCart. Essentially, libraries are helper files, which are most often used when developing something. OpenCart has given pre-built libraries that could be very helpful when writing code. The general syntax of loading a library like that follows this format: $this->library_name.  Libraries can be found in system/library

For example, to programmatically log a user into the system, you can use $this->user->login($username,$password); and to log a user out of the system, you could use $this->user->logout();.

Some of the commonly used libraries:

  • cart.php which contain cart-related functions
  • image.php contains image-related functions such as like image cropping, caching, and more
  • customer.php includes customer-related functions
  • config.php is responsible for loading all of the OpenCart settings
  • user.php contains all of the administrator and user functions.

Languages can be located at catalog/language . In earlier articles, we added the French Language on our site, so inside the folder there would be the english and french folders. To more clearly understand this, we'll take a look and what's included in the english directory.

The Values that are used across many pages are stored is english.php. If you want to add a new value just follow the syntax below:

$_['language_key']='This is test';

However, the languages based on special pages are located inside the folders. For example, for error page the language file can be found at: catalog/language/english/error/not_found.php . 

Language file can be loaded into controller by using the syntax as below:

$this->language->load('error/not_found'); Then you can use the language library function "get" to fetch the language value:

$this->language->get('language_key'); 

Note: The values in the global language file english/english.php are automatically loaded and available to use without the $this->language->load method.

source