Windows Server 2008 R2 上的 WCF .NET 4.5

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20784908/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 12:35:17  来源:igfitidea点击:

WCF .NET 4.5 on Windows Server 2008 R2

.netwcfwindows-server-2008.net-4.5windows-server-2008-r2

提问by Zasz

In Windows Server 2008 R2, I cannot activate WCF Http/Tcp Activation windows features for .net 4.5 from Server Manager

在 Windows Server 2008 R2 中,我无法从服务器管理器激活 .net 4.5 的 WCF Http/Tcp 激活窗口功能

enter image description here

在此处输入图片说明

Server manager in Windows Server 2008 R2 does not support .net 4.5, even though .net 4.5 can be installed and used in IIS in Windows Server 2008 R2.

Windows Server 2008 R2 中的服务器管理器不支持 .net 4.5,即使可以在 Windows Server 2008 R2 的 IIS 中安装和使用 .net 4.5。

I can activate in my local Windows 8, using Turn Windows feature on/off window. The same Turn Windows feature on/off window link in Windows Server 2008 takes you to Server Manager

我可以在本地 Windows 8 中使用“打开/关闭 Windows”功能窗口激活。Windows Server 2008 中相同的“打开/关闭 Windows 功能”窗口链接会将您带到服务器管理器

enter image description here

在此处输入图片说明

Powershell also does not list it on Server 2008. How to install HTTP Activation and TCP Activation for WCF services under .NET Framework 4.5 Advanced Services in Windows Server 2008?

Powershell 也没有在 Server 2008 上列出它。如何在 Windows Server 2008 中为 .NET Framework 4.5 高级服务下的 WCF 服务安装 HTTP 激活和 TCP 激活?

回答by Zasz

P_G's comment is correct. If that is checked, and .net45 installed later, it installs with those features.

P_G 的评论是正确的。如果选中,并且稍后安装 .net45,它会安装这些功能。

I wanted to turn it on for .net45 primarily to fix the <system.serviceModel>section not defined error, that occurs if WCF activation services are not running.

我想为 .net45 打开它,主要是为了修复<system.serviceModel>未定义的部分错误,如果 WCF 激活服务没有运行,就会发生这种错误。

I also noticed that powershell continues to throw the above error, when using Set-WebConfigurationPropertyThis is because powershell in server 2008 tries to parse the web.config from a .net 2.0 context (.net 3.5 and 3.0 shares config files location with .net 2.0 - c:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config) and fails - because in that location system.serviceModel is not defined there.

我还注意到 powershell 在使用时继续抛出上述错误Set-WebConfigurationProperty这是因为 server 2008 中的 powershell 试图从 .net 2.0 上下文中解析 web.config(.net 3.5 和 3.0 与 .net 2.0 共享配置文件位置 - c:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config)并失败 - 因为在那个位置 system.serviceModel 没有在那里定义。

The application however works fine, because the IIS website uses (c:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config) and it isdefined there.

然而,该应用程序运行良好,因为 IIS 网站使用 ( c:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config) 并且它那里定义。

Checking that checkbox defines the section in c:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.configas well - so powershell can also now parse web.config and set-iis properties.

选中该复选框也定义了该部分c:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config- 因此 powershell 现在也可以解析 web.config 和 set-iis 属性。