Journey to MCTS 70-515: Lesson 2 – Creating Websites

Creating or Deploying Websites

IIS 7.5 does not support Front Page Server Extensions because it uses WebDAV natively. Therefore HTTP deployment cannot be used to create the website. But you could create a file-system based or FTP website. Of those two, the file-system–based website is preferred.  

If you are creating or deploying the website on a remote server then the remote server must have .NET Framework 4, ASP.NET, and Front Page Server Extensions installed and enabled. Note that Microsoft does not support Front Page Server Extensions on IIS 7.5 and Windows Server 2008 R2. So a new website cannot be created using the HTTP deployment in Visual Studio. If you receive the error message below then create the website by using the file system or FTP.  

Exception:
Unable to create the website ‘http://servername’. The web server does not appear to have FrontPage Server Extensions installed
 

Use FTP deployment only when using a web hosting provider that does not support file-system based websites, WebDAV, or Front Page Server Extensions. This is because by default FTP sends user credentials unencrypted. For security reasons change your password regularly when using FTP deployment to minimize the potential impact of compromised credentials.  


What are ASP.NET Folders?

These are special folders which are protected by ASP.NET. If users attempt to browse any of these folders (except App_Themes), they will receive an HTTP 403 Forbidden error.

App_Browsers, App_Code, App_GlobalResources, App_LocalResources, App_Themes, App_WebReferences, and Bin are the ASP.NET special folders.

Can C# web page and VB web page code exist in the same website?

A web page can only have either Visual Basic or C# code. But you can have both web pages with Visual Basic and C# in the same ASP.NET 4 website project. Only not within a web application project.

Website Compilation

There are two models for compilation, a) dynamic compilation and b) precompilation.

Dynamic Compilation:
ASP.NET automatically compiles the application into an assembly and loads it into the website application domain. This takes a few seconds thus affecting performance for any requests received before ASP.NET has finished compiling the application.  

Precompilation:
The other option is to precompile the website within Visual Studio IDE. The entire website is compiled and checked for build errors. This model allows only the layout code and associated assemblies to be deployed on the web server.

Journey to MCTS 70-515: Lesson 1 – Understanding Web Communications

A Web Server’s Role

A web server provides content while the browser displays it. The web server sends files, html or images, through an HTTP connection to the web browser. The following processes take place when a web server receives a request from a web browser: -

1. Request Verification. Web Servers must be able to verify if the request made is legitimate and not a malformed one. If the latter case exists then the web server ignores the request.

2. SSL Authentication. If a Secure Sockets Layer (SSL) certificate has been applied on the web server and the request was made with HTTPS, the web browser uses that certificate to authenticate the server. All content is encrypted by the web server before returning it to the web browser.

3. User Authentication. If the website requires authorization, the web server verifies if the user has submitted credentials. If the user has not been authenticated then the web server redirects to an authentication form already specified for the website.

4. User Authorization. The user submits login credentials. The web server authenticates the user and verifies if the user is allowed to access the requested content.

5. Handling requests. If the web browser requested static content or was trying to access cached content, the web server can directly respond. But if the web browser requests an ASP.NET page then the request is forwarded to ASP.NET.

6. Error Handling. If a server cannot process the web browser request an error is sent to the web browser. These errors include HTTP status codes.

7. Cache output. Web servers cache output to improve response time of subsequent requests. They also provide caching information to web browsers as to know how long to keep the content cached.

8. Compress output. A web server can compress the content to reduce the bandwidth required before sending the page to the web browser.

9. Logging access. Web servers record usage information for security and performance-monitoring purposes.

The Web Browser’s Role
Following are the actions performed by the web browsers in general: -

1. Sending requests to web server. When url http://www.wordpress.com
is entered the web browser resolves the www.wordpress.com Domain Name System (DNS) address. It then uses HTTP to connect to the server and requests the relevant page, in this that’s the default page.

2. Server Authentication. If the server has an SSL certificate and the request was made with HTTPS, the web browser uses the certificate to authenticate the server and then decrypts future communications.

3. Process the response. If the server sends HTML, the browser retrieves embedded objects, such as images, videos, or animations referenced in the HTML. If the server has sent an error, redirection, or other response, the browser responds appropriately.

4. Displaying HTML and embedded objects. Web browsers use HTML standards to determine how to display a webpage to the user. Because HTML can contain embedded objects, a web browser might have to display dozens of objects to render a single webpage.

