Closed janPORG closed 1 year ago
I believe I'm running into the same thing.
I have the SCOM console from 2022 installed on my dev system, and have imported the same Microsoft.EnterpriseManagement.*.dlls into my .NET Core 7 app (brand new project), and I'm encountering the same error as shown in the subject line.
A simple ManagementGroup.Connect() failed with a FileNotFoundException for System.ServiceModel, which led me to install System.ServiceModel.Primitives from NuGet, then System.ServiceModel.Duplex. Now I'm the same MissingMethodException.
I finally got a chance to download the SCOM 2022 SDK and took a look at the implementation. Those assemblies are targeting .NET Framework and are only able to even start trying to run because of a compatibility shim we have in the 4.x packages. Unfortunately, it's not good news. There's a lot missing which it depends on. Here's a few of the problems:
Rather than use the built in compression support for BinaryMessageEncodingBindingElement, they built their own GZipMessageEncodingBindingElement. This won't work as it overrides methods in BindingElement which don't exist in these packages, e.g. public override IChannelListener<TChannel> BuildChannelListener<TChannel>(BindingContext context)
. As soon as you try to instantiate an instance of that, it will throw a CLR runtime exception as the type isn't compatible with the base type.
The custom binding constructed uses TransactionFlowBindingElement which we haven't ported yet. Distributed transaction support wasn't even added until .NET 7.
The custom binding uses SecurityBindingElement.CreateSspiNegotiationOverTransportBindingElement(). We don't yet have support for this method as we didn't have a public cross platform way to implement this until .NET 7.
That was what I found with looking at the code for about 2 minutes. I'm sure there's more than that missing. Basically, they used all the features in WCF and many of them haven't even been possible to implement until just recently.
Starting with the next soon to be released packages, we won't be supporting the compatibility shim as we can no longer support netstandard2.0. This means even once these features are implemented, the SCOM SDK assemblies still won't be usable as there is no longer a System.ServiceModel.dll shim shipped with the packages.
Does this release of WCF support for .NET 6.0 and above help?
https://devblogs.microsoft.com/dotnet/wcf-client-60-has-been-released/
@MikeSargent, it won't help. The SCOM SDK needs to be modified slightly (to remove server api usage) and recompiled, but also there's still at least a couple of feature dependencies missing in WCF.
Hi,
I am porting a project from .NET 4.8 to dotnet core 6/7. I need to use the SCOM 2022 SDK
I also installed latest nuget packages
Starting with an exception in
ManagementGroup _MGCon = new ManagementGroup("localhost");
which lead me to Microsoft.EnterpriseManagement.Core.dllwhich contains a call to
and this is failing with
In dotnet core I can not find an implementation for
EndpointIdentity.CreateSpnIdentity("");
nor an EndpointAddress constructor which takesnew AddressHeaderCollection()
Is there a possibility to get around that issue?
Thanks in advance, Br, Jan