Click that Visual Studio Notification Flag

Visual Studio wants to keep you informed of important information, such as available Visual Studio updates, license expirations, or alerts. These notifications are now available directly from within Visual Studio. Just click on the flag icon in the Visual Studio 2013 title bar.

Prior versions of Visual Studio provided the notifications in a pop-up balloon that appeared in your Windows task bar. In Visual Studio 2012, the pop-up balloon appears and disappears so quickly, it's easy to miss. And it isn't obvious how to display it again.

In Visual Studio 2013, this process was improved by moving the notification into the Visual Studio title bar. That way you can review the notifications at any time. Hover over the icon for a quick overview of the notifications. Then you can click on the notification icon to display the notification window.

The notification window contains messages and alerts. Many notifications provide a link to an action. Hovering over the link will give you the notification details. Then you can click the link to perform the action. After you've viewed a notification, it's no longer considered new.

Deborah Kurata is cofounder of InStep Technologies Inc. and has more than 15 years experience in architecting, designing and developing successful applications. The author of several books, Kurata speaks at conferences such as Visual Studio Live!, DevDays and TechEd and has been recognized with the Microsoft MVP award.

Posted by Deborah Kurata on 04/16/2015 at 2:28 PM0 comments


Disable Mobile Redirect on Your Public-Facing SharePoint Sites

Sometimes when you try to navigate to a site from a mobile device, you'll be redirected to the SharePoint mobile version of that site. The mobile view is a bit of a throwback to a bygone era. It gives you a restricted text view designed to work on older devices. Nowadays, mobile browsers are much better and you would much rather see the site rendered using responsive design.

Even worse—you might not have access to mobile pages, resulting in the authentication problems. Instead of fiddling with permissions, the best solution is to simply switch off the mobile view entirely. The easiest way to do this is to add a few lines to your web.config file. Add the following to the System.Web element following the SharePoint section that contains your SafeControls. It's normally about a third of the way down the web.config file. Here's the code to add:

<browserCaps>
  <result type="System.Web.Mobile.MobileCapabilities, 
    System.Web.Mobile, Version=2.0.0.0, Culture=neutral, 
    PublicKeyToken=b03f5f7f11d50a3a"/>
  <filter>isMobileDevice=false</filter>
</browserCaps>
  

Here's what that section of your config file should look like when you're finished:

<Action id="68c8f882-0c21-4190-9c85-ec9672bf8c16" 
  sourceFile="C:\Program Files\Common Files\Microsoft Shared\Web Server 
  Extensions\14\config\Webconfig.rs.xml" />
</MergedActions>
</SharePoint>
<system.web>
  <browserCaps>
  <result type="System.Web.Mobile.MobileCapabilities, 
     System.Web.Mobile, Version=2.0.0.0, Culture=neutral, 
     PublicKeyToken=b03f5f7f11d50a3a"/>
  <filter>isMobileDevice=false</filter>
  </browserCaps>
<securityPolicy>
<trustLevel name="WSS_Medium" 
  policyFile="C:\Program Files\Common Files\Microsoft Shared\Web Server 
  Extensions\14\config\wss_mediumtrust.config" />
<trustLevel name="WSS_Minimal"
  policyFile="C:\Program Files\Common Files\Microsoft Shared\Web Server 
  Extensions\14\config\wss_minimaltrust.config" />
</securityPolicy>
<httpHandlers />
<customErrors mode="On" />
<httpRuntime maxRequestLength="51200" />
<authentication mode="Windows" />
<identity impersonate="true" />

If you want to do this programmatically, you can use the SPWebConfigurationModification class and deploy it as a feature by adding your code to the feature receiver.

Bill Ayers is a consultant developer and software architect who has been working on SharePoint since version 2003, and is a Microsoft Certified Master and MCSM, SharePoint. He specializes in Web content management and intranet portals. He has more than 20 years' experience in the software industry, and speaks regularly at international conferences and user groups. He's also a moderator on SharePoint.StackExchange.com and blogs at SPDoctor.net.

Posted by Bill Ayers on 04/16/2015 at 2:28 PM0 comments


Remember the Parentheses on Your Knockout Observables

When you use KnockoutJS for data binding, you'll generally want to be binding to observable properties exposed from your ViewModel objects. An observable is an object declared with knockout:

{ customerName = ko.observable("");}

When you go to set that property, remember to call it as a function object with a call like:

customerName("Homer"), as opposed to customerName = "Homer"

When you get the value, you likewise call it as a function:

var name = customerName() 

This trips up even the most experienced Knockout programmers. As a result, you might want to check out either this post on Steven Sanderson's blog or this Durandal documentation page for ways to leave off the parentheses when working with observables.

Brian Noyes is the CTO of Solliance Inc. (solliance.net), a Microsoft regional director and MVP, and Pluralsight author.

Posted by Brian Noyes on 04/16/2015 at 2:28 PM0 comments


Configure Custom Domain Names in 4 Easy Steps

Microsoft Azure Web sites provide a robust and easy-to-use container for hosting your Web applications. This doesn't just pertain to ASP.NET apps, but to several templates such as Drupal, WordPress, Orchard and so on. The service also provides first-class support for Node.js Web apps/APIs, PHP and Python. If you're new to Azure Web sites, you might think, "Big deal, this is just another Web host." You would be wrong. There's a ton of value you get with Azure Web sites that blows away your commodity Web hosters:

  • The free version lets you host up to 10 sites in a multi-tenant environment and provides a great dashboard, FTP and continuous deployment capabilities including first-class support for Git (local repos) and GitHub.
  • The shared version adds support for seamlessly scaling your app up to six instances/nodes along with enabling Web Jobs that provide worker processes for executing jobs on a schedule, continuously or on-demand.
  • The standard version lets you dedicate not just instances, but full VMs to your application and supports auto-scaling your app based on metrics and triggers.

There's a lot more to Azure Web sites, whether you're a .NET, Node.js, PHP or Python developer. Learn more at the Azure Documentation page.

When you create your Azure Web site application, you get both an IP and URL. The URL takes the form of [your app].azurewebsites.net. Chances are you'll want your own domain name so that instead of [your app].azurewebsites.net, you can point to a specific address. You can do this in four simple steps.

Step 1: Ensure your site is configured for shared or standard mode. The free version doesn't support custom domains, which seems reasonable. If you started with a Web site in free mode, simply click on the Scale option and choose Shared or Standard mode and click OK.

Step 2: Copy the IP and Azure Web site URL. The next step is to make note of your URL and IP address. You'll need this for the third step in this process. Go to the list of Azure Web sites, select the site (but don't click on it) and click on the "Manage Domains" icon at the bottom of the command bar. This will bring up a dialog that includes your current domain record ([your app].azurewebsites.net) and your IP.

Step 3:Update the A Record and CNAMEs. Make a note of each and log in to your domain registrar's console. You want to look for DNS Management and either Advanced or Manage Zones or Manage DNS Zone File. You want to get to whichever console lets you configure your A Record and CNAMEs. These records allow for requests to your registered domain name to be forwarded to Azure specifically your Web site's host name. The result is your Web site will resolve to both [your app].azurewebsites.net and whatever domain you purchased.

The A record needs to point to the IP address you captured in step two. Replace whatever value is there with the IP address provided. When someone calls up your site, your registrar will authoritatively answer that request and pass it on directly to the IP address you provided. For the CNAME, there are three entries you need to make:

  • Point www to [your app].azurewebsites.net -- This tells DNS that [your app].azurewebsites.net should be the destination (canonical host) for any DNS queries that begin with www (like your site).
  • Point awwverify and awwverify.www to awwverify.[your app].azurewebsites.net -- This provides for a DNS validation mechanism so your Azure Web site can validate that your domain registrar has been configured to allow the Azure Web site to serve as a canonical domain in the event that a CNAME lookup fails. Be sure to save your file/settings.

Step 4: Enter your custom domain name in the Manage Domains dialog and check for validity. Pull up the Domain Settings for your Web site again. This time, enter your new domain name. If you want the Azure Web site to respond to both www.[yoursite].com and [yoursite].com, you'll want to create both entries. You'll likely see a red dot indicating that validation and/or CNAME lookup has failed.

This is simply the way the Azure Web site tells you records have not yet propagated. You can happily continue using your Azure Web site using the [your app].azurewebsites.net URL. When you come back to the dialog, the verification should succeed and any request for [yoursite].com should automatically resolve to your Azure Web site app.

Rick Garibay is a developer, architect, writer and speaker. He's passionate about distributed technologies and application lifecycle management and is currently a distinguished engineer at Neudesic.

Posted by Rick Garibay on 04/15/2015 at 2:28 PM0 comments


Friends Don't Let Friends Async Void

When writing asynchronous code using the Microsoft .NET Framework 4.5, it's tempting and easy to declare methods such as async void. Don't do this. You should only use async void on top-level event handlers. Instead, declare your methods as async Task. The async void methods wind up being fire-and-forget methods. That's the case even when awaited, because there's no task to actually await. Also, exceptions won't be properly propagated to your try/catch block.

Brian Peek is a senior program manager at Microsoft. Previously a Microsoft MVP in the C# discipline, Peek specializes in software development using a variety of Microsoft technologies and platforms and is also well-versed in hardware projects, graphics and game development.

Posted by Brian Peek on 04/15/2015 at 2:28 PM0 comments


Change Datacenters for Your Microsoft Azure Web Site

If you've ever created a Microsoft Azure Web site, you know how easy it is to get up and running. Given this simplicity, it's easy to get ahead of yourself and create your site without giving much thought to the datacenter where it will be hosted. For example, if the majority of your Web traffic will originate on the West coast, but you set up your site on the East coast, you'd benefit significantly by the reduced latency of moving to a datacenter closer to your users.

