Showing posts with label IIS. Show all posts
Showing posts with label IIS. Show all posts

Sunday, June 21, 2009

Common ASP.NET problems related to IIS

The page cannot be found - return 404 for ASP.NET pages
OK button is grayed out while adding an IIS file mapping
Missing ASP.NET tab on IIS Manager
Parser Error: Could not load type

The page cannot be found - return 404 for ASP.NET pages

Make sure IIS is accepting the correct ASP.NET version. ASP.NET tab on IIS
On Windows 2003, you also need to ensure ASP.NET version is set to Allow for that ASP.NET version in Web Service Extensions. If you don't see ASP.NET extension, follow "Missing ASP.NET tab on IIS Manager" to install and enable it. After that, if you're running into the following error, your ASP.NET page probably has to run some shell command that requires additional permission.
   The compiler failed with error code 128.
   ...
   c:\windows\system32\inetsrv> "C:\WINDOWS\Microsoft.NET\Framework\v3.5\csc.exe" ...
In this case, go to Administrative Tools and select Services:
  • In the Services pane, locate World Wide Web Publishing Service.
  • Right-click World Wide Web Publishing Service, and then click Properties.
  • Click the Log On tab.
  • Click to clear the Allow service to interact with desktop checkbox.
  • Click OK.
Be sure to start the IIS and kill the browser before running the application again.

OK button is grayed out while adding an IIS file mapping

It is a small bug on IIS 5.1 with Windows XP.

To work around this:

After selecting the executable via the Browse... button, click on the textbox itself and the path will then be fully expanded. It in turn enables the OK button. [ref]



Missing ASP.NET tab on IIS Manager

Please ensure you have installed .NET framework first. For ASP.NET 2.0 or later, at the command prompt, do the following to install and enable ASP.NET on IIS:

%WinDir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -i -enable


Parser Error: Could not load type

You may experience the following error on IIS after you've published your ASP.NET application. But everything works fine in the Visual Studio. For example,

Parser Error Message: Could not load type 'SysAdmin.RunBatch'.

  • Check the Application Settings of your Web site or virtual directory, and then make sure there is Application name for it.
    • On IIS, right click the Web site or virtual directory, and then select Properties.
    • At Home Directory of Directory tab, click Create button to create the Application Name if it doesn't exist.
    • Execute Permissions must be at least set to Scripts only.
    • Click Apply and then OK to exit.
  • Check and ensure that the associated bin directory is resided with your aspx pages and Web.config. It is similar to the directory structure when you developed your application.

Friday, June 19, 2009

Add a file extension mapping on IIS for ASP.NET handler

  • Right click the Web site or the virtual directory and then select Properties.
  • Select Configuration button on Home Directory tab (for Web site) or Directory (for virtual directory).
  • On Mappings tab, click Add.
  • For ASP.NET 2.0 or later,
    Executable C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll
    Extension the file extension you want to map, e.g., .simple

    Here is an example.
    Add File Extension to IIS
  • Click OK, then Apply or OK.
  • Exit the wizard

Friday, April 10, 2009

Windows Firewall Settings and IIS for ASP.NET

If you are using the built-in internal development/test server in Visual Web Developer Express or VS.NET for development, testing and debugging, there is nothing you should worry about the Windows Firewall settings. However, if you would like to test your Web application over the network on a local IIS Web server, you need to have the following setting changed on Windows Firewall setting:

On Windows XP,

  • Go Control Panel -> Windows Firewall
  • Select Advanced tab
  • On the Network Connection Services selection list, select one of the connection item, e.g., Local Area Connection, Wireless Network Connection, ... and etc.
  • Then click Settings...
  • Ensure that Web Server (HTTP) is checked.

On Windows Vista,

  • Go Windows Control Panel
  • Select the Exception tab
  • Ensure that World Wide Web Services (HTTP) is checked.