使用 WIX 在 IIS 应用程序池中设置 .NET 版本不起作用

发布于 2024-09-11 08:51:53 字数 1215 浏览 1 评论 0原文

<!-- Custom action to set the .NET version -->
<CustomAction Id="SetNetVersion_Cmd" Property="SetNetVersion"  Execute="immediate" Return="check" Value="$(var.SetNetVersionCmd)" />
<CustomAction Id="SetNetVersion" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="check" Impersonate="no"/>

<!-- Run the action -->
<InstallExecuteSequence>
  <Custom Action='SetNetVersion_Cmd' After='InstallFinalize' />
</InstallExecuteSequence>

以下是 msi 日志显示的内容:

Action 22:02:57: SetNetVersion_Cmd. 
Action start 22:02:57: SetNetVersion_Cmd.
MSI (s) (44:9C) [22:02:57:533]: PROPERTY CHANGE: Adding SetNetVersion property. Its value is '&quot;C:\Windows\\system32\inetsrv\appcmd&quot; set config -section:applicationPools -[name=&quot;PoolName&quot;].managedRuntimeVersion:v4.0'.
Action ended 22:02:57: SetNetVersion_Cmd. Return value 1.

该池确实存在,但其 .NET 版本未更改。我做错了什么?

SetNetVersionCmd 是:

'&quot;[WindowsFolder]\system32\inetsrv\appcmd&quot; set config -section:applicationPools -[\[]name=&quot;PoolName&quot;[\]].managedRuntimeVersion:v4.0'
<!-- Custom action to set the .NET version -->
<CustomAction Id="SetNetVersion_Cmd" Property="SetNetVersion"  Execute="immediate" Return="check" Value="$(var.SetNetVersionCmd)" />
<CustomAction Id="SetNetVersion" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="check" Impersonate="no"/>

<!-- Run the action -->
<InstallExecuteSequence>
  <Custom Action='SetNetVersion_Cmd' After='InstallFinalize' />
</InstallExecuteSequence>

Here is what the msi log shows:

Action 22:02:57: SetNetVersion_Cmd. 
Action start 22:02:57: SetNetVersion_Cmd.
MSI (s) (44:9C) [22:02:57:533]: PROPERTY CHANGE: Adding SetNetVersion property. Its value is '"C:\Windows\\system32\inetsrv\appcmd" set config -section:applicationPools -[name="PoolName"].managedRuntimeVersion:v4.0'.
Action ended 22:02:57: SetNetVersion_Cmd. Return value 1.

The pool does exist but its.NET version is not changed. What am I doing wrong?

The SetNetVersionCmd is:

'"[WindowsFolder]\system32\inetsrv\appcmd" set config -section:applicationPools -[\[]name="PoolName"[\]].managedRuntimeVersion:v4.0'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小红帽 2024-09-18 08:51:53

一种更简单的方法(仍然使用 AppCmd)如下所示:

AppCmd Set AppPool "PoolName" /managedRuntimeVersion:v4.0

您应该能够重用 WiX 代码的所有其余部分,只需更改变量的值即可。

A simpler way to do this (still using AppCmd) is like so:

AppCmd Set AppPool "PoolName" /managedRuntimeVersion:v4.0

You should be able to reuse all the rest of your WiX code, just changing the value of the variable.

澉约 2024-09-18 08:51:53

老帖子,但有人可能会发现这很有用,而且这个地方是一个金矿...

个人仍在使用 Wix 3.5,以及 手册指出我们可以在创建应用程序池时设置ManagedRuntimeVersion,但是文档适用于版本3.6...在我的本地帮助文件中查看ManagedRuntimeVersion。

Old post, but someone might find this useful and this place is a gold mine...

Still using Wix 3.5 personally, and the manual states that we can set the ManagedRuntimeVersion when creating an application pool, however the documentation is for version 3.6... Looking in my local help file the ManagedRuntimeVersion is not supported.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文