What is the aspnet_client folder for under the IIS structure?

Iis

Iis Problem Overview


I notice that there's frequently an aspnet_client folder under the standard IIS web folder structure. What is this used for? Is it needed?

Iis Solutions


Solution 1 - Iis

In the .NET 1.1 days and before, this folder provided ASP.NET with its JavaScript support for the validation controls and other functionality. If you don't have a .NET 1.1 site or older running it should be safe to delete it. I would rename it first to ensure it doesn't cause any problems.

Solution 2 - Iis

In addition to what others have said, it's usually created by the aspnet_regiis tool, which can be (re-)run by things like Windows Update/AddRemove Windows components/IIS. So sometimes even if you do delete it, it can come back randomly. There may be a way to stop this behavior, but I haven't found it (maybe changing the application version to .NET 2 would do it actually).

So unless you're using certain features of .NET 1.0/1.1 (validation, Smart Navigation etc) you can delete it without any problems, just don't be too surprised if it comes back!

Solution 3 - Iis

aspnet_client is a folder for "resources which must be served via HTTP, but are installed on a per-server basis, rather than a per-application basis".

Some of the uses of aspnet_client include storing resources (eg. JavaScript, images) for:

  • JavaScript for ASP.NET Web Forms controls when using client-side validation (mainly to manhandle older browsers like IE5, it seems)
  • ASP.NET 2.0 (until at framework 4.0) for 'Global Themes' (global to all sites on a server, that is)
  • some versions of Crystal Reports

There probably are/will-be further (ab)uses of this folder in the future. Needless to say, since it contains things which are "necessary for the application to run correctly" but which "are not supposed to be deployed by the application", it will remain something of a nightmare for both developers and system administrators.

It seems that the 'prototype' for the contents of the folder is in C:\inetpub\wwwroot, and it seems reasonable to suppose that if any given IIS website lacks a /aspnet_client resource, then IIS will try to do the right thing and ... as a last resort ... make a physical folder in the web site root folder, and copy the files there. It seems that IIS will do this at least when "ASPNET_regiis /c" is invoked a given server - which probably occurs automatically at some critical junctures ... like when .NET framework updates are applied to a server which has the IIS role.

Strategies for handling the aspnet_client directory include:

  • specifying a virtual directory mapped to C:\inetpub\wwwroot in the hope that IIS will forgo creating a physical directory
  • deleting the physical directory from time to time if you're sure your site doesn't need it and it really bothers you
  • ignoring aspnet_client
  • running "ASPNET_regiis /c" yourself if you're missing the folder, and need it

Probably most importantly, as a developer, you should clearly understand and document your applications' dependencies on the aspnet_client directory, and make sure that your installation procedure has relevant instructions for making sure that the directory exists. However, you should probably not bother to actually supply the directory as part of your packaged web application or web site - how could you possibly do this for each version of the .NET framework which the server will see over the lifetime of your application?!

Some links I will come back to later:

Solution 4 - Iis

It also has certain icons and scripts that are required for crystal reports to run properly even in versions later than 1.1

Solution 5 - Iis

The folder is usually for storing client side Javascript, which ASP.NET uses for things like validation.

It should be safe to delete.

Solution 6 - Iis

Figured I'd add this here as this is the link I kept being directed to when I googled this question. Apparently with .NET 4.0 and newer this folder is no longer needed and can be removed without issue.

Solution 7 - Iis

If you are using Installshield to configure ASP.net website, be aware that this feature was present in Installshield 2010 and is missing in Installshield 2012. Installshield 2010 Vs 2012

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionGuyView Question on Stackoverflow
Solution 1 - IisDuncanView Answer on Stackoverflow
Solution 2 - IisspmasonView Answer on Stackoverflow
Solution 3 - IisDavid BullockView Answer on Stackoverflow
Solution 4 - IisashimView Answer on Stackoverflow
Solution 5 - IisJamesSugrueView Answer on Stackoverflow
Solution 6 - IisDavidView Answer on Stackoverflow
Solution 7 - IisVishnu PrasanthView Answer on Stackoverflow