Another reason to change datacenters is if you're using a database or other linked resource residing in a datacenter different than that of your Web site. In this case, you'd pay for outbound bandwidth which otherwise would be free if all assets were hosted in the same datacenter. There's no easy way to make this change. It can also be problematic if you've set up a custom domain name for your site.

Fortunately, all is not lost. You can get to the same destination in just a few steps. First, create a new Web site, give it a unique name, and select the region to which you want to "move" your active site. Next, deploy your application to the new site using your preferred deployment method (such as Git, GitHub, WebDeploy, Dropbox and so on). Once you've deployed your app, test it using the URL assigned to your app.

Next, follow my simple four-step guide for assigning a custom domain to your new site. This time, replace the current A record (pointing to the IP address for your current site) in your registrar's DNS settings with the new IP address provided by Azure when you select Manage Domain for the new site. You'll also want to update the awverify, awverify.www and www key/value pairs with the new value for your assigned URL. For example, if your old site is named oldsite.azurewebsites.com, replace "oldsite" with your new site name. Follow the rest of the steps on my post for completing the set up on your new site.

As you're probably aware, DNS entries can take up to 48 hours to propagate, but often update much quicker than this. During this time, requests can bounce between your old and new site. To minimize downtime and disruption to your new site, set the TTL on your registrar's domain settings to the lowest value possible (GoDaddy is 10 minutes). After a few minutes, try stopping your old site and using your custom domain URL; see if traffic is directed to your new site. If you get a pretty looking Azure page, it means that traffic is still flowing to your old site (which is now stopped).

Restart the old site, give it some time and perform this test again. Within an hour or so, traffic should be going to your new site, as evidenced by your custom URL resolving despite your old site being stopped. If you have a highly critical production site and can't afford any downtime, you'll want to look at tools like Azure Traffic Manager to keep downtime to an absolute minimum. After it's resolved, remove your old site and enjoy your site running on your shiny new datacenter.

Rick Garibay is a developer, architect, writer and speaker. He's passionate about distributed technologies and Application Lifecycle Management.

Posted by Rick Garibay on 04/15/2015 at 2:28 PM0 comments


Using HTML5 Microdata for Better Search Engine Results

Have you ever noticed when using search engines that some of the results look much better than others? Why do some of the results have pictures and other specific information and links?

A good way to provide this additional information to search engines is using microdata, which adds extra metadata to HTML to better describe the content. A repository of some common vocabularies (schemas) is available at schema.org. The "person" schema could be used to further describe information about a blog:

<!DOCTYPE html>
<html>
<head>
  <title>Robert Boedigheimer</title>
</head>
<body>
  <section itemtype="http://schema.org/Person" itemscope>
    <h3 itemprop="name">Robert Boedigheimer</h3>

    <img src="/images/robert.jpg" width="206" height="250" itemprop="image" /><br />
    <nav>
      <a itemprop="url" href=" http://aspadvice.com/blogs/robertb/">Blog</a><br />
      <a itemprop="url" href="http://tinyurl.com/boedie-mvp">MVP Profile</a>
    </nav>
  </section>
</body>
</html>
 

The itemscope designates the area in the document where a particular schema is used. In this case it's using the http://schema.org/Person schema. The schema provides specific properties that can be attached to the content. The itemprop attribute with value of "name" indicates that this content represents the person's name. The <img> tag has added the itemprop of "image" so that search engines understand which of the various images on the page is a photo of the given person.

Adding microdata is really easy to do, and it's a great way to distinguish your products in search engine results and bring you new customers!

Posted by Robert Boedigheimer on 02/23/2015 at 2:28 PM0 comments


Control the Scope of JavaScript Declarations with IIFEs

One of the most common mistakes people make with JavaScript is polluting the global namespace with too many low-level function and variable declarations and then running into subtle bugs when one declaration stomps on another.

For example, if you declare something like var foo = "value"; in a JavaScript file that gets pulled into your HTML page through a script tag, that foo variable is now in the global namespace. You could have some other JavaScript file that also gets pulled in that also declares a foo variable, puts a different value in it, and then your code could start doing unintended things because of the value supplied by that other JavaScript file. If your foo variable is only intended to be used by other code in the same JavaScript file, there's a simple and common structure to be aware of for controlling that scope: Immediately Invoked Function Expressions (IIFEs), also sometimes referred to as automatically invoked functions, or self-invoking functions.

All you need to do is wrap the contents of your JavaScript file in the following syntax:

(function()  
// Your code  here 
})(); 

Now, any variables you declare inside that function are local variables that won't pollute the global namespace and can't be stomped on by other JavaScript files being executed in the same page or scope. Those variables can still be used by any functions declared within that "Your code here" scope through the magic of closures, so you have a nice atomic, modular approach to declaring your chunks of functionality. You'll see this as a common approach to declaring things such as modules, controllers, directives and services in Angular code, for example.

Posted by Brian Noyes on 02/23/2015 at 2:28 PM0 comments


Subscribe


Upcoming Events