aspnet_regiis.exe做了什么

时间:2010-08-21 20:34:20

标签: asp.net iis version aspnet-regiis.exe

除了更新文档映射以更正aspnet_isapi.dll版本之外,aspnet_regiis.exe的作用是什么,从inetmgr更新ASP.NET版本与运行aspnet_regiis相同,我找不到任何博客文章或描述这些步骤的文章特定的批处理命令。请提供您知道的详细说明aspnet_regiis.exe

步骤的链接

7 个答案:

答案 0 :(得分:14)

我最喜欢的功能是能够加密web.config中的设置 类似的东西:

aspnet_regiis -pe / myapprootvirtualdirector

和解密是-pd

仅在部署到服务器后才加密 - 因为除非您共享机器密钥,否则一台机器上的加密在另一台机器上无效。

答案 1 :(得分:12)

来自MSDN reference

  

当多个版本的.NET Framework在一台计算机上并行执行时,映射到ASP.NET应用程序的ASP.NET ISAPI版本确定使用哪个版本的公共语言运行时(CLR)应用程序。 ASP.NET IIS注册工具(Aspnet_regiis.exe)允许管理员或安装程序轻松更新ASP.NET应用程序的脚本映射,以指向与该工具关联的ASP.NET ISAPI版本。该工具还可用于显示所有已安装的ASP版本的状态。 NET,注册与该工具结合的ASP.NET版本,创建客户端脚本目录,并执行其他配置操作。

来自Scott Forsyth's blog

  

从ASP.NET的第一个版本开始,Microsoft提供了一个工具来控制在IIS中注册的框架版本。这个工具aspnet_regiis.exe非常灵活,能够正确理解IIS和ASP.NET的工作方式,可以用于大多数情况。

答案 2 :(得分:4)

它还可以修复aspnet的安装。

有时它会中断,您需要运行aspnet_regiis -i或-ir来修复它。

答案 3 :(得分:3)

使用 IIS reg ASPNET 扩展

答案 4 :(得分:3)

  

请提供您知道的详细说明aspnet_regiis.exe

步骤的链接

aspnet_regiis.exe -h生成有关该实用程序如何在内部工作的以下有用信息。

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.

答案 5 :(得分:2)

我遇到了localhost未运行的问题(即网站未加载)。

我在安装IIS 10.0 expressVisual Studio之后安装了.NET framework

由于稍后安装IISlocalhost未加载。

我在路径

下运行了aspnet_regiis -i

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

这成功地解决了这个问题。

答案 6 :(得分:0)

对我的WebConfig文件的某些部分(对于我而言为connectionStrings)进行加密非常有用。

命令:

-- 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"

这将从此处加密您的conecctionStrings:

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

对此:

<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>

相关问题