What does aspnet_regiis.exe do
Asked Answered
C

7

30

What does aspnet_regiis.exe do exactly other than updating the document mappings to correct aspnet_isapi.dll version, is updating the ASP.NET version from inetmgr same as running aspnet_regiis, I could not find any blog post or article describing the steps this particular batch command does. Please give any links you know of detailing the steps of aspnet_regiis.exe

Caucasian answered 21/8, 2010 at 20:34 Comment(0)
T
17

From MSDN reference:

When multiple versions of the .NET Framework are executing side-by-side on a single computer, the ASP.NET ISAPI version mapped to an ASP.NET application determines which version of the common language runtime (CLR) is used for the application. The ASP.NET IIS Registration Tool (Aspnet_regiis.exe) allows an administrator or installation program to easily update the script maps for an ASP.NET application to point to the ASP.NET ISAPI version that is associated with the tool. The tool can also be used to display the status of all installed versions of ASP. NET, register the ASP.NET version that is coupled with the tool, create client-script directories, and perform other configuration operations.

From Scott Forsyth's blog:

Starting in the first version of ASP.NET, Microsoft has provided a tool to control which version of the framework is registered in IIS. This tool, aspnet_regiis.exe, is quite flexible and with the right understanding of how IIS and ASP.NET work, can be used for most any situation.

Tautog answered 21/8, 2010 at 20:38 Comment(1)
aspnet_regiis.exe can also be quite useful for security... It can be used for things like encrypting global, machine level configuration files (machine / web.config & custom configuration files)Commutual
F
20

My favorite feature of it, is the ability to encrypt settings in web.config something along the lines of:

aspnet_regiis -pe /myapprootvirtualdirector

and decrypt is -pd

encrypt only after deployment to the server - as encrypting on one machine won't be valid on the other unless you share machine keys.

Faculty answered 23/8, 2011 at 5:57 Comment(2)
To encrypt only the connection strings you can use : aspnet_regiis -pe "connectionStrings" -pkmHeartthrob
what is the full form of -pe. Is it perform encryption?Asyut
T
17

From MSDN reference:

When multiple versions of the .NET Framework are executing side-by-side on a single computer, the ASP.NET ISAPI version mapped to an ASP.NET application determines which version of the common language runtime (CLR) is used for the application. The ASP.NET IIS Registration Tool (Aspnet_regiis.exe) allows an administrator or installation program to easily update the script maps for an ASP.NET application to point to the ASP.NET ISAPI version that is associated with the tool. The tool can also be used to display the status of all installed versions of ASP. NET, register the ASP.NET version that is coupled with the tool, create client-script directories, and perform other configuration operations.

From Scott Forsyth's blog:

Starting in the first version of ASP.NET, Microsoft has provided a tool to control which version of the framework is registered in IIS. This tool, aspnet_regiis.exe, is quite flexible and with the right understanding of how IIS and ASP.NET work, can be used for most any situation.

Tautog answered 21/8, 2010 at 20:38 Comment(1)
aspnet_regiis.exe can also be quite useful for security... It can be used for things like encrypting global, machine level configuration files (machine / web.config & custom configuration files)Commutual
J
5

It reg isters ASPNET extensions with IIS.

Jaconet answered 22/8, 2010 at 3:38 Comment(1)
wasnt that what he said 'other than' that for? :PFaculty
E
5

It can also repair an install of aspnet.

Sometimes it just breaks and you need to run aspnet_regiis -i or -ir to fix it.

Evyn answered 22/8, 2010 at 3:41 Comment(0)
C
5

Please give any links you know of detailing the steps of aspnet_regiis.exe

aspnet_regiis.exe -h generates the following helpful information about how the utility works internally.

Microsoft (R) ASP.NET RegIIS version 4.0.30319.18408
Administration utility to install and uninstall ASP.NET on the local machine.
Copyright (C) Microsoft Corporation.  All rights reserved.


                       -- ASP.NET REGISTRATION OPTIONS --


-i                  Install this version of ASP.NET and update IIS
                    configuration at the root level to use this version of
                    ASP.Net.



-ir                 Install this version of ASP.NET, register only. Do not
                    change any web applications to use this version.



-iru                Install this version of ASP.NET. If there are any existing
                    applications that uses ASP.NET, it will not change IIS
                    configuration to use this version.
Camlet answered 9/12, 2014 at 23:44 Comment(0)
I
3

I Faced an issue where localhost was not running(i.e. the website did not load).

I had installed IIS 10.0 express after I had installed Visual Studio along with .NET framework.

Due to this later installation of IIS , localhost did not load.

I ran aspnet_regiis -i under the path

C:\Windows\Microsoft.NET\Framework64\v4.0.30319

This sucessfully solved the issue.

Insurgent answered 9/3, 2018 at 7:20 Comment(0)
D
3

It is useful to me to encrypt portions of my WebConfig file (In my case the connectionStrings).

Commands:

-- Go to regiss.exe directory
C:\Users\myuser>cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319

-- Execute the encryption
C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis.exe -pef "connectionStrings" "C:\Users\MyPublishPath"

This will encrypt your conecctionStrings from this:

<connectionStrings>
  <add name="MyProjectDB" connectionString="Data Source=192.168.X.X;Initial Catalog=MyProjectDB;User ID=User;Password=Pass" providerName="SqlClient" />
</connectionStrings>

To this:

<connectionStrings configProtectionProvider="RsaProtectedConfigurationProvider">
  <EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
  <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" />
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
  <EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#">
    <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" />
    <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
      <KeyName>Rsa Key</KeyName>
    </KeyInfo>
    <CipherData>
      <CipherValue>ml2OVkgtMhrLcrTQfop5eR0D6eq6Q0a3qSOejeiMrB532H2LOHg8odKoDDTARbTrrZ1/x11Ur7GMHAYeemyBbXT5HCzbNGkMJfRBc=</CipherValue>
    </CipherData>
  </EncryptedKey>
</KeyInfo>
<CipherData>
  <CipherValue>H40nekXYEPWO+wbAh78FyzRM8s2t+UEo6h8NhN52BvbTqVOGlhS6+fBfbqdEvH5STExSeY2ftSUXEzNZ+PT6t2HgcpWk45FC3yw==</CipherValue>
</CipherData>

Dilapidate answered 13/1, 2020 at 18:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.