Visual studio feeds

All Visual Studio blogs in one place

Subscribe

Enter your email address:

Delivered by FeedBurner

Increase your website traffic with Attracta.com

Google+

Contact

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

Follow us on FB

Search

Using PowerShell cmdlets to create a VM in Azure resource manager

AddThis Social Bookmark Button
If you are a PowerShell fan like me, and wants to create Virtual machines and resources in an Azure resource group, you have to combine a set of PowerShell cmdlets to achieve this.
I have written a simple module which can be used in this case to create VM's in azure resource manager.

Switch-AzureMode AzureResourceManager
$ErrorActionPreference = 'Stop'

function EnsureResourceGroup
{
       [CmdletBinding()]
       param
       (
              [string] $ResourceGroupName,
              [string] $Location
       )

       Write-Information "Checking for existing resource group $($ResourceGroupName)"

       if((Get-AzureResourceGroup -Name $ResourceGroupName -ErrorAction SilentlyContinue) -eq $null)
       {
              Write-Verbose "$($ResourceGroupName) does not exist. Creating a new one at location $($Location)"
              New-AzureResourceGroup -Name
$ResourceGroupName -Location $Location
       }
       else
       {
              Write-Information "Success"
       }

       $ResourceGroupName
}

function EnsureStorageAccount
{
       [CmdletBinding()]
       param
       (
              [string] $ResourceGroupName,
              [string] $StorageAccountName
       )
      
       $resourceGroup = Get-AzureResourceGroup -Name $ResourceGroupName
       $location = $resourceGroup.Location

       Write-Information "Checking for existing storage account in resource group $($ResourceGroupName)"
       $storageAccount = Get-AzureStorageAccount -ResourceGroupName $ResourceGroupName -Name $StorageAccountName -ErrorAction SilentlyContinue

       if(($storageAccount) -eq $null)
       {
              Write-Verbose "$($StorageAccountName) does not exist. Creating a new one in resource group $($ResourceGroupName)"
              $storageAccount = New-AzureStorageAccount -ResourceGroupName $ResourceGroupName -Name $StorageAccountName -Location $location -Type Standard_LRS
       }
       else
       {
              Write-Information "Success"
       }

       $storageAccount
}

function EnsureVirtualNetwork
{
       [CmdletBinding()]
       param
       (
              [string] $VNetName,
              [string] $ResourceGroupName,
              [string] $Location
       )

Handle SQL Database Corruption like a pro!

AddThis Social Bookmark Button
Two main worries of an SQL DBA include making sure that data within the database is easily accessible to the right people and that there are no issues that pose any temporary or permanent threat to the data. While the first task revolves around assessing the performance of the database, the second task includes tackling database corruption and if possible, preventing it from occurring.

When it comes to achieving ideal SQL database performance, there are quite a few factors that should be assessed:
CPU and memory utilizationI/O bottlenecksClient CommunicationsConfigurations for operating system, storage and database installationAnd more
If all of these areas are
properly addressed, a DBA can be sure that everything is working fine performance wise. However, the “handling corruption” bit of his task is not so straightforward. It involves understanding what factors can lead up to it and how to recover from it if it happens. The subsequent sections address both these points in detail.

Database Corruption and its Causes

The technical definition of SQL database corruption is any problem within the database that causes an improper storage of the actual zeros and ones needed to store the data at the disk or IO sub-system level. In layman terms, an SQL database is...(Read whole news on source site)

Building your first end-to-end Cross Platform app – Part 2 – Windows Universal App

AddThis Social Bookmark Button
Hello and Welcome again to the second part of the series. In the Part 1, Building your first end-to-end Cross Platform app , we have learned the building the Core  Till now we have created Weather.Common, from a blank Visual Studio 2015 solution. Now ,we will be creating windows 10 universal app which can run [...]

New ASPNET5 Course Coming

AddThis Social Bookmark Button
I’m diligently working towards my new Pluralsight course and I am very excited about it. The new course is an end-to-end building of a web app using ASP.NET 5, MVC6, Entity Framework 7, Angular 1.4, and Bootstrap 3.x. This course is a bit different than other courses I’ve done because we’re releasing it before the RTM of ASP.NET 5. Because of this, I wanted to let my students know what to expect. The course will build a web app from an empty ASP.NET 5 project through to a deployed app. This mirrors my ASP.NET MVC5 course from a couple
of years ago, but is written with the new stack. The course will build a whole new project as well. This time, you’ll be building a tool for trip planning called “The World”. The course will be initially released based on ASP.NET 5 Beta 7 (expected late this month). Over the rest of the year, we’ll update it for every new drop (Beta 8, RC, and RTM if Microsoft sticks to their schedule. This new course should be available by the end of September. Cross your fingers!

How to customize Quick Actions and Notifications in #Windows 10?

AddThis Social Bookmark Button
Like Windows Phone 8.1, Microsoft also included quick actions and better notification system in Windows 10. You can customize the quick action buttons and select the favorite four from a collection of eleven action buttons. Not only this, you can also choose settings to customize the notifications. In this post of the Windows 10 Tips & Tricks series, we will go thru the settings page in order to understand the various options to customize the quick actions and notifications in Windows 10.   The Windows 10 Notifications Center consolidates and shows the notifications from apps in
a single place where you can interact with them. It also has a useful Quick Actions section at the bottom with four main action buttons which you can easily configure. If you click the Expand option, you can get the quick access to more actions. It’s good to have the four main action buttons in the Notification Center, but in case you want to change the order and customize the four main buttons, just follow the below steps. It also give you options to configure how notifications will be displayed for each and individual applications. To start with the customization, open the...(Read whole news on source site)

Do you use CodedUI for testing responsive webdesign?

AddThis Social Bookmark Button
Responsive web design has been around for quite some time. Most of the websites created nowadays are built with responsiveness as a main design consideration. But still automating responsive website testing is not adopted in software teams very well. Marcel has a nice post on how to resize the browser window to test responsive websites.

In this post, I’ll try to combine his solution with attributes to specify the view port details and then use this information to test responsive websites.


Use extensions methods to resize Window

public static class BrowserWindowExtensions
{
    [DllImport("user32.dll", SetLastError = true)]
    [return: MarshalAs(UnmanagedType.Bool)]
   
internal static extern bool SetWindowPos(IntPtr hWnd, IntPtr hwndInsertAfter, int x, int y, int cx, int cy, uint uFlags);

    public static void ResizeWindow(this BrowserWindow control, int width, int height)
    {
        SetWindowPos(control.WindowHandle, (IntPtr)(-1), 0, 0, width, height, 0x0002 | 0x0040);
    }
}

Use attributes to specify ViewPort

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
public class BrowserViewPortAttribute : Attribute
{
    public BrowserViewPortAttribute(int width, int height)
    {
        Width = width;
        Height = height;
    }

    public int Width { get; private set; }
    public int Height { get; private set; }

Home