Visual studio feeds

All Visual Studio blogs in one place


Enter your email address:

Delivered by FeedBurner

Increase your website traffic with



Anti-spam: How many eyes has a typical person?

Follow us on FB


Swift By Tutorials is Published

AddThis Social Bookmark Button
Apple released the first public beta of the Swift programming language just over three months ago. Within days of the release myself and Matt Galloway started working on our book Swift by Tutorials, which as of yesterday is finally finished and shipping!

Using the SPImport events to control SharePoint content import

AddThis Social Bookmark Button

The SPImport class in the Microsoft.SharePoint.Deploymentnamespace participates with other classes in the Deployment namespace to support importing, publishing, and migrating Windows SharePoint content, as well as supporting restore capabilities of content.
You can initiate an import operation by first initializing an instance of the Microsoft.SharePoint.Deployment.SPImportSettingsclass with the required import settings, and then passing the SPImportSettings object to the constructor of SPImport class; you then call the SPImport.Run method. The SPImport type exposes events that can be used to control the process of import. You can utilize the event model in PowerShell to register the events and then make use of
this information to control the complete process of importing and exporting SharePoint content. Below is the PowerShell snippet to use the Error event and use the data to fail the execution process after an Import is performed.

$Global:importErrors = @()
$Global:importWarnings = @()  

     Register-ObjectEvent -InputObject $SPImport -EventName Error -SourceIdentifier Microsoft.SharePoint.Deployment.SPDeployment.Error -Action {
           $arguments = $event.SourceEventArgs
           if(($arguments.ErrorType -eq [Microsoft.SharePoint.Deployment.SPDeploymentErrorType]::Error) -or ($arguments.ErrorType -eq [Microsoft.SharePoint.Deployment.SPDeploymentErrorType]::FatalError)){
                $Global:importErrors += $arguments.ErrorMessage

           if($arguments.ErrorType -eq [Microsoft.SharePoint.Deployment.SPDeploymentErrorType]::Warning){
                $Global:importWarnings += $arguments.ErrorMessage

     } | Out-Null


     Unregister-Event -SourceIdentifier Microsoft.SharePoint.Deployment.SPDeployment.Error -ErrorAction SilentlyContinue

if($Global:importWarnings.Length -gt 0){
     Write-Warning ("SPImport generated {0} warnings...(Read whole news on source site)

#1,161 – Using Custom Circular Progress Shape in Control Template

AddThis Social Bookmark Button
In the previous example, we created a custom circular progress shape and then composed it along with a TextBlock to get a labeled circular progress control. The other approach that we could take is to just create a new control template containing our circular progress shape and a TextBlock and then use that new template as the control template for […]

Exporting and importing content types using PowerShell

AddThis Social Bookmark Button
SharePoint stores the definition schema of content types in an XML file that creates a content type in the element manifest file of a Feature. You can use the information present in the SchemaXML of a content type to migrate it between site collections using PowerShell.
Below is the screen shot of the schema definition of the Article Page content type as from the SharePoint manager application.

You can use this information to export the content type to an XML file as given below. The script expects the site collection url, group name under
which the content types should be exported and the output directory location.

param ([string]$SiteUrl = 'http://yoursiteurl',[string] $GroupName = "Your Group Name", [string]$OutPutLocation = "E:\Powershell\SharePoint")
$ErrorActionPreference = 'Stop'
If ((Get-PsSnapin |?{$_.Name -eq "Microsoft.SharePoint.PowerShell"})-eq $null)
     Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue | Out-Null
$site = Get-SPSite $SiteUrl
$web = $site.RootWeb
if([System.IO.Directory]::Exists($OutPutLocation) -ne $true)
     Write-Error "Export path " $OutPutLocation " is not valid. Make sure that the directory exists"
$fileName = [System.IO.Path]::Combine($OutPutLocation, "content-types.xml")
Write-Host "Starting content type export to $fileName" -ForegroundColor Green
if([System.IO.File]::Exists($fileName) -ne $true)
     New-Item -path $OutPutLocation -name "content-types.xml" -type File
Add-Content $fileName...(Read whole news on source site)

What is new in RavenDB 3.0: Queries improvements

AddThis Social Bookmark Button
RavenDB is an ACID database for documents, and it is a BASE database for queries. That design principle has serve us very well since the start, because it allow us to modify the way we are handling things internally without violating the promises we give to the user.  In particular, the ability to hand out potentially stale information has been crucial for a lot of performance optimizations in RavenDB. That said, while is has been a core feature of RavenDB from the start, I haven’t found a single user who had a hankering for longer staleness latency. That is
a long way to say that we managed to reduce further the number of times RavenDB will return query results marked as stale. We have talked about some of this in the previous posts, with regards to better batching and optimization in the indexing process itself, but we already talked about this. In RavenDB 3.0, we are using smarter algorithm to detect if an index has potentially changed, in particular, we can detect if the index isn’t covering any of the changed documents that it hasn’t had a chance to index yet. If we know that no document yet to...(Read whole news on source site)

The Morning Brew #1697

AddThis Social Bookmark Button
Software WinJS 3.0 is Here: Cross-browser| Cross-platform – Dr. Doris Chen highlights the first open source release of WinJS Windows now offers Developer lifetime developer accounts and benefits – Lee Stott highlights a change in the charging model for Windows Dev Center accounts, now featuring a one off fee and no renewal fees, along with […]

APress Deal of the Day 18/September/2014 - Beginning Windows 8 Application Development – XAML Edition

AddThis Social Bookmark Button
Originally posted on:’s $10 Deal of the Day from APress at  is Beginning Windows 8 Application Development – XAML Edition. “Beginning Windows 8 Application Development – XAML Edition shows you how to start building rich, immersive applications that connect people, applications, and devices with Windows 8. ”

5 Free CDNs for developers

AddThis Social Bookmark Button
CDNs are a popular way to improve a website's performance. The idea is that assets such as scripts, styles etc are loaded from domains other than your own domain. These endpoints are optimised to serve static assets and they do this well. It is common to use CDNs for popular JavaScript libraries and CSS frameworks such as bootstrap.

This is a list of some popular CDNs which are available to you for free.
Google Hosted LibrariesThis is perhaps one of the most popular CDN out there. I use it for most of my projects. You can find AngularJS, DOJO,
jQuery, jQuery UI, Prototype and few others. There is also a bit of comfort level associated with using Google's CDN. Being Google, chances of 404 are slim.
Microsoft Ajax Content Delivery NetworkAnother reliable CDN from one of the big tech companies. Their list of libraries is a bit different from Google's. At the time of this writing they do not serve AngularJS but you can find other popular libraries such as jQuery, Modernizr etc.
cdnjsList of stuff you can find on cdnjs is massive. They host close to 900 libraries....(Read whole news on source site)

Personal project for learning GitHub API

AddThis Social Bookmark Button
Couple of weeks ago on a rainy weekend I started hacking on a project to learn GitHub API. I decided to use AngularJS to interact with the API and within few hours it started to take some shape. I write a lot of throw away code which gets safely tucked in a temp directory but this I thought was a bit special. So I thought I will write a bit about it. Here it goes. I plan to refactor the code significantly as I make progress on this project. The repository for this project is on GitHub for
the world to see. Before I get into what I did, I will show you a screenshot of the running application. What you see here is repositories of Mozilla on Github. Elements on the page will become more clear as you read this post further. If you wish to run the application on your machine then clone the repository, go to the location where you cloned it and run grunt serve. You will need to have grunt-cli installed on your machine. Now I will talk a bit about how I built this application. To get...(Read whole news on source site)

Ruby - Calculate MD5 hash of a file

AddThis Social Bookmark Button
Ruby makes calculating MD5 hash easy peasy.Here I am calculating MD5 hash of a file I have.require 'digest/md5'md5 = Ditest::MD5.newdigest = md5.hexdigest('/Users/deepak/s3/coco.jpg'))puts digest # => "ed00890f2e661a94fdf046c503d0ce34"Code above can be shortened to thisrequire 'digest/md5'digest = Digest::MD5.hexdigest('/Users/deepak/s3/coco.jpg'))puts digest # => "ed00890f2e661a94fdf046c503d0ce34"It can be further shortened to this. I prefer doing it this way because the entire file is not read into memory at once but as blocks.require 'digest/md5'digest = Digest::MD5.file('/Users/deepak/s3/coco.jpg')puts digest # => #Gotta love Ruby :)