如何在 Windows Server 2008 R2 上安装 Net.Tcp 端口共享服务?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5516989/
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-15 16:32:11  来源:igfitidea点击:

How to install Net.Tcp Port Sharing Service on Windows Server 2008 R2?

windowswcf

提问by smwikipedia

I deleted the Net.Tcp Port Sharing Service with sc deletecommand, now when I try to install Application Server Role, it give me the following error:

我使用sc delete命令删除了 Net.Tcp 端口共享服务,现在当我尝试安装Application Server Role 时,它给了我以下错误:

Attempt to install TCP Port Sharing failed with error code 0x80070404. The specified service does not exist as an installed service.

尝试安装 TCP 端口共享失败,错误代码为 0x80070404。指定的服务不作为已安装的服务存在。

How to solve this? Re-install Windows Server 2008 is not an option.

如何解决这个问题?重新安装 Windows Server 2008 不是一种选择。

Thanks.

谢谢。

回答by krisragh MSFT

Microsoft .NET Framework 3.5.1 is included Windows Server 2008 R2, and .NET Framework 2.0 Service Pack 2 is a subcomponent foundation layer of .NET Framework 3.5.1.

Microsoft .NET Framework 3.5.1 包含在 Windows Server 2008 R2 中,.NET Framework 2.0 Service Pack 2 是 .NET Framework 3.5.1 的子组件基础层。

To get Net.Tcp back on a machine with this framework release, run ServiceModelReg.exe. See somewhat detailed instructions here.

要在具有此框架版本的计算机上恢复 Net.Tcp,请运行 ServiceModelReg.exe。请参阅此处的详细说明。

The crucial part is this:

关键部分是这样的:

"%WINDIR%\Microsoft.Net\Framework\v4.0.30319\aspnet_regiis" -i -enable "%WINDIR%\Microsoft.Net\Framework\v4.0.30319\ServiceModelReg.exe" -r

"%WINDIR%\Microsoft.Net\Framework\v4.0.30319\aspnet_regiis" -i -enable "%WINDIR%\Microsoft.Net\Framework\v4.0.30319\ServiceModelReg.exe" -r

The "-r" option in ServiceModelReg reinstalls WCF scriptmaps and services on the machine. See "ServiceModelReg.exe /?" for all the options.

ServiceModelReg 中的“-r”选项会在计算机上重新安装 WCF 脚本映射和服务。请参阅“ServiceModelReg.exe /?” 对于所有选项。

Hope this helps!

希望这可以帮助!

回答by Veeranjaneyulu Appari

  1. From the Start menu, open the Services Management Console either by opening a Command Prompt window and typing services.mscor by opening Run and typing services.mscinto the Open box.
  2. In the Name column of the list of services, right-click the Net.Tcp Port Sharing Service, and select Propertiesfrom the menu.
  3. To enable the manual start-up of the service, in the Properties window select the General tab, and in the Startup type box select Manual, and then click Apply.
  4. To start the service, in the Service status area, click the Start button. The service status should now display "Started".
  5. To return to the list of services, click the OK, and exit the MMC Console.
  1. 从“开始”菜单中,通过打开命令提示符窗口并键入services.msc或通过打开运行并在打开框中键入services.msc来打开服务管理控制台。
  2. 在服务列表的名称列中,右键单击 Net.Tcp 端口共享服务,然后从菜单中选择属性
  3. 要启用服务的手动启动,请在“属性”窗口中选择“常规”选项卡,在“启动类型”框中选择“手动”,然后单击“应用”。
  4. 要启动服务,请在服务状态区域中,单击启动按钮。服务状态现在应显示“已启动”。
  5. 要返回服务列表,请单击确定,然后退出 MMC 控制台。