5. Run client scripts. Client scripts such as in JavaScript enable interactive and responsive pages without reloading the page.

Understanding the Role of HTTP

HTTP is a text-based communication protocol that is used to request webpages from a web server and send responses back to a web browser. When a webpage is requested, the browser sends a request to the web server.

The request might look like the following:

GET /default.aspx HTTP/1.1

Host: www.microsoft.com

If a website has Distributed Authoring and Versioning (DAV) enabled, many more commands are available, including LOCK and UNLOCK.

Note: WebDAV must be enabled if you want to use source control or versioning database/tool from the webserver. For example a webservice giving access to Visual SourceSafe hosted on the web server.

VS 2005 does not debug web applications in IE8

My current environment is Windows XP SP2 and Visual Studio 2005.

For the last few weeks I had not been able to debug my projects on the current machine which became frustrating.

Finally after some web searching I found the following snippet from Brad Sullivan, Program Manager, Visual Studio Debugger, MSFT : -

IE 8 has a feature called Loosely-Coupled Internet Explorer (LCIE) which results in IE running across multiple processes.

http://www.microsoft.com/windows/internet-explorer/beta/readiness/developers-existing.aspx#lcie

Older versions of the Visual Studio Debugger get confused by this and cannot figure out how to attach to the correct process.

You can work around this by disabling the process growth feature of LCIE. Here’s how: 

  1.  
    1. Open RegEdit
    2. Browse to HKEY_LOCALMACHINE -> SOFTWARE -> Microsoft -> Internet Explorer -> Main
    3. Add a dword under this key called TabProcGrowth
    4. Set TabProcGrowth to 0

Now that resolved the issue!!!!!

Running 32bit ASP.NET 1.1 applications on 64 bit Windows OS

Had an unsual issue today. I was unable to run my older ASP.NET 1.1 apps on a new 64 bit Windows server. Could not restart the IIS web site service. Kept on getting these two issues in the Event Log,

 

Issue #1:

ISAPI Filter ‘c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_filter.dll’ could not be loaded due to a configuration problem. The current configuration only supports loading images built for a AMD64 processor architecture. The data field contains the error number. To learn more about this issue, including how to troubleshooting this kind of processor architecture mismatch error, see http://go.microsoft.com/fwlink/?LinkId=29349.
[the link takes you no where]
IIS 32bit ISAPI filter issue

Issue #2:

Could not load all ISAPI filters for site/service. Therefore startup aborted.
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.”
Trying to find a solution, I kept bouncing to the page
How to switch between the 32-bit versions of ASP.NET 1.1 on a 64-bit version of Windows
http://support.microsoft.com/default…b;en-us;894435

Finally I resolved the issue. The following steps will give you a better idea on how to resolve this cracker.

1. Goto your Inetpub folder and browse AdminScripts folder
2. Look for adsutil.vbs and double click it. It would ask if you wanted to enable cscript. Say yes and move forward.
3. Click Start>Run and type cmd to open the Command Window
4. Now type the following command to enable the 32-bit mode:

cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1
(here replace systemdrive with the drive letter, i.e. C: or D:)

5. Now install .NET 1.1 Framework. If already installed then using the command window type the following:
%SYSTEMROOT%\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis.exe -i
(systemroot is your windows path, i.e. c:/windows or d:/windows)

6. Make sure that the status of ASP.NET version 1.1.4322 is set to Allowed in the Web service extension list in IIS Manager.

After all is done, right click the Web Sites folder in IIS Manager and click on properties.

IIS5 Isolation mode

In the Services tab make sure Isolation mode is unchecked.

or using the command window type the following,

CSCRIPT %SYSTEMDRIVE%\Inetpub\AdminScripts\adsutil.vbs SET W3SVC/IIs5IsolationModeEnabled 0
NET STOP HttpFilter /y
NET START W3SVC

For more understanding of similar issues visit the following links
http://blogs.msdn.com/david.wang/archive/2005/12/14/HOWTO-Diagnose-one-cause-of-W3SVC-failing-to-start-with-Win32-Error-193-on-64bit-Windows.aspx

http://www.vbforums.com/showthread.php?t=348106

Do let me know what you think about this post.

Follow

Get every new post delivered to your Inbox.