AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 791350
Accepted
SimonS
SimonS
Asked: 2016-07-23 00:37:42 +0800 CST2016-07-23 00:37:42 +0800 CST 2016-07-23 00:37:42 +0800 CST

如何更新 machineConfig64 .Net Framework 配置提供程序

  • 772

我正在尝试将 IIS 站点从具有 IIS7.5 的旧 Windows Server 2008 R2 同步到具有 IIS8.5 的新 Windows Server 2012 R2。我正在使用 WDeploySnapin3.0 PowerShell Snapin

现在我收到以下错误:

Sync-WDSite : the versions of the .NET Framework-configuration provider
(machineConfig64) differ from source (2.0) and destination (4.0). More 
information on: http://go.microsoft.com/fwlink
/?LinkId=221672#ERROR_FRAMEWORK_VERSIONS_DO_NOT_MATCH.

可以在此处找到此错误的两种解决方案:http: //go.microsoft.com/fwlink/ ?LinkId=221672#ERROR_FRAMEWORK_VERSIONS_DO_NOT_MATCH 。

第一个解决方案不符合我的需求,因为我不使用该msdeploy.exe工具。

第二个解决方案告诉我在我所做的源机器上编辑配置文件。我msdepsvc.exe.config从这个改变了:

<configuration>
  <startup  useLegacyV2RuntimeActivationPolicy="true" >
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
    <supportedRuntime version="v2.0.50727" />
  </startup>
</configuration>

对此:

<configuration>
  <startup  useLegacyV2RuntimeActivationPolicy="true" >
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
  </startup>
</configuration>

还有msdeploy.exe.config这个:

<configuration>
  <startup>
    <supportedRuntime version="v2.0.50727" />
    <supportedRuntime version="v4.0" />
  </startup>
</configuration>

对此:

<configuration>
  <startup>
    <supportedRuntime version="v4.0" />
  </startup>
</configuration>

之后我重新启动了wmsvc服务net stop wmsvc ; net start wmsvc但它没有工作,错误仍然发生

现在我只想更新我的源服务器的版本。我怎么做?.NET Framework 4.6 安装在源服务器上,我只需要在某处编辑配置吗?还是我需要更新的管理框架?

谢谢!

编辑:我也尝试只使用配置文件中的 v2.0 条目(如微软建议的那样),但它也没有工作。我也不明白为什么它说源服务器使用 .NET 2.0 - apppool 和应用程序本身使用 4.0+

windows powershell iis .net msdeploy
  • 1 1 个回答
  • 1360 Views

1 个回答

  • Voted
  1. Best Answer
    SimonS
    2016-07-25T22:21:12+08:002016-07-25T22:21:12+08:00

    这个问题的答案是不要“更新” machineConfig64 提供程序,而是以哈希表的形式告诉 PowerShell 确切地采用哪个提供程序。将哈希表作为-sourcesettings参数-destinationsettings

    [hashtable]$settings = @{
        'machineconfig32.netfxversion' = 2
        'machineconfig64.netfxversion' = 2
        'rootwebconfig32.netfxversion' = 2
        'rootwebconfig64.netfxversion' = 2
    }
    
    [...] # some more code
    
    $sync = Sync-WDSite $Name $Name -sitephysicalpath $spp `
                                    -SourcePublishSettings $publishsettings `
                                    -IncludeApppool `
                                    -WarningAction Continue `
                                    -ErrorAction Stop `
                                    -sourcesettings $settings `
                                    -destinationsettings $settings `
                                    -debug
    
    • 0

相关问题

  • 知道任何适用于 Windows 的快速可编写脚本的 ftp 客户端吗?[关闭]

  • 如果 Windows 服务崩溃,如何自动重新启动它?

  • 无法安排任务(访问被拒绝)

  • 物理机重启时自动重启虚拟机(VMWare)

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve