Implement Windows Azure Websites from Web matrix 3 installed from Windows Azure Management Portal


Recently it has been announced the availability of Web matrix 3 as mentioned  here. You can now install Web matrix in order to work on Windows Azure Websites from Windows Azure Management Portal itself as shown.

azurewebmatrix

  • If  click on Webmatrix icon , you would be forwarded to following dialog.

installingterms

  • Lets install the Web matrix tool in order to start coding on Azure websites.

AppRun

  • After installing , lets start coding with latest interface & run directly the app with Azure website URL(*.azurewebsites.net).
  • You can sign in directly using your Microsoft Account or Org id in order to run your app on Windows Azure from Web matrix 3.

Signin

  • Once you sign in , you are good to go to work on code on Windows Azure websites as followed.

webmatrix_az

  • Even you can run the application from Remote server as configured from Web matrix 3 settings.

Resources of Best Troubleshooting Tools for IIS 8, ASP.NET 4.5 & Windows Server 2012


For diagnosing troubleshooting cases for IIS 8 , there are specifically built in support for following three types of issues:

1. IIS Specific error (viz: HTTP Error 500.19)

2. Hang/time-out issues.

3. Resource – intensive issues.

1. Specific Errors: These are the errors that usually fail quickly & will show an HTTP error page corresponding to the error. Specific errors are easier for troubleshooting as the error message will immediately narrow down the issue details & can be easily reproduced over the time.

2. Hang/Time-out Issues:  The error would often simply say that there was a time-out, without giving any clues as to the cause. With IIS 8.0, troubleshooting hang & time out issues can be solved out by Failed Request Tracing and Runtime Status & Control (RSCA)

3. Resource-Intensive & Slowness Issues:  This can cause server’s CPU to spike, excessive disk usage, high memory pressure, utilizing almost any resources. Windows Task Manager, Process Explorer , Process Monitor are the excellent tools in order to solve this type of issues.

  • Failed Request Tracing:

Failed Request Tracing is the most useful feature in IIS 8.0 which enables to get the gain the details of information about any page request and to be able to capture data data based on the criteria that you define. With Failed Request Tracing, troubleshooting can be done at any time without downtime, with intangible performance overhead on the server . FREB logs on enabling trace rules are stored on disk in as easy to read XML format.

Tracing

TraceRules

  • Specify the Trace Providers.

Verbosity

WWWServer

  • The best way to  view the FREB logs is to open the logs in IE to get the log details in XML format.
  • ASP.NET Tracing :  ASP.NET Tracing can be enabled in several ways, the most straight forward way is to do this as <%@ Page Trace=”true” %>
  • This will enable it at page level & will  append the trace input to the bottom of the page. Alternatively you can set it through in web.config as <trace /> attribute.

    <system.web>

<trace enabled =”true” pageOutput = “true” localOnly = “true” />

</system.web>

LogParser.exe “SELECT * FROM SYSTEM WHERE EVENTTYPE = 1 ORDER BY TIMEWRITTEN DESC”

  • DelegConfig: DelegConfig helps to troubleshoot the authentication issues on production servers specially where Kerberos, delegating credentials are main concerns.

you can download the extension from here

  •    Process Explorer : Process Explorer is a tool which helps to dig into the issue based on process IDs, thread based way. Where Task Manager stops , Process Explorer starts to find the internal views of the concerned process regarding the CPU affinity, Performance Graphs, GPU Graphs etc.

Process

  • Process Monitor: One of the best troubleshooting tool from Sysinternals, which helps to dig into the issues like Access Denied errors in IIS, adding filters , process highlights, Thread affinity graphs.

