Thursday, March 18, 2010

Hosting Options for WCF services


Hosting Options

a.    IIS 7 (WAS)
b.    Windows Service



Choosing a Hosting Environment
The following table summarizes some of the key benefits and scenarios associated with each of the hosting options.
Hosting Environment
Common Scenarios
Key Benefits and Limitations
Managed Application ("Self-Hosted")
·         Console applications used during development.
·         Rich WinForm and WPF client applications accessing services.
·         Flexible.
·         Easy to deploy.
·         Not an enterprise solution for services.
Windows Services (formerly known as NT services)
·         A long-running WCF service hosted outside of IIS.
·         Service process lifetime controlled by the operating system, not message-activated.
·         Supported by all versions of Windows.
·         Secure environment.
IIS 5.1, IIS 6.0
·         Running a WCF service side-by-side with ASP.NET content on the Internet using the HTTP protocol.
·         Process recycling.
·         Idle shutdown.
·         Process health monitoring.
·         Message-based activation.
·         HTTP only.
Windows Process Activation Service (WAS)
·         Running a WCF service without installing IIS on the Internet using various transport protocols.
·         IIS is not required.
·         Process recycling.
·         Idle shutdown.
·         Process health monitoring.
·         Message-based activation.
·         Works with HTTP, TCP, named pipes, and MSMQ.
IIS 7.0
·         Running a WCF service with ASP.NET content.
·         Running a WCF service on the Internet using various transport protocols.
·         WAS benefits.
·         Integrated with ASP.NET and IIS content.

The choice of a hosting environment depends on the version of Windows on which it is deployed, the transports it requires to send messages and the type of process and application domain recycling it requires. The following table summarizes the data related to these requirements.

Hosting Environment
Platform Availability
Transports Supported
Process and AppDomain Recycling
Managed Applications ("Self-Hosted")
Windows XP, Windows Server 2003, Windows Vista,
Windows Server 2008
HTTP,
net.tcp,
net.pipe,
net.msmq
No
Windows Services (formerly known as NT services)
Windows XP, Windows Server 2003, Windows Vista,
Windows Server 2008
HTTP,
net.tcp,
net.pipe,
net.msmq
No
IIS 5.1
Windows XP
HTTP
Yes
IIS 6.0
Windows Server 2003
HTTP
Yes
Windows Process Activation Service (WAS)
Windows Vista, Windows Server 2008
HTTP,
net.tcp,
net.pipe,
net.msmq
Yes

It is important to note that running a service or any extension from an untrusted host compromises security. Also, note that when opening a ServiceHost under impersonation, an application must ensure that the user is not logged off, for example by caching the WindowsIdentity of the user.

See Also



Hosting Options References :




Scrum – Agile methodology (High level notes)

Scrum – Agile methodology (mentioned 1986- implemented 1993)

-          Start with a living back log owned by product owner
o   Very high level in terms of days
o   Contains features and bugs
o   Breaks sown to tasks : in terms of hours
o   Prioritize them
-          Daily scrum: Less than 15 minutes!
o   What is it that I have done
o   What is it that is in my way
o   What is it that I need to do before next meeting
-          Sprints : 2-3 weeks
-          Demo at the end of each sprint

-          Collective code ownership

-          Collective task ownership

-          Scrum master

o   handles all the road blocks (hardware and etc …)

o   not necessarily the team lead

Helpful Windows XP/2000 Commands & Tools

Found this is an interesting published/unpublished list of windows commands/tools which could be useful in your day to day activities.

