Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Requirements for Developing WebApplications & ASP .NET Problems

0.00/5 (No votes)
13 Aug 2005 1  
Web Applications & ASP .NET

Introduction

In this article you wil see the requirements for developing web applications & the more common problems that you may face when developing web applications using ASP .NET

this article is devided in two sessions the first one is specific to the requirments & session two will try to make you more closer to the ASP practical problems.

Session(1)

Requirements for developing Web Applications

     If you want to create Web projects on this machine, you must first install additional components.

To create Web projects, both of the following components must exist:

 

1)      Internet Information Services (IIS) must be installed

2)      FrontPage Server Extensions (FPSE) must be installed and configured

 

Note that you can create Web projects on remote machines that have these components installed and configured.
 

Note that you must follow the sequence of the steps shown below

 

1) Install Internet Information Services (IIS):

 

a.       From Control Panel, open the Add/Remove Programs

b.      Choose Add/Remove Windows Components on the left side of the dialog box.

c.       Check Internet Information Services and then choose Next to begin installing IIS.

d.      Click Finish when installation is complete.

 

 

2)      Install Front Page Server Extension (FPSE):

 

a.       From Control Panel, open the Add/Remove Programs

b.      In the Add/Remove Programs dialog box, choose Add/Remove Windows Components on the left side of the dialog box.

c.       In the Windows Component Wizard, select Internet Information Services.

d.      With Internet Information Services (IIS) selected, choose Details.

e.       If FrontPage 2000 Server Extensions are not already selected, check the check box & then ok

f.        Choose Next to begin installing.

g.       After installation completes, click Finish to close the Windows Component Wizard.

 

 

 

3)      Configure Front Page Server Extension (FPSE):

 

a.       From Control Panel Select Administrative tools and then open the Computer Management

b.      In the Computer Management dialog box, expand Services and Applications.

c.       Under Services and Applications, expand Internet Information Services.

d.      Under the Internet Information Services, expand Web sites.

Right-click Default Web Site, choose All Tasks, and then choose Configure Server Extensions.

 

Note: If the Configure Server Extensions menu command is missing, then FrontPage Server Extensions are already installed and configured.

 

e.       Choose Next on the first page of the Server Extensions Configuration Wizard.

f.      Choose Yes in the Warning dialog box.

g.       Choose No for configuring the mail server settings, and then choose Next.

h.      Choose Finish.

  

 

Installing the web server & running it

 

You might have to install the components for your web server as in the following sequence or order:

                 

1)      First install IIS & Front Page Server Extension(FPSE)

2)      Configure Front Page Server Extension (FPSE)

3)      Second install .NET framework

4)      Third Install the .NET but make sure you are installing the Web Server Components with .NET (this is from the options of .NET Installed Components)

5)      Finally run the web server using the command (In Command Prompt)

Net start w3svc

6)      & also Install ASP.NET into your machine using the command(In Command Prompt)

Aspnet_regiis -r

 

Note that all of these components must be installed in order to run ASP more properly.

 

Session(2)

Common Asp Problems & their Solutions

In this session we discuss the more common Problems that you may face when running a web server & developing ASP .NET applications, so lets go on.

 

 

1)     Installing the web server & running it

    You might have to install the components for your web server in a sequence or in order to avoid the problems that might face you because of not installing these components in order:

 

a.       First install IIS & FPSE and configure FPSE

b.      Second install .NET framework

c.       Third Install the web server components

d.      Finally run the web server using the command

Net start w3svc

e.       & also Install ASP.NET into your machine using the command

Aspnet_regiis �r

 

 

2)     Security problem:

�Login Failed" Error Message When You Create a Trusted Data Connection from ASP.NET to SQL Server

 

Description:

When you create a trusted connection from ASP.NET to SQL Server, you may receive the following error message:

Login failed for the user 'MachineName\ASPNET'

 

 

NOTE: You receive this error message specifically when you use integrated security (when you include the integrated security=sspi attribute in a connection string).

When you use ASP.NET, the default security context is the aspnet_wp for both aspnet_wp.exe and the request to SQL Server. By default, the aspnet_wp account does not have any permission in SQL Server, and therefore it cannot access the database.

 

        Solution