Procmon

  • Debug Diagnostic Tool : The debug Diagnostic Tools is still supported in troubleshooting cases of IIS 8 & Windows Server 2012. The tool is used to for troubleshooting hangs, slow performance of production ASP.NET websites, w3wp.exe worker process crashes & COM+ debugging.
  • Creating Memory Dump :  For creating Memory Leak issues of Windows Desktop / Windows Store applications , debugdiag is an ideal tool which injects the Leak Track DLL (LeakTrack.dll) into the process. Attaching the .dll & leave it for several hours helps to find the memory leakage issues by taking proper memory dump. It also helps to create Full Userdump, Mini UserDump, Create UserDump Series, dubugging Crash & slow performance issues.

you can download DebugDiag tool from here

DebugDiag

IISDump

  • Specify the Dump type as Full User Dump or Mini Dump.

Dump

  • Select location of the Dump file

dumps

Debugdiagdump

 

  • ProcDump : ProcDump is a Command Line tool used to capture memory dumps that can be analysed using WinDbg or DebugDiag. ProcDump is specially useful in case of capturing memory dump of w3wp.exe worker process  for slow unresponsive production website or hanging issue. you can download ProcDump from here
  • WinDbg: WinDbg is a tool used to analyse memory dumps. WinDbg provides commands & GUI interface to examine memory dumps of processes running in Kernel, user mode, System Registry, managed code hangings of w3wp worker processes. you can download the tool from here .

 

REST Services for Mobile ASP.NET MVC 4 with Code-First Entity Framework & Web API with SQL Azure on Visual Studio 2012 Ultimate


REST based services are quite easier to access via ASP.NET MVC 4 Mobile Web applications with Web API framework. With REST , each object can be uniquely identified & accessed via Code Access URL with its own Routing logic & behaviour. To implement a REST services for Mobile ASP.NET MVC 4 application with Web API & entity framework , lets start by creating a new ASP.NET MVC 4 web applivation from VS 2012 Ultimate.

  • Select the Project type as Internet Application by default.

  • Delete the default Model  folders file & create a new class & name it as Contacts.cs. Add the following code into it.

using  System;

using  System.Collections.Generic;

using  System.Linq;

using System.Web;

using System.Globalization;

namespace  ContactsApp.Models

{

public class Contact

{

public int ContactId { get; set; }

public string Name { get; set; }

public string Address { get; set; }

public string City { get; set; }

public string State { get; set; }

public string Zip { get; set; }

public string Email { get; set; }

public string Twitter { get; set; }

public string Self

{

get

{

returnstring.Format(CultureInfo.CurrentCulture,“api/contacts/{0}”, this.ContactId);

}

set { }

}

}

}

  • Delete the default controllers & Build thee solution & create a new Controller by selecting the Contact Model class.

  • Now select Tools -> Library Extension Manager -> Package Manager Console & paste the following commands.

enable-migrations

 add-migration Initial

Now , select the Configuration.cs file from Migrations folder & paste the following code.

namespace

ContactsApp.Migrations

{

using System;

using System.Data.Entity;

using System.Data.Entity.Migrations;

using System.Linq;

using ContactsApp.Models;

internalsealedclassConfiguration : DbMigrationsConfiguration<ContactsApp.Models.ContactsAppContext>

{

public Configuration()

{

AutomaticMigrationsEnabled = false;

}

protected override void Seed(ContactsApp.Models.ContactsAppContext context)

{

context.Contacts.AddOrUpdate(p => p.Name, new Contact

{

Name = “Debra Johnson”,

Address = “1234 Main St”,

City = “Redmond”,

State = “WA”,

Zip = “10999”,

Email = “debra@example.com”,

Twitter = “debra_example”

},

new Contact

{

Name = “Thorsten Weinrich”,

Address = “5678 1st Avenew W”,

City = “Redmond”,

State = “WA”,

Zip = “10999”,

Email = “thorsten@example.com”,

Twitter = “thorsten_example”

},

new Contact

{

Name = “Yuhong Li”,

Address = “9012 State St”,

City = “Redmond”,

State = “WA”,

Zip = “10999”,

Email = “yuhong@example.com”,

Twitter = “yuhong_example”

},

new Contact { Name = “Jon Orton”, Address = “3456 Maple St”, City = “Redmond”, State = “WA”, Zip = “10999”, Email = “jon@example.com”, Twitter = “jon_example” },

newContact { Name = “Diliana Alexieva-Bosseva”, Address = “7890 2nd Street E”, City = “Redmond”, State = “WA”, Zip = “10999”, Email = “diliana@example.com”, Twitter = “diliana_example” }

);

}

}

}

  • In the package-Manager console , enter the following code :

