Showing posts with label Web Stack. Show all posts
Showing posts with label Web Stack. Show all posts

Saturday, May 14, 2011

Overview Microsoft Web Stack of Love

Great Presentation by Scott Hanselman

I have documented the key learning for my future reference.

Highlights of the show:

www.nuget.org – package management site

http://stats.nuget.org – shows you the stats

installing elmah using nuget

elmah – error logging modules and handlers. nuget makes installing elmah easy.

image

mvchtml5templates – package for html5 templates. Editor templates override datatypes

image

If the browser does not support datetime, then use the jquery ui to make it support datetime.

image

refer jquery.ui.all.css to format the datetime popup

image

CodeFirst

EntiryFramework supports ModelFirst, DatabaseFirst and CodeFirst

C# Class Diagram lets you visualize the code

image

IIS Express

Limitations of the Web server that comes with Visual Studio:

  1. no SSL support
  2. no port 80
  3. hard to get WCF working
  4. doesn’t feel like IIS because it is not IIS

image

Solution: use IIS express

image

image

image

image

IIS Express resides in the user My Document directory and it runs on Win XP and actually is IIS 7.5

image

How do you make your application run on port 80 with IIS Express?

In the past one port was handled by one process, when a request was received the the process with the port will process the request. Now ports are reserved by http.sys which listens on port 80. http.sys hands the request off to your process. The permits multiple processes to listen on one port. However, the port needs to be reserved. Use netsh command as follows:

image

for port 443:

netsh https add urlacl url=http://hanselman-w500:443/ user=everyone

use the netsh firewall command above to open port 80 on IISExpressWeb.

Add port 80 to the applicationhost.config file

image

Run the application

image

That’s great, but how do you configure https Port 443 for your Account Page.

Use the re-write rule in the system.web section of the web.config file to redirect to https port.

image

Great, but this will not yet work because we don’t have a certificate yet.

To create an SSL certificate:

image

image

Certificate is created

image

Copy the GUID of the certificate

image

run the command to add the ssl cert

image

add https to the applicationhost.config file

image

Now, when you run the application and go to the Accounts, it will warn you about a non-registered cert.

image

To register the cert, move the cert to “Trusted Root Certificate”

image

and voila!

image

image

Another easier way Smile is to set SSL Enabled property to true

image

WebMatrix makes adding SSL certs (https) extremely easy. WebMatrix gives you a self-signed cert for free.

image

image

Glimpse

Gives you a glimpse of what's going on in your app. Think of it as a Firebox for your MVC. Glimpse installs you using nuget.

image

Enable Glimpse for your app:

image

image

image

image

image

Tracing become so much easier

image