【问题标题】:What does aspnet_regiis.exe doaspnet_regiis.exe 有什么作用
【发布时间】:2011-04-02 02:50:45
【问题描述】:

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

【问题讨论】:

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


    【解决方案1】:

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

    aspnet_regiis -pe /myapprootvirtualdirector

    解密是-pd

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

    【讨论】:

    • 只加密你可以使用的连接字符串:aspnet_regiis -pe "connectionStrings" -pkm
    【解决方案2】:

    来自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 的工作原理有正确的理解,可用于大多数情况。

    【讨论】:

    • aspnet_regiis.exe 对安全也很有用...它可用于加密全局、机器级配置文件(machine / web.config & custom配置文件)
    【解决方案3】:

    reg 使用 IISASPNET 扩展。

    【讨论】:

    • 这不是他所说的“除了”吗? :P
    【解决方案4】:

    它还可以修复安装的 aspnet。

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

    【讨论】:

      【解决方案5】:

      请提供任何您知道的详细说明 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.
      

      【讨论】:

        【解决方案6】:

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

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

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

        我在路径下跑了aspnet_regiis -i

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

        这成功解决了问题。

        【讨论】:

          【解决方案7】:

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

          这将加密您的连接字符串:

          <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-11-13
            • 2019-06-18
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 2023-04-10
            • 2011-07-17
            • 2014-09-13
            相关资源
            最近更新 更多