update-database

Build the solution & add the following code in index.cshtml :

@model IEnumerable<ContactsApp.Models.Contact>

@{

ViewBag.Title = “Home”;

}

@section Scripts {

@ Scripts.Render(“~/bundles/knockout”)

<script type=”text/javascript”>

function ContactsViewModel() {

var self = this;

self.contacts = ko.observableArray([]);

self.addContact =

function () {

$.post(“api/contacts”,

$( “#addContact”).serialize(),

function (value) {

self.contacts.push(value);

},

“json”);

}

self.removeContact = function (contact) {

$.ajax({

type: “DELETE”,

url: contact.self,

success:

function () {

self.contacts.remove(contact);

}

});

}

$.getJSON( “api/contacts”, function (data) {

self.contacts(data);

});

}

ko.applyBindings(new ContactsViewModel());

</script>

}

<ul id=”contacts”data-bind=”foreach:contacts”>

<li class=”ui-widget-content ui-corner-all”>

<h1 data-bind=”text:Name”class=”ui-widget-header”></h1>

<div><spandata-bind=”text:$data.Address ||      ‘Address?'”></span></div>

<div>

<span data-bind=”text:$data.City || ‘City?'”></span>

<span data-bind=”text:$data.State || ‘State?'”></span>

<span data-bind=”text:$data.Zip || ‘Zip'”></span>

</div>

<div data-bind=”if:$data.Email”><adata-bind=”attr:{href:  ‘mailto:’+Email},text:Email”></a></div>

<div data-bind=”ifnot:$data.Email”><span>Email?</span></div>

<div data-bind=”if:$data.Twitter”><adata-bind=”attr:{href:     ‘http://twitter.com/&#8217; +Twitter},text:’@@’+Twitter”></a></div>

<div data-bind=”ifnot:$data.Twitter”><span>Twitter?</span></div>

<p><a data-bind=”attr:{href:Self},click:$root.removeContact”

class=”removeContact ui-state-default ui-corner-all”>Remove</a></p>

</li>

</

ul>

<form id=”addContact”data-bind=”submit:addContact”>

<fieldset>

<legend>Add New Contact</legend>

<ol>

<li>

<label for=”Name”>Name</label>

<input type=”text”name=”Name”/>

</li>

<li>

<label for=”Address”>Address</label>

<input type=”text”  name=”Address”/>

</li>

<li>

<label for=”City”>City</label>

<input type=”text”name=”City”/>

</li>

<li>

<label for=”State”>State</label>

<input type=”text”name=”State”/>

</li>

<li>

<label for=”Zip”>Zip</label>

<input type=”text”name=”Zip”/>

</li>

<li>

<label for=”Email”>E-mail</label>

<input type=”text” name=”Email”/>

</li>

<li>

<label for=”Twitter”>Twitter</label>

<input type=”text”name=”Twitter”/>

</li>

</ol>

<input type=”submit”value=”Add”/>

</fieldset>

</form>

  • Render the View on IE 10 & Check the script & view on iPhone & BlackBerry browsers.

Develop DICOM Image Viewer app for Android integrated in ASP.NET 4.0 Mobile build in JQuery Mobile, HTML5,& CSS3 Media Queries


While working with HealthCare domain based customers , felt one application is going to be inevitable for EMR Mobile based apps -DICOM Medical Image Viewer for smartphones. For that lets have integrate Android native app Droid Dicom Viewer with your Mobile Medical ASP.NET 4.0 website build with HTML5, JQuery Mobile, PhoneGap,CSS3 media queries.

  • In order to open the .apk file & DICOM Image files(.dcm) from Mobile ASP.NET website, you need to set the MIME Maps for .apk & .dcm files in IIS 7.

  • Lets start download the first DICOM Files downloader .apk which helps to download the Medical DICOM Image files(.dcm) from the remote server.

  • Lets have install the Droid Dicom Viewer & DICOM files downloader .apk on Android 4.0.3 emulator.

  • Proceed to complete installation of the DICOM file downloader .apk to start download .dcm files from remote server.

  • Lets install the Droid DICOM Image Viewer from Mobile asp.net site in Android 4.0.3 emulator.

  • Lets load the DICOM Image File (.dcm) in Droid DICOM Image Viewer .apk in Android 4.0.3 emulator.

  • Lets find your DICOM Image File on SD Card of your droid .apk & start viewing the DICOM Image on viewer in Android 4.0.3 (API 15) platform.

Build Cross-Platform Mobile Web+Native apps with Application Craft+PhoneGap platform in HTML5,CSS3 framework


Application Craft is one of the sophisticated cross-platform tool used to build Web App + PhoneGap combined apps for smart devices. The Application Craft is web app which runs in cross -platform(windows,Linux, Mac OS X) compatible with Chrome, Safari, Firefox. To start building apps with Application Craft , lets first sign up @ http://www.applicationcraft.com/

Lets create Mobile App from your developer site & start building apps. You have option either to design & code & put the PhoneGap controls.

  • Keep controls drag & drop & build apps for cross-platform mobile tools.

  • put the app in Live Preview & check in Smart Phone emulators.

A Lap around ASP.NET MVC 4 Beta(Web API) for Mobile in VS 11 Beta Ultimate on Windows 8 Consumer Preview


While releaseing the concept of Windows 8 Developer Preview, the architecture & features of .NET framework 4.5 & ASP.NET 4.5 has already focused. With VS 11 Beta ultimate , the concept of asynchronus programming in ASP.NET 4.5 has started with its Asynchronus HTTP Request/Response paradigm. Now to start programming in MVC 4 beta for Mobile , you will have immense & inbuilt support of JQuery Mobile(JQuery.mobile.js , jquery.css files), HTML5 adaptive markups & CSS 3 media queries. To enable Mobile MVC 4 Web programming for fancy, VS 11 Beta includes inbuilt Page inspector support to examine the markup details, JScript rendering, CSS 3 style queries.

  • Next, to build up a MVC 4 Beta web project for ASP.NET 4.5 , create a new project from templates in VS 11 beta ultimate.

  • Select the Mobile Web from the selected templates & choose Razor /ASPX View according to  your selection.

  • Create the default project & examine the new file created called Packages.Config  which a inbuilt VS file containing all the .dll settings details along with their original version information installed in GAC of .NET 4.5.

  • Next , check the MVC 4 Web in IE10 with advanced JQuery , HTML 5 & CSS 3 media queries support.

  • Open the .cshtml pages in Page Inspector which is inbuilt with VS 11 beta Ultimate to examine the HTML5, CSS 3 styles  , javascript debugging features.

  • Enable the Page Inspector settings & check the live preview of your Web in Visual Studio 11 Beta  .

  • Now, the publish the Web in IIS 7.5 Express. Note though Windows 8 Consumer Preview has IIS 8 support but VS 11 Beta still works with IIS 7.5 express as local IIS. So deploy MVC 4 beta website in IIS 7.5 express via web deploy.

  • Now , check the MVC 4 Web URL in iOS 5 devices & check ASP.NET MVC 4 Web API Mobile web appearence.

 

2011 in review of My Blog… Stats Report


The WordPress.com stats helper monkeys prepared a 2011 annual report for this blog.

Here’s an excerpt:

A San Francisco cable car holds 60 people. This blog was viewed about 1,800 times in 2011. If it were a cable car, it would take about 30 trips to carry that many people.

Click here to see the complete report.

Building ASP.NET MVC 4 application with JQuery Mobile, HTML5 , CSS3 Media Queries in Visual Studio 2011 Developers Preview


Developing MVC 4 applications with Visual Studio 2011 Developers Preview is quite jump-start for developers as it has inbuilt support for JQuery Mobile css & javascripts, nice intellisense for HTML 5 , CSS 3 media queries. MVC 4 developers preview was built keeping in mind the Mobile Web Developers who wants keen support of rich MVC in Mobile Web.

  • Lets jump start to develop MVC 4 mobile application with JQuery Mobile, HTML5, CSS3 in VS 2011 developers preview.

  • Select your MVC 4 application domain either Internet/Intranet/Mobile Web application  with default Razor or ASPX syntaxes. For my demo , selected Mobile Web application in VS 2011 Developer Preview.

  • Next, write some JQuery Mobile application code to check th UI view in SmartPhones while Model & Controller logic remains same & could change according to business requirements.
  • Database -> Entity Framework (EF) -> Model in MVC 4(Entities) (DAL)-> Controllers (Business Logic Layer)(BLL) -> View(s) -> Master(_Layout.cshtml) is the default development path in MVC 4 Web & mobile application.
  • Sample code for JQuery Mobile with HTML5 for MVC 4 in VS 2011:

@{

ViewBag.Title = “Navigation”;

Layout = “~/Views/Shared/_Layout.cshtml”;

}

<h2>Navigation</h2>

<section id=”page1″data-role=”page”>

<header data-role=”header”>

<h1>JQuery Mobile with ASP.NET MVC 4</h1>

<nav data-role=”navbar”>

<ul>

<li><a href=”#”class=”ui-btn-active”>First</a></li>

<li><a href=”#”>Second</a></li>

<li><a href=”#”>Third</a></li>

<li><a href=”#”>Fourth</a></li>

<li><a href=”#”>Fifth</a></li>

</ul>

</nav>

</header>

<div class=”content”data-role=”content”>

<h3>Sample MVC 4 HTML 5 JQuery Mobile</h3>

</div>

<footer data-role=”footer”>

<h3>Footer</h3>

</footer>

</section>

  • Next , Check the nice intellisense support for HTML5 , JQuery Mobile in Visual Studio 2011 Developer Preview.

  • Check out the MVC 4 Mobile Web applications with JQuery Mobile , HTML5 , CSS 3 media queries in Smart Devices.
  •  iPhone & iPad:

 

  • iPhone:

  • JQuery Mobile View in iPhone of MVC 4 Mobile application:

  • View in Windows Phone 7.1 Mango:

  • BlackBerry 9800:

ASP.NET MVC Razor Template with JQuery Mobile Web for Android, Windows Phone , BlackBerry


ASP.NET MVC 3 Razor applications with JQuery Mobile is pretty straightforward for developing rich web for mobile. This article demonstrates to build asp.net mvc 3 Razor applications with JQuery , HTML 5 & CSS 3 templates running in smartphones . Build an application for ASP.NET MVC Razor application in Visual Studio 2010 & add the following JQuery template in _layout.cshtml:

<!DOCTYPEhtml>

<html>

<head>

<title>@ViewBag.Title</title>

<meta name=”apple-mobile-web-app-capable”content=”yes”/>

<meta name=”viewport”content=”width=device-width; initial-scale=1.0″/>

<link rel=”stylesheet”href=”@Url.Content(http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css&#8221;)”/>

<scripttype=”text/javascript”src=”@Url.Content(http://code.jquery.com/jquery-1.5.2.min.js&#8221;)”></script>

<scripttype=”text/javascript”src=”@Url.Content(http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js&#8221;)”></script>

</head>

<body>

@RenderBody()

</body>

</html>

Next , Put the code in Index.cshtml for SmartPhone View:

@model IEnumerable<MVC3_JQueryMobile.Models.HMS_000ITEM>

@{

ViewBag.Title = “Index”;

Layout = “~/Views/Shared/_Layout.cshtml”;

}

<div data-role=”page”>

<div data-role=”header”>

<h1> Health Record </h1>

</div>

<div data-role=”content”> 

<ul data-role=”listview”>

<li>@Html.ActionLink(“Patients Record”, “Index”, “Home”)</li>

<li>@Html.ActionLink(“Daily Health Record”, “Index”, “Category”)</li>                   

<li>@Html.ActionLink(“View Report”, “Index”, “Expense”)</li>

</ul>

</div>

<div data-role=”footer”>     

<nav data-role=”navbar”>

<ul>

<li><ahref=”#”class=”ui-btn-active”>Patient Details</a></li>

<li><ahref=”#”>Report Chart</a></li>

<li><ahref=”#”>Contact Us</a></li>

</ul>

</nav>

</div>

Check out the output in Android & Windows Phone 7.1 & BlackBerry 9800:

  •    Check in BlackBerry 9800 Browser :

  • Testing Website in Internet Explorer 9 for Windows Phone 7.1 Mango :

ASP.NET MVC 4 with Windows Azure for Windows Phone 7, BlackBerry, Android & i-Os.


Though MVC 4 is still in developer preview , not released in RTM phase but there is cool staff of development of ASP.NET MVC 4 applications for desktop & Mobile with Windows Azure environment.

Since it’s always been a great experience with working of MVC with Windows Azure of rich web experiences in Cloud. So , Lets a Windows Azure application targeted for Mobile Smart devices (Windows Phone 7, BlackBerry 7 , i-Os, Android ) & deploy in Azure of Microsoft Data Centeres.

  • Let’s Create a new Windows Azure Application from Visual Studio & do not add any webrole to it as we will add our ASP.NET MVC 4 webrole with it . (P.S:  Those  who have already MVC4 Webrole Template installed in Windows Azure environment of Visual Studio , can go & take a MVC 4 Web Role Template).
  • For those who dont have MVC 4 WebRole Template for Windows Azure environment for Visual Studio can simply create the blank Azure Project as we will add ASP.NET MVC 4 web application project later.

  •  Check out the  WebRole sections, Click OK as we dont need to take WebRole from default WebRole options.

  •  Next , Check out the Blank Azure Project created in your Visual Studio solution with ServiceConfiguration.cscfg & ServiceDefinition.csdef files.
  • Now , Time to add a new ASP.NET MVC 4 Project from Visual Studio , so on the solution explorer right click the solution -> add -> new project -> choose New ASP.NET MVC 4 Web Application.

  • Next , Add the ASP.NET MVApplication C 4 application with Windows Azure Project . To do this , right click on Roles of your Windows Azure project & select Web Role Project in Solution . Redirect to Associate Web Role Project in Solution Window  & Click OK.

        Check the ASP.NET MVC 4 web application has been added as webrole in Windows Azure Roles.

    • Click OK to add the existing MVC 4 solution with Windows Azure Application.
  •  Now it’s time to run the Windows Azure Project with ASP.NET MVC 4 in development fabric. So hit F5.

  •  Now time to test the application in Mobile Devices so , test in Windows Phone as this asp.net MVC 4 web application project has been enabled for Mobile apps.

  •  Associate Page View 

  •  Now , Test it in Android 2.2 & Android 3 Tablet device.

  •  Android 3.0 Tablet View for ASP.NET MVC 4 Windows Azure Application.

  •  Run it on BlackBerry OS of BlackBerry 9800 device.

  •  So the Windows Azure Application with ASP.NET MVC 4 for mobile is ready for development fabric , so deploy it Azure VM & run it from cloud to mobile.