我的 BTDF 构建 MSI 在部署到 Biztalk 时为什么失败?

huangapple go评论114阅读模式
英文:

Why is my BTDF build msi failing to deploy into Biztalk?

问题

在我的开发机上,我使用框架4.8和BTDF V5.8进行BizTalk 2020开发。当我使用Visual Studio 2019的BizTalk扩展安装我的应用程序时,没有任何问题。并且在BizTalkDeploymentFramework.targets文件中使用以下设置:

<Target Name="SetToolsVersionParam">
    <CreateProperty Value="/tv:12.0" Condition="'$(MSBuildToolsVersion)' == '12.0'">
        <Output TaskParameter="Value" PropertyName="ToolsVersionParam" />
    </CreateProperty>
</Target>

当我构建同一项目的msi文件并将其部署到UAT中的BizTalk服务器时,我需要将SetToolsVersionParam更新为4:

<Target Name="SetToolsVersionParam">
    <CreateProperty Value="/tv:4.0" Condition="'$(MSBuildToolsVersion)' == '4.0'">
        <Output TaskParameter="Value" PropertyName="ToolsVersionParam" />
    </CreateProperty>
</Target>

问题是,为什么我不能像在我的开发机上那样将SetToolsVersionParam保持为12,然后部署到UAT服务器上?

另一个问题是,由于我在开发机上同时进行BizTalk和.NET 6开发,这一直没有问题,但最近我需要在UAT服务器上安装.NET 6运行时以供一个新的服务使用。对于SetToolsVersionParam的上述修复不再起作用。

无论SetToolsVersionParam是否为12或4,我都无法安装任何新的msi文件到服务器上。我得到以下错误消息:错误MSB4067:元素下的< ItemDefinitionGroup >是不可识别的。

我搜索了所有关于BTDF的帖子,但到目前为止还没有找到解决方法。任何帮助将不胜感激。


更新
我在两个服务器(一个正常工作的和一个出现问题的)之间运行了以下PowerShell命令,结果是相同的:

dir HKLM:\SOFTWARE\Microsoft\MSBuild\ToolsVersions\

当安装MSI时,我得到以下输出:

GetSoftwarePaths:
  Using .NET Framework Install Path 'C:\Windows\Microsoft.NET\Framework\v4.0.30319'.
  Using BizTalk Install Path 'C:\Program Files (x86)\Microsoft BizTalk Server\'.
  Using Deployment Framework Install Path 'C:\Program Files (x86)\BTS_Nexus for BizTalk 1.0.0.0\Deployment\'.
  Using Deployment Framework Tools Path 'C:\Program Files (x86)\BTS_Nexus for BizTalk 1.0.0.0\Deployment\Framework\DeployTools'.
  Using BizTalk ESB Toolkit Install Path 'C:\Program Files (x86)\Microsoft BizTalk ESB Toolkit\'.
