Home > Microsoft .Net Development Tips > ASP.NET Development > When IIS and ASP.NET don't get along
Win Development Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ASP.NET DEVELOPMENT

When IIS and ASP.NET don't get along


Don Kiely
07.14.2003
Rating: -4.54- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Learn to use aspnet_regiis.exe -- a hush-hush .NET utility that solves many ASP.NET installation problems.

Despite how cool ASP.NET is and all the promises Microsoft has made for it, sometimes things just go wrong. You're typing code a mile a minute, creating Web pages that are works of art and you run it to see how you're doing. Bam! You get an error message. You go into forensics mode, using your years of programming experience and .NET's wonderful diagnostics tools to get to the root of the problem and eradicate it.

But nothing works.

Although it is probably of scant comfort after six hours of intense investigative debugging, the problem might not be in your code at all. And it might not even be in Microsoft's code, either. A lot of weird errors can occur in ASP.NET indicating that it isn't installed correctly, or that something's out of sync with IIS. Maybe you're using some of the validation server controls and the client can't find the script file it needs for client-side validation. Or, an ASPX page simply isn't loading no matter what you do.

The problem is that ASP.NET installs a bunch of settings and files it uses to make the .NET magic work in Web applications. There are file extension mappings so IIS knows what DLL to use to respond to a client request (for a list, go into the Internet Services Manager and the Properties page for a Web site; go to the Home or Virtual Directory tab; select Configuration; then select the Mappings tab). The WebUIValidation.js used for client-side validation must be in the right place in the .NET Framework folder in the Windows system directory and in your various Web site directories. Or you need to manage multiple versions of the Framework.

Things can get out of sync in many ways. You might accidentally delete a critical file. You might be exploring some IIS deep magic and playing with mappings and other IIS settings. Maybe IIS wasn't installed before .NET, so IIS doesn't have a clue what ASP.N


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
ASP.NET Development
How to use jQuery to solve Javascript browser compatibility problems
How to write an out-of-browser Silverlight 3 application in 3 steps
Silverlight 3 beta SDK download lets developers try new RIA features
Visual Studio's IntelliSense for jQuery doesn't autocomplete correctly
Dundas Map for .NET kicks up geographic visualization
Return to CodePlex: Into the Sandcastle…
VBScript Tutorial
Use PHP with Visual Studio to create Web sites
Visual Studio Team System Add-ins: Conchango Scrum for Team System and Scrum Dashboard
Visual Studio 2008 and .NET Framework 3.5 SP1 introduces ADO .NET Entity Designer

ASP.NET development best practices
Introduction to ASP.NET's Model View Controller (MVC) Design Pattern
Silverlight, Ajax components require different approach to UI
LINQ Learning Guide: LINQ and Web applications
VB code download home page
VB code: File manipulation downloads
Localization practices for .NET 2.0: It's still about the architecture
Creating custom ASP.NET 2.0 profile providers
.NET development in the trenches
Microsoft developers balancing age-old issues, barrage of new technology
SearchVB.com's Podcast Page

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
136 browser colors with names  (SearchWinDevelopment.com)
ASP.NET  (SearchWinDevelopment.com)
browser  (SearchWinDevelopment.com)
Document Object Model  (SearchWinDevelopment.com)
domain name  (SearchWinDevelopment.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


ET is. Or any of many other travesties can occur on an otherwise healthy system.

The solution is to uninstall and reinstall the .NET Framework on your development machine or server, right? Well, you might ultimately have to do that, but there's an easier way to fix many common ASP.NET and IIS issues. It's a utility Microsoft doesn't make much noise about, barely mentioning it in the documentation: aspnet_regiis.exe. You'll find it in something like the C:WINDOWSMicrosoft.NETFramework<version> directory with the other .NET command-line tools. The easiest way to run it is to open the VS .NET Command Prompt window, which sets all the paths and environmental settings for you.

The tool has several options, which you can get by running either aspnet_regiis or aspnet_regiis -? at the command prompt. Figure 1 shows some of the most useful options you have available.

[TABLE]
Figure 1:These are some of the most useful options in the aspnet_regiis tool. The -i and -c options are probably the most useful for eradicating mysterious errors from the local machine because they fix mappings and reinstall script files back into their proper places.

Another nice feature of the tool is it simplifies managing multiple versions of the .NET Framework on a machine, running different Web sites using different versions. This time, run this command:

aspnet_regiis -s W3SVC/1/ROOT/MyWebApp

where the -s parameter is the path to the Web application's virtual directory. This sets the script mappings for the specific version of ASP.NET.

References

Microsoft Knowledge Base Article 318465: "Cannot Debug ASP.NET Web Application" (http://support.microsoft.com/default.aspx?scid=kb;en-us;318465)

Microsoft Knowledge Base Article 306005: "Repair IIS Mapping After You Remove and Reinstall IIS" (http://support.microsoft.com/default.aspx?scid=kb;en-us;306005)

Deploying .NET Applications: Lifecycle Guide (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/DALGIssues.asp). See the section titled "Using Aspnet_regiis.exe to Manage Multiple Versions of the .NET Framework for Your Web Applications."

About the author: Don Kiely is senior information architect for Information Insights, a business and technology consultancy in Fairbanks, Alaska. E-mail him at donkiely@computer.org.


This article was provided by asp.netPRO Magazine, an online information resource for the ASP.NET developer community, which helps professional software developers build, deploy and run the next generation of dynamic, distributed Web applications quickly and easily. Click here for subscription information.

Rate this Tip
To rate tips, you must be a member of SearchWinDevelopment.com.
Register now to start rating these tips. Log in if you are already a member.




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Database Programming Solutions - .NET XML, Visual Studio LINQ, ORM .NET
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts