System.ServiceProcess.dll
is in the GAC, and part of the .NET Framework.
(System.ServiceProcess.dll
在GAC中,并且是.NET Framework的一部分。)
System.ServiceProcess.ServiceController.dll
is part of the Core CLR. (System.ServiceProcess.ServiceController.dll
是Core CLR的一部分。)
But wait a minute - PowerShell is based on the .NET Framework CLR.
(但是请稍等-PowerShell基于.NET Framework CLR。)
If you build your assembly against the correct netstandard profile , and its dependencies are resolvable, it should be able to run on the .NET Framework.
(如果您根据正确的netstandard配置文件构建程序集,并且其依赖项是可解决的,则它应能够在.NET Framework上运行。)
You can see that System.ServiceProcess.dll
references kernel32
, while System.ServiceProcess.ServiceController.dll
references api-ms-win-service-core
.
(您可以看到System.ServiceProcess.dll
引用kernel32
,而System.ServiceProcess.ServiceController.dll
引用api-ms-win-service-core
。)
It's sort of the same, but the Core CLR version will have presumably less functionality.
(差不多 ,但是Core CLR版本的功能可能更少 。)
As for the others, most of the System
namespace resides in mscorlib
and System.dll
.
(至于其他的,大多数System
名称空间都位于mscorlib
和System.dll
。)
In recent years, there has been an effort to make the core library leaner by moving parts of it out, to have out-of-band delivery. (近年来,人们一直在努力通过将部分核心库移出以进行带外交付来使其更精简 。)
For example, System.Diagnostics.Process.dll
now ships as a nuget package , which enables faster rollouts to users rather than shipping a major .NET Framework update that targets are required to install.
(例如, System.Diagnostics.Process.dll
现在作为nuget软件包提供 ,从而可以更快地向用户推出,而不是交付需要安装目标的主要.NET Framework更新。)
If you're using regular Powershell and not Powershell Core , you can just reference .NET Framework assemblies and not see confusing
(如果您使用的是常规Powershell而不是Powershell Core ,则可以仅引用.NET Framework程序集,而不会混淆)