27

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

4

7 回答 7

18

我最喜欢的功能是能够加密 web.config 中的设置,如下所示:

aspnet_regiis -pe /myapprootvirtualdirector

解密是-pd

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

于 2011-08-23T05:57:07.247 回答
16

来自MSDN 参考

当 .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 的博客

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

于 2010-08-21T20:38:58.820 回答
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.
于 2014-12-09T23:44:34.413 回答
5

使用IIS注册ASPNET扩展。

于 2010-08-22T03:38:10.140 回答
5

它还可以修复安装的 aspnet。

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

于 2010-08-22T03:41:03.160 回答
3

我遇到了一个localhost没有运行的问题(即网站没有加载)。

我是在安装IIS 10.0 express之后安装Visual Studio.NET framework

由于后来安装IISlocalhost没有加载。

我跑到aspnet_regiis -i小路下

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

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

于 2018-03-09T07:20:24.750 回答
2

加密部分 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>

于 2020-01-13T18:45:55.453 回答