ExportSettings:
  "C:\Program Files (x86)\BTS_Nexus for BizTalk 1.0.0.0\Deployment\Framework\DeployTools\EnvironmentSettingsExporter.exe" "C:\Program Files (x86)\BTS_Nexus for BizTalk 1.0.0.0\Deployment\EnvironmentSettings\SettingsFileGenerator.xml" "C:\Program Files (x86)\BTS_Nexus for BizTalk 1.0.0.0\Deployment\EnvironmentSettings"
  Environment Settings Spreadsheet to XML Exporter 1.7.0
  [https://github.com/tfabraham/EnvironmentSettingsManager]
  Copyright (C) 2007 Thomas F. Abraham.  All Rights Reserved.

  Importing from SettingsFileGenerator.xml...

  Output format is XmlPreprocess (multi-file).

  Exporting to Exported_LocalSettings.xml...
  Exporting to Exported_DevSettings.xml...
  Exporting to Exported_UatSettings.xml...
  Exporting to Exported_ProdSettings.xml...

  Finished.
LaunchServerDeployWizard:
  "C:\Program Files (x86)\BTS_Nexus for BizTalk 1.0.0.0\Deployment\Framework\DeployTools\SetEnvUI.exe" /c:InstallWizard.xml /p:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" /a:"Framework\BizTalkDeploymentFramework.ServerExecute.targets" /t:Deploy /clp:NoSummary /nologo /p:Interactive=True /p:ProjectFile=Deployment.btdfproj "
Build started 30/06/2023 4:16:33 PM.
Microsoft (R) Build Engine Version 2.0.50727.9031
[Microsoft .NET Framework, Version 2.0.50727.9058]
Copyright (C) Microsoft Corporation 2005. All rights reserved.

C:\Program Files (x86)\MSBuild\DeploymentFrameworkForBizTalk.0\BizTalkDeploymentFramework.targets(1801,2): error MSB4067: The element <ItemDefinitionGroup> beneath element <Project> is unrecognized.
Project "C:\Program Files (x86)\BTS_Nexus for BizTalk 1.0.0.0\Deployment\Framework\BizTalkDeploymentFramework.ServerExecute.targets" on node 1 (Deploy target(s)).
Copy:
  Copying file from "..\..\DeployResults\DeployResults.txt" to "..\..\DeployResults\DeployResults_UAT-BIZTALK1_20230630_1616.txt".
  copy /y "..\..\DeployResults\DeployResults.txt" "..\..\DeployResults\DeployResults_UAT-BIZTALK1_20230630_1616.txt"
PauseForError:
  *************************************
  ************* FAILED! ***************
  *************************************
  Press a key to continue...

与在正常工作的服务器上的msi输出的上述输出进行比较时,我在GetSoftwarePaths部分看到了差异:

这个正常工作的服务器使用以下路径:

Using .NET Framework Install Path 'C:\Windows\Microsoft.NET\Framework\v2.0.50727'

而出现问题的服务器使用以下路径:

Using .NET Framework Install Path 'C:\Windows\Microsoft.NET\Framework\v4.0.30319'.

我应该在哪里以及如何更改以使用正确的框架?因为这似乎是问题的根本原因。

英文:

I have a dev machine where I do my development for biztalk 2020 using framework 4.8 and BTDF V5.8. When I install my apps using the Visual studio 2019 Biztalk extensions I can install the applications no issues. And the with the following settings in BizTalkDeploymentFramework.targets.

&lt;Target Name=&quot;SetToolsVersionParam&quot;&gt;
&lt;CreateProperty Value=&quot;/tv:12.0&quot; Condition=&quot;&#39;$(MSBuildToolsVersion)&#39; == &#39;12.0&#39;&quot;&gt;
&lt;Output TaskParameter=&quot;Value&quot; PropertyName=&quot;ToolsVersionParam&quot; /&gt;
&lt;/CreateProperty&gt;
&lt;/Target&gt;

When I build an msi of the same project and I deploy it to biztalk sever in UAT, I need to update the SetToolsVersionParam to 4.

&lt;Target Name=&quot;SetToolsVersionParam&quot;&gt;
&lt;CreateProperty Value=&quot;/tv:4.0&quot; Condition=&quot;&#39;$(MSBuildToolsVersion)&#39; == &#39;4.0&#39;&quot;&gt;
&lt;Output TaskParameter=&quot;Value&quot; PropertyName=&quot;ToolsVersionParam&quot; /&gt;
&lt;/CreateProperty&gt;
&lt;/Target&gt;

Question why can I not leave my SetToolsVersionParam at 12 for deployment to the UAT server like on my dev machine?

Another Question, as I do both both biztalk and .net6 development on the dev machine, this has not been an issue, however I recently need to install the .net6 runtime on the UAT server for a new service and the fix above for SetToolsVersionParam stopped working.

I cannot get any new msi's to install on the server. I get the following irrespective if the SetToolsVersionParam is 12 or 4. Error MSB4067: The element <ItemDefinitionGroup> beneath element <Project> is unrecognized.

I search all post regarding BTDF, but I have been unable to find a resolution as yet.

Any help will be appreciated.


Update:
I ran the following PowerShell command between the 2 (Working server and one that is failing) the result is the same.

dir HKLM:\SOFTWARE\Microsoft\MSBuild\ToolsVersions\


    Hive: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions


Name                           Property
----                           --------
2.0                            MSBuildToolsPath : C:\windows\Microsoft.NET\Framework64\v2.0.50727\
3.5                            MSBuildToolsPath : C:\windows\Microsoft.NET\Framework64\v3.5\
4.0                            FrameworkSDKRoot      : $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft
                                                       SDKs\Windows\v7.0A@InstallationFolder)
                               MSBuildRuntimeVersion : 4.0.30319
                               MSBuildToolsPath      : C:\Windows\Microsoft.NET\Framework64\v4.0.30319\
                               MSBuildToolsPath32    : $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSB
                               uild\ToolsVersions.0@MSBuildT
                                                       oolsPath)
                               MSBuildToolsRoot      : C:\Windows\Microsoft.NET\Framework64\
                               SDK35ToolsPath        : $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft
                                                       SDKs\Windows\v7.0A\WinSDK-NetFx35Tools-x86@InstallationFolder)
                               SDK40ToolsPath        : $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft
                                                       SDKs\Windows\v7.0A\WinSDK-NetFx40Tools-x86@InstallationFolder)

When installing the MSI I get the following output:

GetSoftwarePaths:
  Using .NET Framework Install Path &#39;C:\Windows\Microsoft.NET\Framework\v4.0.30319&#39;.
  Using BizTalk Install Path &#39;C:\Program Files (x86)\Microsoft BizTalk Server\&#39;.
  Using Deployment Framework Install Path &#39;C:\Program Files (x86)\BTS_Nexus for BizTalk 1.0.0.0\Deployment\&#39;.
  Using Deployment Framework Tools Path &#39;C:\Program Files (x86)\BTS_Nexus for BizTalk 1.0.0.0\Deployment\Framework\De
  ployTools&#39;.
  Using BizTalk ESB Toolkit Install Path &#39;C:\Program Files (x86)\Microsoft BizTalk ESB Toolkit\&#39;.