1-     at (windows XP/2000)
Scheduling utility.
2-     bootcfg (XP only)
This utility allows you to set up your boot options, such as your default OS and other loading options.
3-     cacls (XP, 2000, & NT4.0)
Changes the ACLs (security Settings) of files and folders. Very similar to chmod in Linux. 
4-     comp (XP & 2000)
This utility is very similar to diff in Linux.  Use the /? switch to get examples of command usage.
5-     contig (works with NT4.0 and newer)
A great defrag utility for NTFS partitions.
6-     control (XP only) - unpublished!
Allows you to launch control panel applets from the command line. 
control userpasswords2, for example will launch a helpful local user admin utility.
7-     defrag (XP only - NT4.0 and Win2k use contig)
Yes, XP comes with a command line disk defrag utility. If you are running Win2k or NT4.0 there is still hope. Contig is a free defrag program that I describe on the defrag page.
8-     diskpart (XP only)
Use this command to manage your disk partitions.  This is the text version for the GUI Disk Manager.
9-     driverquery (XP only)
Produces a list of drivers, their properties, and their versions. Great for computer documentation.
10-  eudcedit (XP only) - unpublished!
Private Character editor.  Yes with this program built into Windows XP you can create your own font!
11-  findstr
Find String - similar to Linux's Grep.
12-  fsutil (XP only) - unpublished!
This is a utility with a lot of capability.  Come back soon for great examples.
13-  getmac (XP & 2000)
This command gets the Media Access Control (MAC) address of your network cards.
14-  gpresult (XP & 2000)
This generates a summary of the user settings and computer group policy settings.
15-  gpupdate (XP only)
Use this utility to manually apply computer and user policy from your windows 2000 (or newer) domain.
16-  ipconfig (XP, 2000 & NT4.0)
This handy tool displays IP settings of the current computer and much more.
17-  MMC (XP, 2000 & NT4.0) - Microsoft Management Console
This is the master tool for Windows, it is the main interface in which all other tools use starting primarily in Windows 2000 and newer systems.
18-  more
Utility used to display text output one screen at a time. Ex. more c:\windows\win.ini
19-  msconfig (XP only)
The ultimate tool to change the services and utilities that start when your Windows machine boots up. You can also copy the executable from XP and use it in Win2k.
20-  msinfo32 (XP &smp; 2000)
An awesome diagnostic tool. With it you can get a list of running processes, including the residing path of the executable (great for manually removing malware) and get detailed information about hardware and system diagnostics.
21-  narrator (XP only)
Turns on the system narrator (can also be found in accessibility options in control panel).  Will will allow your computer to dictate text to you.
22-  netsh (XP & 2000)
A network configuration tool console.  At the 'netsh>' prompt, use the '?' to list the available commands and type "exit" to get back to a command prompt.
23-  netstat (XP)
A local network port tool - try netstat -ano.
24-  nslookup (all)
A DNS name resolution tool.
25-  openfiles (XP Only)
Allows an administrator to display or disconnect open files in XP professional. Type "openfiles /?" for a list of possible parameters.
26-  Pathping (XP & 2000)
A cross between the ping and traceroute utilities. Who needs Neotrace when you can use this? Type "pathping <ip address>" and watch it go.
27-  recover (XP & 2000)
This command can recover readable information from a damaged disk and is very easy to use.
28-  reg (XP & 2000)
A console registry tool, great for scripting Registry edits.
29-  sc (XP & 2000)
A command line utility called the Service Controller.  A power tool to make service changes via a logon/logoff or startup/shutdown script.
30-  schtasks (XP only)
A newer version of the AT command.  This allows an administrator to schedule and manage scheduled tasks on a local and remote machines.
31-  secedit (XP & 2000)
Use this utility to manually apply computer and user policy from your windows 2000 (or newer) domain.  Example to update the machine policy: secedit /refreshpolicy machine_policy /enforce
To view help on this, just type secedit.
NOTE: In Windows XP SP1 and news, this command is superceded by: gpupdate /force
32-  sfc (XP & 2000)
The system file checker scans important system files and replaces the ones you (or your applications) hacked beyond repair with the real, official Microsoft versions.
33-  shutdown (XP & 2000)
With this tool, You can shut down or restart your own computer, or an administrator can shut down or restart a remote computer.
34-  sigverif (XP only)
Microsoft has created driver signatures. A signed driver is Microsoft tested and approved. With the sigverif tool you can have all driver files analyzed to verify that they are digitally signed. Just type 'sigverif' at the command prompt.
35-  systeminfo (XP only)
Basic system configuration information, such as the system type, the processor type, time zone, virtual memory settings, system uptime, and much more.  This program is great for creating an inventory of computers on your network.
36-  sysedit (XP/2000)
System Configuration File Editor.  An old tool that was very handy for the Windows 9X days.  msconfig is what you want to use now.
37-  tasklist (XP pro only)
Tasklist is the command console equivalent to the task manager in windows. It is a must have when fighting scumware and viruses. Try the command:
tasklist /svc
to view the memory resources your services take up.
38-  taskkill (XP only)
Taskkill contains the rest of the task manager functionality.  It allows you to kill those unneeded or locked up applications.
39-  tree (XP & 2000)
An amazing experience everyone should try!  This command will provide a 'family tree' style display of the drive/folder you specify.
40-  WMIC (XP & 2000)
Windows Management Instrumentation Command tool.  This allows you to pull an amazing amount of low-level system information from a command line scripting interface.

