Tim
Tim

Reputation: 1826

How safe is "aspnet_regiis -i" on a production server?

I have a production IIS server that hosts a number of web apps, most of them relatively simple. The .NET framework version 4.5 has been installed on the server, but IIS has not yet been configured to use it. I want to use 4.5 on a new application. This Stackoverflow post describes how to update the server using the command aspnet_regiis -i.

Microsoft says that this command ...

Installs the version of ASP.NET that is associated with Aspnet_regiis.exe and updates the script maps at the IIS metabase root and below. Only the script maps for applications that use an earlier version of ASP.NET are updated. Applications that use a later version are not affected.

I guess I don't completely understand the implications. I'm not certain, but I think updating the "script maps" means all existing (older) applications will run ASP.NET 4.5. Am I likely to break any existing applications if I run this command?

Upvotes: 4

Views: 1356

Answers (2)

Rory
Rory

Reputation: 41827

DO NOT use aspnet_regiis -i on a production server if you don't want to affect all Web Sites & Application Pools.

They should really emphasise this a bit more on the aspnet_regiis site. Instead use aspnet_regiis -ir if you're registering ASP.NET 4 for the first time. If ASP.NET 4 is already registerd then you could use aspnet_regiis /s ... as @BradleyUffner suggests, or you could just change your v2 AppPool to use v4 directly.

Nobody understands the difference between -ir and -iru and you're not allowed to ask.

Upvotes: 0

Bradley Uffner
Bradley Uffner

Reputation: 16991

If you only want to update a specific site, leaving the other to use whatever .NET version they are currently using, you can tell regiis to update a single site by using the /s switch. Updating just the single site is safe and will not affect other sites.

aspnet_regiis /s w3svc/<id>/root/<yourVirtualDirectoryName>

<id> is the "Identifier" field that shows next to your site when you open the IIS manager and click on "Web Sites" in the tree view. And optionally, <yourVirtualDirectoryName> is any virtual directory you want to apply these changes to. The /s option does the current location and all subdirectories. /sn will do JUST the current location and NOT recurse down.

Upvotes: 3

Related Questions