To resolve this problem, use any of the following methods:

        Programmatically change the security context of the ASP.NET worker process to a user that has the proper SQL Server permissions.
-or-

        Change the default configuration of ASP.NET so that the ASP.NET worker process starts and runs under the context of a user who has the proper permissions in SQL Server.
-or-

        Grant the proper permissions on SQL Server so that the aspnet_wp account has the appropriate access to the needed resources.

 

Simple Solution:

           

The most appropriate & simple solution to this problem is to setup or install SQL server with only windows authentication & don�t use a mixed mode of windows & user authentication.

 

Notes

-         When you want to link your ASP pages with a SQL database you must install SQL server for creating and developing your own database that will be linked with your web application, in this case you should install SQL server after the components that I have said before have already been installed.

 

-         Install SQL server with only windows authentication

 

-         If you already installed SQL server with only windows authentication, and this error is still displayed for you, In this case remove SQL server & then reinstall it (windows authentication mode); I think you are surprised of this notice but I tried this & after that ASP runs without any problems.

 

Briefly, you should install SQL server after installing the components needed to run web  server.

 

For more information & more practical solution of this problem browse & see the following MSDN Web site link:

http://msdn.microsoft.com/library/default.asp?url=/library/en-s/dnbda/html/authaspdotnet.asp

 

Note that if you install SQL Server before installing & running of the server you might have the same problem listed for you so in this case you have to reinstall SQL server again with only windows authentication mode to adjust or adapt the configuration to make support of connecting to a web database�

 

3)     The damage of a web application during:

 

1)      Copying the web application to another machine.

OR

2)      Re-installing IIS in the same machine.

 

The following error window will be displayed for the developer:

 

  can not be dispayed

 

 

 

 

Solution:

The problem is with "The Configuration of Server Extension"

When a web-application is transferred to another machine it must be configured in the new web server so you must do the following steps:

 

1)      Copy the web application in C:\Inetpub\wwwroot

2)      Open the computer management window from administrative tools in control panel or just by opening run in the start menu & typing the command compmgmt.msc \s

3)      Choose Internet Information Services | Websites | Default Web Site

4)      Right-click the web application the has been transferred in the wwwroot , choose Configure Server Extension item from Alltasks menu as shown below in the following figure:

 

 Sample screenshot

 

 

 

5)      a message will be displayed for you to ensure the request of yours, choose Yes

6)      New sub-web Wizard will be displayed for you, click "Next" up to finish the wizard

7)      Up to here you finish configuring the server extension for your new application added to the virtual directory, the following step is to add this new web application to the IIS, this allows the web application to be accessed or in other word to run the web application in the server.

8)      Right-click the newly web application copied in the virtual directory in the server & choose "Properties" the following dialog will be displayed for you, click the "Create" button in the "Application Settings" section & click Ok

 

 

Here you can continue developing your application where ever you end in another machine after copying your application or continue developing after reinstalling IIS without any problem faced you.

 

 Sample screenshot

4)     Changing the name of web application

  

When changing the name of web application, the web application folder, in the virtual directory C:\inetpub\wwwroot

 

I mean here changing the name of web application folder found in the virtual directory & not the name in the development environment "Not in VS .NET"

 

An error message is displayed for you like the following one:

 

 

 Image Can not be displayed

 

 

 

Solution:

 

1)      First is to change the name of the application inside VS .NET in the   "Solution Explorer"

2)      After that change the name of the folder outside to be the same as the name in the solution explorer in VS .NET

 

 

You may see the following error when opening the application in .NET:

In order to open a Web project, a URL needs to be specified. This error message indicates that no URL was associated with the existing project.

 

 Image Can not be displayed

 

Solution:

    To correct this error, use the Open Project or Open Project from Web dialog box (on the File menu, click Open) and manually locate and open the project by specifying the URL to the project file. For example,      

                   http://localhost/webproject1/webproject1.csproj

 

                                                           Good Luck & Best Wishes                                                                                                             

 

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here