ExportSettings:
  &quot;C:\Program Files (x86)\BTS_Nexus for BizTalk 1.0.0.0\Deployment\Framework\DeployTools\EnvironmentSettingsExporter.
  exe&quot; &quot;C:\Program Files (x86)\BTS_Nexus for BizTalk 1.0.0.0\Deployment\EnvironmentSettings\SettingsFileGenerator.xml
  &quot; &quot;C:\Program Files (x86)\BTS_Nexus for BizTalk 1.0.0.0\Deployment\EnvironmentSettings&quot;
  Environment Settings Spreadsheet to XML Exporter 1.7.0
  [https://github.com/tfabraham/EnvironmentSettingsManager]
  Copyright (C) 2007 Thomas F. Abraham.  All Rights Reserved.

  Importing from SettingsFileGenerator.xml...

  Output format is XmlPreprocess (multi-file).

  Exporting to Exported_LocalSettings.xml...
  Exporting to Exported_DevSettings.xml...
  Exporting to Exported_UatSettings.xml...
  Exporting to Exported_ProdSettings.xml...

  Finished.
LaunchServerDeployWizard:
  &quot;C:\Program Files (x86)\BTS_Nexus for BizTalk 1.0.0.0\Deployment\Framework\DeployTools\SetEnvUI.exe&quot; /c:InstallWiza
  rd.xml /p:&quot;C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe&quot; /a:&quot;Framework\BizTalkDeploymentFramework.Server
  Execute.targets /t:Deploy /clp:NoSummary /nologo /p:Interactive=True /p:ProjectFile=Deployment.btdfproj &quot;

Build started 30/06/2023 4:16:33 PM.
Microsoft (R) Build Engine Version 2.0.50727.9031
[Microsoft .NET Framework, Version 2.0.50727.9058]
Copyright (C) Microsoft Corporation 2005. All rights reserved.

C:\Program Files (x86)\MSBuild\DeploymentFrameworkForBizTalk.0\BizTalkDeploymentFramework.targets(1801,2): error MSB4067: The element &lt;ItemDefinitionGroup&gt; beneath element &lt;Project&gt; is unrecognized.
Project &quot;C:\Program Files (x86)\BTS_Nexus for BizTalk 1.0.0.0\Deployment\Framework\BizTalkDeploymentFramework.ServerE
xecute.targets&quot; on node 1 (Deploy target(s)).
Copy:
  Copying file from &quot;..\..\DeployResults\DeployResults.txt&quot; to &quot;..\..\DeployResults\DeployResults_UAT-BIZTALK1_20230630
  _1616.txt&quot;.
  copy /y &quot;..\..\DeployResults\DeployResults.txt&quot; &quot;..\..\DeployResults\DeployResults_UAT-BIZTALK1_20230630_1616.txt&quot;
PauseForError:
  *************************************
  ************* FAILED! ***************
  *************************************
  Press a key to continue...

When I compare this with the above output with the msi output on the server that worked I see a difference in the GetSoftwarePaths section:

Using .NET Framework Install Path &#39;C:\Windows\Microsoft.NET\Framework\v2.0.50727&#39;.
                Using BizTalk Install Path &#39;C:\Program Files (x86)\Microsoft BizTalk Server\&#39;.
                Using Deployment Framework Install Path &#39;C:\Program Files (x86)\BTS_Nexus for BizTalk 1.0.0.0\Deployment\&#39;.
                Using Deployment Framework Tools Path &#39;C:\Program Files (x86)\BTS_Nexus for BizTalk 1.0.0.0\Deployment\Framework\DeployTools&#39;.
                Using BizTalk ESB Toolkit Install Path &#39;C:\Program Files (x86)\Microsoft BizTalk ESB Toolkit\&#39;.

This one that working uses

Using .NET Framework Install Path &#39;C:\Windows\Microsoft.NET\Framework\v2.0.50727

and the one that is not working is using

Using .NET Framework Install Path &#39;C:\Windows\Microsoft.NET\Framework\v4.0.30319&#39;.

Where and how do I change this to use the correct framework?
As this seems to be the issue.

答案1

得分: 0

我成功安装了我的MSI。
在比较了两台服务器上的Microsoft.Net后,我发现了一个额外的文件夹"Primary Interop Assemblies",我将该文件夹重命名了。
我还比较了两台服务器上Microsoft.Net和MSBuild文件夹的内容。
文件"BizTalkDeploymentFramework.targets"有轻微的更改,从内容比较来看,似乎只是格式上的变化,但我用工作的服务器上的文件替换了它。

这样做后,MSI安装成功了。

感谢您的所有帮助和支持。

英文:

I manage to get my msi installed.
After comparing the Microsoft.Net on both servers I found the an extra folder Primary Interop Assemblies which I renamed the folder.
I also compared the contents of Microsoft.Net and MSBuild folders between the 2 servers.
There was a slight change in file BizTalkDeploymentFramework.targets, which from comparing the contents seemed to be more formatting, but I replaced the file with the file from the server that works.

This worked and the msi installed.

Thanks for all the help and support.

huangapple
  • 本文由 发表于 2023年6月19日 13:01:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/76503720.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定