Developers tools reference


Design and Modeling
-          Code Smith – Model Driven Design – Code generator
-          Enterprise Architect
-          Star UML

Development   
Blinq : is a tool to generate ASP.NET websites that use LINQ to show and edit data
Code Rush
Refactor

LINQ
- LINQPad

Regular Expression

-          RegexBuddy

CSS:
Reflector
-          Red Gate’s Reflector

Client side/ JavaScript 
-          Mozilla Firebug add-on

HTTP requests
-          Fiddler
Performance Tuning
-          Performance Monitor- Red Gate ANTS (ANTS profile)

MSMQ
-          QueueExplorer
GacUtil /I installs to Global assembly cache /ui uninstalls /l lists
Sn creates string name key
Nslookup looks up name space from IP
Ping
WCF tools
-          wcfsvcHost.exe /service:Myservice.dll /config:app.config it is WCF provided host is used to host a service
-          svcUtil.exe http://localhost:8002/myservice/ /out:Proxy.cs /noconfig
-          is used to create clients’ service proxy by downloading metadata from running services and storing them as files
-          svcConfigEditor.exe Modifies config files to a messy extend but ready for use in client
-          WcfTestClient.exe

Debugging


-Performance Monitor - PAL
-Process Monitor
-Process Explorer
-Autoruns
-TCPView
-PS Tools
-Disk2VHD
-MPSReport
      - Reflector
- Dependency Walker
- SQL Nexus 
     - CLRProfiler
- LogParser
- Application Verifier
- Logger/LogViewer
      - Xperf – Windows Performance Analyzer
- DebugDiag – Debug Diagnostic
- ProcDump – Process Dump
- WinDbg – Windows Debugging Tools
- WinDbg Scripts/PowerDbg Scripts
- Netmon – Microsoft Network Monitor
- Fiddler – HPPT Debugger Proxy

-    DebugView (http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx)

-          View state decoder  (online/offline decoder)

-          FileMon
-          RegMon
Web .NET Debugging
-          List of tools : http://www.softwareqatest.com/qatweb1.html#FUNC
-          ANTS load
               
Prototype tool:
-          Easy Prototype http://www.extremeplanner.com/easyprototype/

Code Library
-          Open source Libray http://sourceforge.net/projects/adapdev/

Application Launchers
-          App rocket ($18.00) http://www.candylabs.com/approcket/
-          Google desktop (free)
-          http://www.launchy.net/

.NET PAINT

Windows Shortcuts

Mock objects
Rhino Mock
N mock
Type Mock

Command line
                NetSH: network admin through command
           NetStat
WMIC:
                INETMGR: IIS manager
                EUDCEDIT: font editor
                APPWIZ.CPL: Add remove programs
                MSCONFIG:
SFC:
FSUTIL:
Driverquery: lists all device drives
Openfiles: all shared open files
GETMAC: gets machine MAC address

List of all


Continues integration /TDD

Source Control
                TFS
-          MS Build
-          Code Analyzer
Automated QA
-          Automated QA’s product Test Complete

Continues integration / TDD (old school)
NANT
Cruise Control
FxCop

Project MONO (Mono Live)
                Linux

Look up unsecure networks


Blogs:
1-      Scott Hanselman’s :
2-      Scott Guthrie
3-      DNR TV
4-      DOTNETROCKS
9-      Presentation Zen