使用New-WebAppPool时如何设置.NET Framework版本? [英] How do I set the .NET Framework Version when using New-WebAppPool?

查看:352
本文介绍了使用New-WebAppPool时如何设置.NET Framework版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望了解如何使用IIS PowerShell Cmdlet New-WebAppPool 来指定要使用的.NET Framework版本。目前,它默认为v2.0,但我使用的是MVC,这不起作用,因为这是一个v4.0功能。我们真的希望每个站点都有自己的应用程序池,似乎我们必须手动创建这些池,因为无法通过脚本配置它们。有没有办法自动化这个?

I'm looking to see how I can use the IIS PowerShell Cmdlet New-WebAppPool to specify the version of the .NET Framework to use. Currently, it defaults to v2.0, however I am using MVC, and this will not work because that's a v4.0 feature. We really want each site to have its own Application Pool, and it seems we must create those pools manually due to the inability to configure them via script. Is there any way to automate this?

我担心答案是你不能,因为文档似乎没有提供任何参数来设置它,谷歌正在蹲下;它给我的印象是只能以脚本方式设置站点是可以接受的,而关于配置应用程序池的一些事情就是没有完成。我无法想象为什么不 - 如果你是自动化过程的一个主要部分,为什么你不能自动化另一个主要部分?

I'm afraid the answer is going to be "you can't," because the documentation doesn't appear to offer any parameters for setting it, and Google is turning up squat; it's giving me the impression that only setting up sites in a scripted manner is acceptable, and something about configuring Application Pools is just "not done." I can't possibly imagine why not - if you're automating one major part of the process, why can you not automate the other major part?

任何可能拥有的人通过PowerShell如何做到这一点的一些见解将帮助我。

Anyone who might have some insight on how to do this via PowerShell would be helping me out greatly.

推荐答案

加载WebAdministration模块试试这个您创建的池:

With the WebAdministration module loaded try this on a pool that you've created:

Set-ItemProperty IIS:\AppPools\<pool_name> managedRuntimeVersion v4.0

这篇关于使用New-WebAppPool时如何设置.NET Framework版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