.comment-link {margin-left:.6em;}

Monday, October 17, 2005


Quartz Web Designer for ASP.NET II from Microsoft

now we can build a very powerful design model based on WPF which can now target ASP.NET Clients


Wednesday, October 12, 2005


Encrypting web.config without writing Code

I think alot of people needs to encrypt their web.config sections in an easy way . it has never been easier than ASP.NET 2.0
1- Tool : Aspnet_regiis.exe . 
    limited to certain kind of sections . there are some system sections like (<processModel>, <runtime>, <system.runtime.remoting> ) that cannot be         encrypted using this tool , so we have to use another tool which is Aspnet_setreg.exe .
2- Encryption Provider : RSA
3- key Storage Location : Encryption Keys are saved in Container files
    a- Machine Container : the encryption key is shared to all applications running on the same server. ( \Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys ).
    The shared Encryption key Container : "NetFrameworkConfigurationKey"
    b- User Container : the encryption key is only accesible by our application. ( \Documents and Settings\{UserName}\Application Data\Microsoft\Crypto\RSA )
4- Encrypting :
for IIS : aspnet_regiis -pe "ParentSection/ChildSection" -app "/WebApplication1"
-pe :  the section to be encrypted like "connectionStrings"  or "appSettings/App1"
-app: the virtual path to the application
-pd : for decryption
For the built-in web server with Visual Studio.NET 2005 :
aspnet_regiis.exe -pef "ParentSection/ChildSection" C:\MyWebs\WebApp1
-pef: section to be encrypted + physical path
-pdf: for decryption
For User Container Storage :
    <add keyContainerName="NetFrameworkConfigurationKey"
      description="Uses RsaCryptoServiceProvider to encrypt and decrypt"
type="System.Configuration.RsaProtectedConfigurationProvider,SystemConfiguration, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
The good news is that you dont have to write anything special in your code to read the encrypted data .it is read by the same way : ConfigurationManager.ConnectionStrings("MyConn1").ConnectionString

5- ACL on the Encryption Key : which web application has permission to read encrypted data ?

any ASP.NET Web APP has an identity (in IIS6 , it is the identity of the App Pool). when an ASP.NET web App tried to read encrypted Data , ASP.NET checks if that application has the appropriate permission by checking the NTFS ACL on the Encryption Key Container File (for shared Machine Container it is :
NetFrameworkConfigurationKey) against app identity
Access Denied : If your web APP doesnt have permission to access the key -->  "Parser Error Message: Failed to decrypt using provider 'RsaProtectedConfigurationProvider'. Error message from the provider: The handle is invalid."

Grant Access to an Account: aspnet_regiis -pa "NetFrameworkConfigurationKey" "MyServer\MyUser"

Monday, October 10, 2005



very cool feature form ASP.NET II . just place a page in the root of your web app with this file "App_offline.htm" and the server will unload the web app and unload the app domain and stop processing any requestes . it just displays the contents of the htm page. this can be used during maintenance.the only complaint is that you cannot control the name of the page in any config file coz this is executed before loading any config file ...

removing this file from the root will result in immediate normal processing for requests from the next request


Using the HTTP.SYS Kernel Mode Cache from ASP.NET

first question of course will be "what is the difference between Kernel mode and user mode ?" .

kernel mode is the OS mode .it is by default a 2GB piece of memory. it is a protected area .running under elevated privilages(Local System) . so anything running in kernel mode is actually very very fast over user mode coz they have elevated priority over anything running in User mode .
by default User mode is 2GB peice of memory. it is the place to run all the applications ( including IIS)  in windows OS

so one of the implications of implementing a kernel mode http listener is dramatically increase the performance .

let's have a look on caching in ASP.NET Today ,  I could take the data i need to cache  and basically store it in memory and guarantee that on subsequent requests, IIS is going to call ASP.NET; ASP.NET is going to get the choice to say, based on the URL you're asking for, I'm going to fetch this out of memory if I have it; and then I can send a response back down. But with IIS 6.0, the extra benefit you get is that rather than IIS ever having even talked to us, the request can be pushed in IIS and it can be served straight from IIS.

so caching data in kernel mode (HTTP.SYS) avoids context switches between user mode and kernel mode .it is dramatically increasing performance , and when talking about performance we can measure this with a very simple page built with ASP.NET on MS Application Center . the difference between no of req/sec before and after apply caching is incredible

note: to apply HTTP.SYS caching from ASP.NET  you have to add the @OutPutCache Directive to the page



i heard alot about wiki i always want to know what is really a wiki .
so languistically speaking  : wiki is a huwai'ian keyword which means "Quick"
In Hawai'ian repeated words provide emphasis, so WikiWiki means very quick
That makes a WikiWikiWeb a very quick way to create web-based content.

from a Technical Technical perspective , you can consider a wiki like a dashboard or a white board but instead of only one person writing on it , no there can be multiplie persons from all over the world can be writing on it , and modification to the text on the white board it tracked to his modifier. so it is amix between chatting , collaboration and discussion board .

let's take an example

  1. go to http://www.flexwiki.com/

  2. alomst every page you see from now on is a complete wiki and it is called a topic. for example the first link in the page in the right section is pointing to http://www.flexwiki.com/default.aspx/FlexWiki/WikiWiki.html, please click on it

  3. this opened web page now is a topic using the wiki methodologies

  4. let's say you need to change the page , you need to add your own text on that page or change or delete. simply double click any where on any white space portion on that page

  5. now we are inside wiki editor

  6. change the text freely and please have a look on the right pane, where you can change your contribution change "Name" and change templates and then click save

  7. the previous page is back now but with your change which is exposed to any one in the world. you can try this yourself bu opening the same page now from another computer

  8. for example lets say that i need to track all changes not that has happened to that page, i can simply click on show changes on the left . it will show me all the changes to that page

  9. a very great feature is also the "recent changes" from the left pane , click on that . you can now see all the changes to the current namespace and you can even filter by author. let's filter by my name for example "Hussein". click in the combo box "Authors" and click "H" in the keyboard then down to "Hussein Computer"

so now for any site , we should have a wiki just to post our own comments about the site , these comments might be questions , answers , notes , summary , etc....

This page is powered by Blogger. Isn't yours?