microsoft-graph-comms-samples icon indicating copy to clipboard operation
microsoft-graph-comms-samples copied to clipboard

SetMediaPlatformSettings() Failed with SEHException

Open KanaHayama opened this issue 3 months ago • 12 comments

Describe the issue The Media Platform fails to initialize, causing the entire application to halt.

Code Snippet

/* Build client */
var builder = new CommunicationsClientBuilder(_appOptions.Value.Name, _appOptions.Value.Id, _graphLogger);
builder.SetAuthenticationProvider(_authProvider);
Debug.Assert(!string.IsNullOrEmpty(_options.Value.NotificationUrl));
builder.SetNotificationUrl(new Uri(_options.Value.NotificationUrl));
Debug.Assert(!string.IsNullOrWhiteSpace(_options.Value.CertificateThumbprint));
var certificate = GetCertificate(_options.Value.CertificateThumbprint);
var mediaPlatformSettings = new MediaPlatformSettings() {
    MediaPlatformInstanceSettings = new() {
        Certificate = certificate,
        InstanceInternalPort = _options.Value.InstanceInternalPort,
        InstancePublicIPAddress = IPAddress.Any,
        InstancePublicPort = _options.Value.InstancePublicPort,
        ServiceFqdn = _options.Value.ServiceFqdn,
    },
    ApplicationId = _appOptions.Value.Id,
    MediaPlatformLogger = _mediaPlatformLogger,
};
builder.SetMediaPlatformSettings(mediaPlatformSettings);
builder.SetServiceBaseUrl(new Uri(PlaceCallEndpointUrl));
_clinet = builder.Build();
_clinet.OnNotificationQueued += OnNotificationQueued;
_clinet.OnNotificationProcessed += OnNotificationProcessed;
_clinet.OnNotificationException += OnNotificationException;

Expected behavior Execute without error.

Graph SDK (please complete the following information):

  • Target Framework: net8.0-windows
  • Target Platform: x64
  • C++ Redistributable: x64 14.44.35211
  • Microsoft.Graph.Communications.Client: 1.2.0.15382
  • Microsoft.Graph.Communications.Calls.Media: 1.2.0.15382
  • Microsoft.Skype.Bots.Media: 1.31.0.225-preview

Call ID N/A

Logs

[17:00:01 INF] User profile is available. Using 'C:\Users\***\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest. <s:Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager>
[17:00:14 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Created a new Aria trace listener with token ***-***-***-***-***-***-*** <s:***.***.MediaPlatformLogger>
[17:00:14 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Setting MediaAgents platform log level to Information <s:***.***.MediaPlatformLogger>
[17:00:14 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Setting MediaApiLogLevel to Warning <s:***.***.MediaPlatformLogger>
[17:00:14 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Setting AvMP log level to Error <s:***.***.MediaPlatformLogger>
[17:00:14 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Attempting to apply the UnifiedLogging configuration: UnifiedLoggingConfiguration: [ IsEnabled: False ScenarioStrings:  ] <s:***.***.MediaPlatformLogger>
[17:00:14 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Setting UnifiedLogging Info: [isEnabled: False] [ScenarioStrings: ] <s:***.***.MediaPlatformLogger>
[17:00:14 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Logger initialized for application ID ***-***-***-***-***. Logging configuration: LoggingConfiguration: [ MediaAgentsPlatformLogLevel: Information; MediaApiLogLevel: Warning; MediaProcessorLogLevel: Error; AriaLoggingConfiguration: AriaLoggingConfiguration: [ AriaTenantToken: ***-***-***-***-***-***-***; AriaTraceEventName: SkypeMediaBotsTraces; SplitAriaTracesByLevel: True; DisableAriaTracing:  ]; UnifiedLoggingConfiguration: UnifiedLoggingConfiguration: [ IsEnabled: False ScenarioStrings:  ] ] <s:***.***.MediaPlatformLogger>
[17:00:14 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Whitelist config value changed: cipnoam.api.mpaas.trafficmanager.net,intnoam.api.mpaas.trafficmanager.net,dognoam.api.mpaas.trafficmanager.net,prdnoam.api.mpaas.trafficmanager.net,prdapac.api.mpaas.trafficmanager.net,prdemea.api.mpaas.trafficmanager.net,prd00apac.mpaas.trafficmanager.net,prd00noam.mpaas.trafficmanager.net,prd00emea.mpaas.trafficmanager.net,mediapaas-api-test-01-wus.cloudapp.net,ucapnoam.api.mpaas.trafficmanager.net,mediapaas-api-apac.pub.ngcmtls.com,mediapaas-api-aus.pub.ngcmtls.com,mediapaas-api-dog.pub.ngcmtls.com,mediapaas-api-emea.pub.ngcmtls.com,mediapaas-api-int.pub.ngcmtls.com,mediapaas-api-noam.pub.ngcmtls.com,mediapaas-api-test.pub.ngcmtls.com,mediapaas-api-prod.gov.ngcmtls.us,mediapaas-api-prod.dod.ngcmtls.us,mediapaas-api.pub.ngcmtls.com,mediapaas-api-prd.pub.ngcmtls.com,mediapaas-api-mp.pub.ngcmtls.com,mediapaas-api-mp.dod.ngcmtls.us,mediapaas-api-mp.gov.ngcmtls.us,mediapaas-api-mp.ngcmtls.cn,mediapaas-api-mp.teams.azclient.eaglex.ic.gov,mediapaas-api-mp.teams.azclient.microsoft.scloud <s:***.***.MediaPlatformLogger>
[17:00:14 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] IssuerChainList changed: [ameroot,AME G1 TLS RSA 2048 SHA256 2024 CUS CA 07],[ameroot,AME G1 TLS RSA 2048 SHA256 2024 EUS2 CA 07],[ameroot,AME G1 TLS RSA 2048 SHA256 2024 EUS2EUAP CA 07],[ameroot,AME G1 TLS RSA 2048 SHA256 2024 WCUS CA 07],[ameroot,AME G1 TLS RSA 2048 SHA256 2024 WUS2 CA 07],[ameroot,AME INFRA CA 01],[ameroot,AME Infra CA 02],[ameroot,AME Infra CA 03],[ameroot,AME Infra CA 04],[ameroot,AME Infra CA 05],[ameroot,AME Infra CA 06],[Baltimore CyberTrust Root,MSFT BALT RS256 CA],[DigiCert Global Root CA,DigiCert SHA2 Secure Server CA],[DigiCert Global Root CA,DigiCert TLS Hybrid ECC SHA384 2020 CA1],[DigiCert Global Root CA,DigiCert TLS RSA SHA256 2020 CA1],[DigiCert Global Root G2,DigiCert Global G2 TLS RSA SHA256 2020 CA1],[DigiCert Global Root G2,Microsoft Azure RSA TLS Issuing CA 03],[DigiCert Global Root G2,Microsoft Azure RSA TLS Issuing CA 04],[DigiCert Global Root G2,Microsoft Azure RSA TLS Issuing CA 07],[DigiCert Global Root G2,Microsoft Azure RSA TLS Issuing CA 08],[DigiCert Global Root G2,MSFT RS256 CA-1],[DigiCert Global Root G3,Microsoft Azure ECC TLS Issuing CA 03],[DigiCert Global Root G3,Microsoft Azure ECC TLS Issuing CA 04],[DigiCert Global Root G3,Microsoft Azure ECC TLS Issuing CA 07],[DigiCert Global Root G3,Microsoft Azure ECC TLS Issuing CA 08],[Entrust Root Certification Authority - G2,Entrust Certification Authority - L1K],[Entrust Root Certification Authority - G2,Entrust Certification Authority - L1M],[Microsoft ECC Root Certificate Authority 2017,Microsoft Azure ECC TLS Issuing CA 03],[Microsoft ECC Root Certificate Authority 2017,Microsoft Azure ECC TLS Issuing CA 04],[Microsoft ECC Root Certificate Authority 2017,Microsoft Azure ECC TLS Issuing CA 07],[Microsoft ECC Root Certificate Authority 2017,Microsoft Azure ECC TLS Issuing CA 08],[Microsoft ECC Root Certificate Authority 2017,Microsoft ECC TLS Issuing AOC CA 01],[Microsoft ECC Root Certificate Authority 2017,Microsoft ECC TLS Issuing AOC CA 02],[Microsoft ECC Root Certificate Authority 2017,Microsoft ECC TLS Issuing EOC CA 01],[Microsoft ECC Root Certificate Authority 2017,Microsoft ECC TLS Issuing EOC CA 02],[Microsoft RSA Root Certificate Authority 2017,Microsoft Azure RSA TLS Issuing CA 03],[Microsoft RSA Root Certificate Authority 2017,Microsoft Azure RSA TLS Issuing CA 04],[Microsoft RSA Root Certificate Authority 2017,Microsoft Azure RSA TLS Issuing CA 07],[Microsoft RSA Root Certificate Authority 2017,Microsoft Azure RSA TLS Issuing CA 08],[Microsoft RSA Root Certificate Authority 2017,Microsoft RSA TLS Issuing AOC CA 01],[Microsoft RSA Root Certificate Authority 2017,Microsoft RSA TLS Issuing AOC CA 02],[Microsoft RSA Root Certificate Authority 2017,Microsoft RSA TLS Issuing EOC CA 01],[Microsoft RSA Root Certificate Authority 2017,Microsoft RSA TLS Issuing EOC CA 02] <s:***.***.MediaPlatformLogger>
[17:00:14 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Comparing bots version 1.31.0.0225 and minimum supported version 0.0.0.0 <s:***.***.MediaPlatformLogger>
[17:00:14 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Platform has 24 cores <s:***.***.MediaPlatformLogger>
[17:00:14 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Initializing MP with Service FQDN: ***, Instance public port: ***, Instance internal port: *** <s:***.***.MediaPlatformLogger>
[17:00:14 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] UseMPAzureAppHostPerfCounterProvider is false. Discarding MP perf counters <s:***.***.MediaPlatformLogger>
[17:00:14 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] MediaPerf is not registered: no key found at SYSTEM\CurrentControlSet\Services\MediaPerf\Performance <s:***.***.MediaPlatformLogger>
[17:00:14 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] UseMPAzureAppHostPerfCounterProvider is false. Not checking for perf counter registration <s:***.***.MediaPlatformLogger>
[17:00:32 FTL] Host terminated unexpectedly. <s:>
Status Code: 0
Microsoft.Graph.Communications.Core.Exceptions.ServiceException: Media platform failed to initialize
 ---> System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.
   at Microsoft.Rtc.Internal.Media.EngineAPI.CreateEngineApiInstance(IntPtr& pEngine, String pQualifier, Boolean pEnableAudioDevices, Boolean pEnableVideoDevices, Boolean pEnableHealth, RtpSystemConfig pSystemConfig, RtpSystemPriority pSystemPriority)
   at Microsoft.Rtc.Internal.Media.RtpPlatformInternal.<InnerInitialize>b__149_0()
   at Microsoft.Rtc.Internal.Media.RtpPlatformInternal.ExecuteUnderMonitor[T,O](T objectToAcquireMonitor, Func`1 f)
   at Microsoft.Rtc.Internal.Media.RtpPlatformInternal.InnerInitialize()
   at Microsoft.Rtc.Internal.Media.RtpPlatformInternal.<>c__DisplayClass35_0.<.ctor>b__0()
   at Microsoft.Rtc.Internal.Media.RtpPlatformInternal.ExecuteUnderMonitor[T,O](T objectToAcquireMonitor, Func`1 f)
   at Microsoft.Rtc.Internal.Media.RtpPlatformInternal..ctor(RtpPlatform platform, String traceQualifier, Boolean enableAudioDevices, Boolean enableVideoDevices, Boolean enableHealth, RtpSystemConfig systemConfig, RtpSystemPriority systemPriority)
   at Microsoft.Rtc.Internal.Media.RtpPlatform..ctor(String traceQualifier, Boolean enableAudioDevices, Boolean enableVideoDevices, Boolean enableHealth, RtpSystemConfig systemConfig, RtpSystemPriority systemPriority)
   at Microsoft.Rtc.Internal.Media.RtpPlatform..ctor(Boolean enableAudioDevices, Boolean enableVideoDevices, Boolean enableHealth, RtpSystemConfig systemConfig)
   at Microsoft.Rtc.MPService.MediaStackPlatform..ctor(Boolean enableHealth, Boolean enableAudioDevices, Boolean enableVideoDevices)
   at Microsoft.Rtc.MPService.MediaStackFactory.CreateMediaPlatform()
   at Microsoft.Rtc.MPService.MPPlatform.get_MediaPlatform()
   at Microsoft.Rtc.Internal.MediaProcessor.WebAPI.DynamicCapacityEstimatorFromStack..ctor(IMPHostLogger logger, MPHealthManagerSettings healthSettings, IMpServiceHostMetricsFactory metricsLogger, IWebApiSettings webApiSettings)
   at Microsoft.Rtc.Internal.MediaProcessor.WebAPI.MPHealthManager.Initialize(MPHealthManagerSettings settings, Boolean enableCPUPerfCounterMonitor)
   at Microsoft.Rtc.Internal.MediaProcessor.WebAPI.MediaProcessorHost..ctor(MediaProcessorHostSettings settings, IMPHostLogger logger, IMPHealthManager healthManager, IMPServiceCounterProvider perfProvider, IMpServiceHostMetricsFactory mpServiceHostMetricsFactory, IRateTracker contextRateTracker)
   at Microsoft.Rtc.Internal.MediaProcessor.WebAPI.WebApiStartup.ConfigureContainerBase(IUnityContainer container)
   at Microsoft.Rtc.MPService.Internal.NetCoreBootstrap.AspNetCoreStartup.ConfigureContainer(IUnityContainer container)
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
   at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.AspNetCore.Hosting.ConfigureContainerBuilder.InvokeCore(Object instance, Object container)
   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.ConfigureContainerImpl[TContainer](HostBuilderContext context, TContainer container)
   at Microsoft.Extensions.Hosting.HostBuilder.InitializeServiceProvider()
   at Microsoft.Extensions.Hosting.HostBuilder.Build()
   at Microsoft.Rtc.MPService.Internal.NetCoreBootstrap.MPAzureHttpAppHostNetCore.RunWebServer(String localBaseAddress, String publicBaseAddress)
   at Microsoft.Rtc.MPService.Internal.MPAzureAppHost.InitializeHttp(String localBaseAddress, String publicBaseAddress, IWebApiSettings webApiSettings, IMPServiceCounterProvider perfCounterProvider, IMPLogger logger, DelegatingHandler authorizationHandler, X509Certificate2 certificate, ICustomCertificateValidator certificateValidator)
   at Microsoft.Skype.Bots.Media.MPAzureAppHostWrapper.Initialize(String publicRoleInstanceFQDN, X509Certificate2 certificate, MPServiceEventDelegate eventDelegate, GetTrustedServersDelegate getTrustedServersDelegate, String alternateConfigFilePath, IMPServiceCounterProvider perfCounterProvider, IMPLogger mpLogger, Boolean enableMediaStackPerConferenceTracing, HttpSettings httpSettings, ICustomCertificateValidator customCertificateValidator)
   at Microsoft.Skype.Internal.Bots.Media.InternalMediaPlatform.Initialize(MediaPlatformSettings settings, IConfigurationManager configurationManager, Boolean isTest)
   at Microsoft.Skype.Bots.Media.MediaPlatform.Initialize(MediaPlatformSettings settings, IConfigurationManager configManager, Boolean isTest)
   at Microsoft.Skype.Bots.Media.MediaPlatform.Initialize(MediaPlatformSettings settings)
   at Microsoft.Graph.Communications.Calls.Media.MediaCommunicationsClientBuilderExtensions.SetMediaPlatformSettings(ICommunicationsClientBuilder statefulClientBuilder, MediaPlatformSettings mediaSettings)
   --- End of inner exception stack trace ---
   at Microsoft.Graph.Communications.Calls.Media.MediaCommunicationsClientBuilderExtensions.SetMediaPlatformSettings(ICommunicationsClientBuilder statefulClientBuilder, MediaPlatformSettings mediaSettings)
   at ***.***.Services.BotServices.BotService..ctor(IRequestAuthenticationProvider authProvider, IOptions`1 appOptions, IOptions`1 options, IGraphLogger graphLogger, IMediaPlatformLogger mediaPlatformLogger, ILogger`1 logger, IServiceProvider serviceProvider) in D:\***\***\Services\BotServices\BotService.cs:line 87
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithManyArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
   at ***.***.Program.Main(String[] args) in D:\***\***\Program.cs:line 13

Additional context I am resuming an old project that was running well a year ago. It uses .NET 8.0 with Microsoft.Skype.Bots.Media version 1.27.0.2-alpha, together with Microsoft.Graph.Communications packages version 1.2.0.10563. A couple of days ago, when I ran the project as is, I found that the ASP.NET Core server launched successfully, including the Media Platform, but when I requested the bot to join a meeting, an SEHException was thrown. The exception looks like this:

[17:24:11 DBG] Joining a meeting at https://teams.microsoft.com/l/meetup-join/***. This call will have a scenario ID of ***-***-***-***-***. <s:***.***.Services.BotServices.BotService>
[17:24:12 ERR] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Caught exception in GetMediaStackClientEcsSettings: System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.
   at Microsoft.Rtc.Internal.Media.EngineAPI.CreateEngineApiInstance(IntPtr& pEngine, String pQualifier, Boolean pEnableAudioDevices, Boolean pEnableVideoDevices, Boolean pEnableHealth, RtpSystemConfig pSystemConfig, RtpSystemPriority pSystemPriority)
   at Microsoft.Rtc.Internal.Media.RtpPlatformInternal.<InnerInitialize>b__149_0()
   at Microsoft.Rtc.Internal.Media.RtpPlatformInternal.ExecuteUnderMonitor[T,O](T objectToAcquireMonitor, Func`1 f)
   at Microsoft.Rtc.Internal.Media.RtpPlatformInternal.InnerInitialize()
   at Microsoft.Rtc.Internal.Media.RtpPlatformInternal.<>c__DisplayClass35_0.<.ctor>b__0()
   at Microsoft.Rtc.Internal.Media.RtpPlatformInternal.ExecuteUnderMonitor[T,O](T objectToAcquireMonitor, Func`1 f)
   at Microsoft.Rtc.Internal.Media.RtpPlatformInternal..ctor(RtpPlatform platform, String traceQualifier, Boolean enableAudioDevices, Boolean enableVideoDevices, Boolean enableHealth, RtpSystemConfig systemConfig, RtpSystemPriority systemPriority)
   at Microsoft.Rtc.Internal.Media.RtpPlatform..ctor(String traceQualifier, Boolean enableAudioDevices, Boolean enableVideoDevices, Boolean enableHealth, RtpSystemConfig systemConfig, RtpSystemPriority systemPriority)
   at Microsoft.Rtc.Internal.Media.RtpPlatform..ctor(Boolean enableAudioDevices, Boolean enableVideoDevices, Boolean enableHealth, RtpSystemConfig systemConfig)
   at Microsoft.Rtc.MPService.MediaStackPlatform..ctor(Boolean enableHealth, Boolean enableAudioDevices, Boolean enableVideoDevices)
   at Microsoft.Rtc.MPService.MediaStackFactory.CreateMediaPlatform()
   at Microsoft.Rtc.MPService.MPPlatform.get_MediaPlatform()
   at Microsoft.Skype.Internal.Bots.Media.Helper.GetRtpPlatform()
   at Microsoft.Skype.Bots.Media.MPAzureAppHostWrapper.GetMediaStackClientEcsSettings() <s:***.***.MediaPlatformLogger>

So, I thought the SDK might have changed, so I updated to the versions listed in the previous section. Nothing else was changed, and I ran it again, but this time my ASP.NET Core server failed to launch. The problem occurred around the SetMediaPlatformSettings() call. I’ve included its log in a previous section. I tried several intermediate versions as well — the error behavior varied, but none of them succeeded. I can see that all these failures encountered an error in CreateEngineApiInstance(), but no details were provided, so I’m not sure what went wrong. I am running my server app with Admin privileges, and the internal port is not in use. Ngrok TCP tunnel is used. Please help, thank you!

KanaHayama avatar Oct 08 '25 00:10 KanaHayama

guessing you'll need to move to Microsoft.Skype.Bots.Media 1.31.0.225-preview

here is a list of dependencies from a working project of mine

Full dependencies (click to open) ```bash

[net8.0]: Top-level Package Requested Resolved

Azure.Identity 1.12.0 1.12.0 Azure.Security.KeyVault.Secrets 4.6.0 4.6.0 Grpc.Net.Client 2.63.0 2.63.0 Microsoft.Extensions.Logging.Abstractions 8.0.2 8.0.2 Microsoft.Graph.Communications.Calls 1.2.0.10563 1.2.0.10563
Microsoft.Graph.Communications.Calls.Media 1.2.0.10563 1.2.0.10563
Microsoft.Identity.Client 4.62.0 4.62.0 Microsoft.Skype.Bots.Media 1.31.0.225-preview 1.31.0.225-preview Scrutor 4.2.2 4.2.2 Serilog 2.12.0 2.12.0

Transitive Package Resolved

Azure.Core 1.40.0
Google.Protobuf 3.27.2
Grpc.Core.Api 2.63.0
Grpc.Net.Common 2.63.0
Microsoft.AspNet.WebApi.Client 5.2.7
Microsoft.AspNetCore.Hosting.Abstractions 2.2.0
Microsoft.AspNetCore.Hosting.Server.Abstractions 2.2.0
Microsoft.AspNetCore.Http.Abstractions 2.2.0
Microsoft.AspNetCore.Http.Features 2.2.0 Microsoft.AspNetCore.JsonPatch 6.0.6 Microsoft.AspNetCore.Mvc.NewtonsoftJson 6.0.6 Microsoft.Bcl.AsyncInterfaces 1.1.1 Microsoft.CSharp 4.7.0 Microsoft.Data.Sqlite 7.0.0 Microsoft.Data.Sqlite.Core 7.0.0 Microsoft.Extensions.Configuration.Abstractions 2.2.0 Microsoft.Extensions.DependencyInjection 8.0.1 Microsoft.Extensions.DependencyInjection.Abstractions 8.0.2 Microsoft.Extensions.DependencyModel 6.0.0 Microsoft.Extensions.FileProviders.Abstractions 2.2.0 Microsoft.Extensions.Hosting.Abstractions 2.2.0 Microsoft.Extensions.Logging 8.0.1 Microsoft.Extensions.Options 8.0.2 Microsoft.Extensions.Primitives 8.0.0 Microsoft.Graph 5.38.0 Microsoft.Graph.Communications.Client 1.2.0.10563 Microsoft.Graph.Communications.Common 1.2.0.10563 Microsoft.Graph.Communications.Core 1.2.0.10563 Microsoft.Graph.Core 3.1.3 Microsoft.Identity.Client.Extensions.Msal 4.61.3 Microsoft.IdentityModel.Abstractions 7.0.3 Microsoft.IdentityModel.JsonWebTokens 7.0.3 Microsoft.IdentityModel.Logging 7.0.3 Microsoft.IdentityModel.Protocols 7.0.3
Microsoft.IdentityModel.Protocols.OpenIdConnect 7.0.3 Microsoft.IdentityModel.Tokens 7.0.3 Microsoft.IO.RecyclableMemoryStream 2.3.2 Microsoft.Kiota.Abstractions 1.7.2 Microsoft.Kiota.Authentication.Azure 1.1.2 Microsoft.Kiota.Http.HttpClientLibrary 1.3.3 Microsoft.Kiota.Serialization.Form 1.1.1 Microsoft.Kiota.Serialization.Json 1.1.2 Microsoft.Kiota.Serialization.Multipart 1.1.1 Microsoft.Kiota.Serialization.Text 1.1.1 Microsoft.NETCore.Platforms 1.1.1 Microsoft.NETCore.Targets 1.1.0 NETStandard.Library 2.0.3 Newtonsoft.Json 13.0.3 Newtonsoft.Json.Bson 1.0.2 runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2 runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2 runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2 runtime.native.System 4.3.0 runtime.native.System.Net.Http 4.3.0 runtime.native.System.Security.Cryptography.Apple 4.3.0 runtime.native.System.Security.Cryptography.OpenSsl 4.3.2 runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2 runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2 runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple 4.3.0 runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2 runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2 runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2 runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2 runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2 SQLitePCLRaw.bundle_e_sqlite3 2.1.2 SQLitePCLRaw.core 2.1.2 SQLitePCLRaw.lib.e_sqlite3 2.1.2 SQLitePCLRaw.provider.e_sqlite3 2.1.2 Std.UriTemplate 0.0.46 System.Buffers 4.5.1 System.ClientModel 1.0.0 System.CodeDom 8.0.0 System.Collections 4.3.0 System.Collections.Concurrent 4.3.0 System.Configuration.ConfigurationManager 8.0.1 System.Diagnostics.Debug 4.3.0 System.Diagnostics.DiagnosticSource 8.0.1 System.Diagnostics.EventLog 8.0.1 System.Diagnostics.PerformanceCounter 8.0.0 System.Diagnostics.Tracing 4.3.0 System.Globalization 4.3.0 System.Globalization.Calendars 4.3.0 System.Globalization.Extensions 4.3.0 System.IdentityModel.Tokens.Jwt 7.0.3 System.IO 4.3.0 System.IO.FileSystem 4.3.0 System.IO.FileSystem.Primitives 4.3.0 System.Linq 4.3.0 System.Management 8.0.0 System.Memory 4.5.4 System.Memory.Data 1.0.2 System.Net.Http 4.3.4 System.Net.Primitives 4.3.0 System.Numerics.Vectors 4.5.0 System.Reflection 4.3.0 System.Reflection.Primitives 4.3.0 System.Resources.ResourceManager 4.3.0 System.Runtime 4.3.0 System.Runtime.Caching 8.0.1 System.Runtime.CompilerServices.Unsafe 6.0.0 System.Runtime.Extensions 4.3.0 System.Runtime.Handles 4.3.0 System.Runtime.InteropServices 4.3.0 System.Runtime.Numerics 4.3.0 System.Security.Claims 4.3.0 System.Security.Cryptography.Algorithms 4.3.0 System.Security.Cryptography.Cng 4.3.0 System.Security.Cryptography.Csp 4.3.0 System.Security.Cryptography.Encoding 4.3.0 System.Security.Cryptography.OpenSsl 4.3.0 System.Security.Cryptography.Primitives 4.3.0 System.Security.Cryptography.ProtectedData 8.0.0 System.Security.Cryptography.X509Certificates 4.3.0 System.Security.Principal 4.3.0 System.Text.Encoding 4.3.0 System.Text.Encoding.Extensions 4.3.0 System.Text.Encodings.Web 7.0.0 System.Text.Json 7.0.1 System.Text.RegularExpressions 4.3.0 System.Threading 4.3.0 System.Threading.Tasks 4.3.0 System.Threading.Tasks.Dataflow 8.0.1 System.Threading.Tasks.Extensions 4.5.4 System.Xml.ReaderWriter 4.3.0 System.Xml.XPath 4.3.0 Unity 5.11.10 Unity.Abstractions 5.11.2 Unity.Container 5.11.4 Unity.Microsoft.DependencyInjection 5.11.5

</details>

owennewo avatar Oct 08 '25 12:10 owennewo

Hi @owennewo, thank you for your reply. My project is using the latest NuGet version (1.31.0.225-preview), and none of the previous or current versions work. If this problem only occurs in my project, I hope that in the next version of the SDK, this kind of error message can be made more explicit so that I can understand the exact error it encounters.

KanaHayama avatar Oct 08 '25 20:10 KanaHayama

@KanaHayama are you encountering these errors on a bot deployed in a VM in Azure, or running locally on a dev machine/laptop?

My first thought would be to double check that you have the latest VC++ x64 runtime installed, but it looks like you do:

  • C++ Redistributable: x64 14.44.35211

but possibly it is worth reinstalling the VC++ runtime to be certain.

If you are encountering this on a local machine, can you please try running on a VM in Azure - or a machine which has not run Teams (or Skype). Thanks.

ssulzer avatar Oct 08 '25 21:10 ssulzer

Another question: Is the bot running in a container? If so, what is the base image? Windows Server Core is not supported; the bot media SDK requires a full Windows Server image. Thanks.

ssulzer avatar Oct 08 '25 21:10 ssulzer

Hi @ssulzer, I'm running it on my local Windows 11 Pro 24H2 desktop behind NAT, with an ngrok TCP tunnel launched before starting the web server application. I reinstalled the VC++ redistributable, but that didn’t help. Also, I’m not running the Teams client on my machine, since the error occurs during the application startup stage — the Teams client isn’t involved at that point.

I don’t have a VM in Azure right now, but I tested another laptop running Windows 11 Enterprise 23H2 and didn’t encounter any issues when launching my ASP.NET Core app there, although I did see two error messages from the Media Platform (log attached at the end). However, I couldn’t test the full meeting-joining feature that had previously worked because I noticed the copied meeting URL format had changed, so my app couldn't parse the meeting information from it, and I currently don’t know how to handle it. Since the application launched on this laptop, there may be some problems related to my development desktop, although I’m not sure whether the OS version made a difference.

Thank you for your help — you may close this issue. I’ll later try to see if I can find any clues on how to handle the new meeting URL format from the samples here.

[14:04:53 INF] User profile is available. Using 'C:\Users\***\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest. <s:Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager>
[14:05:16 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Created a new Aria trace listener with token ***-***-***-***-***-***-*** <s:***.***.MediaPlatformLogger>
[14:05:16 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Setting MediaAgents platform log level to Information <s:***.***.MediaPlatformLogger>
[14:05:16 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Setting MediaApiLogLevel to Warning <s:***.***.MediaPlatformLogger>
[14:05:16 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Setting AvMP log level to Error <s:***.***.MediaPlatformLogger>
[14:05:16 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Attempting to apply the UnifiedLogging configuration: UnifiedLoggingConfiguration: [ IsEnabled: False ScenarioStrings:  ] <s:***.***.MediaPlatformLogger>
[14:05:16 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Setting UnifiedLogging Info: [isEnabled: False] [ScenarioStrings: ] <s:***.***.MediaPlatformLogger>
[14:05:16 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Logger initialized for application ID ***-***-***-***-***. Logging configuration: LoggingConfiguration: [ MediaAgentsPlatformLogLevel: Information; MediaApiLogLevel: Warning; MediaProcessorLogLevel: Error; AriaLoggingConfiguration: AriaLoggingConfiguration: [ AriaTenantToken: ***-***-***-***-***-***-***; AriaTraceEventName: SkypeMediaBotsTraces; SplitAriaTracesByLevel: True; DisableAriaTracing:  ]; UnifiedLoggingConfiguration: UnifiedLoggingConfiguration: [ IsEnabled: False ScenarioStrings:  ] ] <s:***.***.MediaPlatformLogger>
[14:05:16 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Whitelist config value changed: cipnoam.api.mpaas.trafficmanager.net,intnoam.api.mpaas.trafficmanager.net,dognoam.api.mpaas.trafficmanager.net,prdnoam.api.mpaas.trafficmanager.net,prdapac.api.mpaas.trafficmanager.net,prdemea.api.mpaas.trafficmanager.net,prd00apac.mpaas.trafficmanager.net,prd00noam.mpaas.trafficmanager.net,prd00emea.mpaas.trafficmanager.net,mediapaas-api-test-01-wus.cloudapp.net,ucapnoam.api.mpaas.trafficmanager.net,mediapaas-api-apac.pub.ngcmtls.com,mediapaas-api-aus.pub.ngcmtls.com,mediapaas-api-dog.pub.ngcmtls.com,mediapaas-api-emea.pub.ngcmtls.com,mediapaas-api-int.pub.ngcmtls.com,mediapaas-api-noam.pub.ngcmtls.com,mediapaas-api-test.pub.ngcmtls.com,mediapaas-api-prod.gov.ngcmtls.us,mediapaas-api-prod.dod.ngcmtls.us,mediapaas-api.pub.ngcmtls.com,mediapaas-api-prd.pub.ngcmtls.com,mediapaas-api-mp.pub.ngcmtls.com,mediapaas-api-mp.dod.ngcmtls.us,mediapaas-api-mp.gov.ngcmtls.us,mediapaas-api-mp.ngcmtls.cn,mediapaas-api-mp.teams.azclient.eaglex.ic.gov,mediapaas-api-mp.teams.azclient.microsoft.scloud <s:***.***.MediaPlatformLogger>
[14:05:16 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] IssuerChainList changed: [ameroot,AME G1 TLS RSA 2048 SHA256 2024 CUS CA 07],[ameroot,AME G1 TLS RSA 2048 SHA256 2024 EUS2 CA 07],[ameroot,AME G1 TLS RSA 2048 SHA256 2024 EUS2EUAP CA 07],[ameroot,AME G1 TLS RSA 2048 SHA256 2024 WCUS CA 07],[ameroot,AME G1 TLS RSA 2048 SHA256 2024 WUS2 CA 07],[ameroot,AME INFRA CA 01],[ameroot,AME Infra CA 02],[ameroot,AME Infra CA 03],[ameroot,AME Infra CA 04],[ameroot,AME Infra CA 05],[ameroot,AME Infra CA 06],[Baltimore CyberTrust Root,MSFT BALT RS256 CA],[DigiCert Global Root CA,DigiCert SHA2 Secure Server CA],[DigiCert Global Root CA,DigiCert TLS Hybrid ECC SHA384 2020 CA1],[DigiCert Global Root CA,DigiCert TLS RSA SHA256 2020 CA1],[DigiCert Global Root G2,DigiCert Global G2 TLS RSA SHA256 2020 CA1],[DigiCert Global Root G2,Microsoft Azure RSA TLS Issuing CA 03],[DigiCert Global Root G2,Microsoft Azure RSA TLS Issuing CA 04],[DigiCert Global Root G2,Microsoft Azure RSA TLS Issuing CA 07],[DigiCert Global Root G2,Microsoft Azure RSA TLS Issuing CA 08],[DigiCert Global Root G2,MSFT RS256 CA-1],[DigiCert Global Root G3,Microsoft Azure ECC TLS Issuing CA 03],[DigiCert Global Root G3,Microsoft Azure ECC TLS Issuing CA 04],[DigiCert Global Root G3,Microsoft Azure ECC TLS Issuing CA 07],[DigiCert Global Root G3,Microsoft Azure ECC TLS Issuing CA 08],[Entrust Root Certification Authority - G2,Entrust Certification Authority - L1K],[Entrust Root Certification Authority - G2,Entrust Certification Authority - L1M],[Microsoft ECC Root Certificate Authority 2017,Microsoft Azure ECC TLS Issuing CA 03],[Microsoft ECC Root Certificate Authority 2017,Microsoft Azure ECC TLS Issuing CA 04],[Microsoft ECC Root Certificate Authority 2017,Microsoft Azure ECC TLS Issuing CA 07],[Microsoft ECC Root Certificate Authority 2017,Microsoft Azure ECC TLS Issuing CA 08],[Microsoft ECC Root Certificate Authority 2017,Microsoft ECC TLS Issuing AOC CA 01],[Microsoft ECC Root Certificate Authority 2017,Microsoft ECC TLS Issuing AOC CA 02],[Microsoft ECC Root Certificate Authority 2017,Microsoft ECC TLS Issuing EOC CA 01],[Microsoft ECC Root Certificate Authority 2017,Microsoft ECC TLS Issuing EOC CA 02],[Microsoft RSA Root Certificate Authority 2017,Microsoft Azure RSA TLS Issuing CA 03],[Microsoft RSA Root Certificate Authority 2017,Microsoft Azure RSA TLS Issuing CA 04],[Microsoft RSA Root Certificate Authority 2017,Microsoft Azure RSA TLS Issuing CA 07],[Microsoft RSA Root Certificate Authority 2017,Microsoft Azure RSA TLS Issuing CA 08],[Microsoft RSA Root Certificate Authority 2017,Microsoft RSA TLS Issuing AOC CA 01],[Microsoft RSA Root Certificate Authority 2017,Microsoft RSA TLS Issuing AOC CA 02],[Microsoft RSA Root Certificate Authority 2017,Microsoft RSA TLS Issuing EOC CA 01],[Microsoft RSA Root Certificate Authority 2017,Microsoft RSA TLS Issuing EOC CA 02] <s:***.***.MediaPlatformLogger>
[14:05:16 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Comparing bots version 1.31.0.0225 and minimum supported version 0.0.0.0 <s:***.***.MediaPlatformLogger>
[14:05:16 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Platform has 8 cores <s:***.***.MediaPlatformLogger>
[14:05:16 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Initializing MP with Service FQDN: ***.***.org, Instance public port: ***, Instance internal port: *** <s:***.***.MediaPlatformLogger>
[14:05:16 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] UseMPAzureAppHostPerfCounterProvider is false. Discarding MP perf counters <s:***.***.MediaPlatformLogger>
[14:05:16 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] MediaPerf is not registered: no key found at SYSTEM\CurrentControlSet\Services\MediaPerf\Performance <s:***.***.MediaPlatformLogger>
[14:05:16 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] UseMPAzureAppHostPerfCounterProvider is false. Not checking for perf counter registration <s:***.***.MediaPlatformLogger>
[14:05:22 ERR] [AvMP][AppId:***-***-***-***-***][***] TL_ERROR(TF_COMPONENT) [***]2340.1::10/09/2025-14:05:22.646.00000001 (MPAZAPPHOST,LogError:AzAppMPHostLogger.cs(39)) Caught exception in DynamicCapacityEstimatorFromStack.Init(): System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Rtc.Internal.MediaProcessor.WebAPI.DynamicCapacityEstimatorFromStack.Init() <s:***.***.MediaPlatformLogger>
[14:05:22 ERR] [AvMP][AppId:***-***-***-***-***][***] TL_ERROR(TF_COMPONENT) [***]2340.1::10/09/2025-14:05:22.649.00000002 (MPAZAPPHOST,LogError:AzAppMPHostLogger.cs(39)) MPCapacityEstimator.Init() failed, disabling the capacity estimator <s:***.***.MediaPlatformLogger>
[14:05:23 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Initialized MP With HTTP Uri: [https://***.***.org:***/MediaProcessor/v1] <s:***.***.MediaPlatformLogger>
[14:05:23 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Disabled Dynamic Offloading <s:***.***.MediaPlatformLogger>
[14:05:23 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Initialized MediaApi Platform <s:***.***.MediaPlatformLogger>
[14:05:24 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Initialized MediaPlatform. ApplicationId : ***-***-***-***-***, MPUri: https://***.***.org:***/MediaProcessor/v1, IsTest: False. <s:***.***.MediaPlatformLogger>
[14:05:24 INF] Version: ***. <s:***.***.Services.VersionNumberPrinter>
[14:05:24 WRN] Overriding address(es) 'https://localhost:443, http://localhost:80'. Binding to endpoints defined via IConfiguration and/or UseKestrel() instead. <s:Microsoft.AspNetCore.Server.Kestrel>
[14:05:24 INF] Now listening on: http://[::]:80 <s:Microsoft.Hosting.Lifetime>
[14:05:24 INF] Now listening on: https://[::]:443 <s:Microsoft.Hosting.Lifetime>
[14:05:24 INF] Application started. Press Ctrl+C to shut down. <s:Microsoft.Hosting.Lifetime>
[14:05:24 INF] Hosting environment: Development <s:Microsoft.Hosting.Lifetime>
[14:05:24 INF] Content root path: C:\***\*** <s:Microsoft.Hosting.Lifetime>

KanaHayama avatar Oct 09 '25 21:10 KanaHayama

Btw, I was launching the project directly from Visual Studio 2022. I am not using a container.

KanaHayama avatar Oct 09 '25 21:10 KanaHayama

@KanaHayama A last-ditch effort to check: is the project configured to run in x64 mode? (use x64 and not AnyCPU or x86.) Also try running with Administrator privileges (although I don't think that will make a difference).

The use of Windows 11 Pro vs. Enterprise edition shouldn't matter - assuming you are not running Windows 11 "N" or "KN" editions.

Those errors you saw in the startup logs about DynamicCapacity and MPCapacity can be ignored. Our next SDK release should resolve those.

ssulzer avatar Oct 09 '25 21:10 ssulzer

Yes, I am using the x64 platform. However, the Visual Studio solution platform is set to AnyCPU (I noticed that my projects do not have a <Platforms>x64</Platforms> element). Given my project settings (pasted below), it should still run in x64 mode. Adding this element and running again does not help. My laptop uses the same VS solution platform, and it runs without error there. This project used to work a year ago, so it should be running in x64 mode.

My Windows version does not contain the letter “N” in it. I am running my application with administrator privileges because it acquires the certificate from the local machine certificate store. I enforce this by specifying the requirement in my app.manifest file. I am using Kestrel directly, not IIS or IIS Express. I save my Kestrel settings in a separate file, since I found that the Media Platform starts another Kestrel instance that reads my web app’s appsettings.json file by default. So, Media Platform's Kestrel settings are in default. I am using \psi, but my projects were written from scratch, so it is not related to the Psi demo here.

ASP.NET Core csproj:

<Project Sdk="Microsoft.NET.Sdk.Web">

    <PropertyGroup>
        <TargetFramework>net8.0-windows</TargetFramework>
        <PlatformTarget>x64</PlatformTarget>
        <RuntimeIdentifier>win-x64</RuntimeIdentifier>
        <Nullable>enable</Nullable>
        <ImplicitUsings>enable</ImplicitUsings>
        <EmbedAllSources>true</EmbedAllSources>      
        <LangVersion>latest</LangVersion>
        <RootNamespace>***.***</RootNamespace>
        <AssemblyName>***.***</AssemblyName>
        <Version>***</Version>
        <ApplicationManifest>app.manifest</ApplicationManifest>
        <UserSecretsId>***-***-***-***-***</UserSecretsId>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.3.2" />
        <PackageReference Include="Azure.Identity" Version="1.13.1" />
        <PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
        <PackageReference Include="ComputerInfo" Version="0.2.0" />
        <PackageReference Include="Microsoft.Skype.Bots.Media" Version="1.31.0.225-preview" />
        <PackageReference Include="Serilog.AspNetCore" Version="8.0.3" />
        <PackageReference Include="Serilog.Sinks.AzureTableStorage" Version="10.0.2" />
        <PackageReference Include="System.Diagnostics.PerformanceCounter" Version="8.0.1" />
    </ItemGroup>

    <ItemGroup>
        <ProjectReference Include="..\Core\Core.csproj" />
        <ProjectReference Include="..\Psi\Psi.csproj" />
    </ItemGroup>

</Project>

Psi project csproj:

<Project Sdk="Microsoft.NET.Sdk">

	<PropertyGroup>
		<TargetFramework>net8.0-windows</TargetFramework>
		<PlatformTarget>x64</PlatformTarget>
        <RuntimeIdentifier>win-x64</RuntimeIdentifier>
		<ImplicitUsings>enable</ImplicitUsings>
		<Nullable>enable</Nullable>
		<EmbedAllSources>true</EmbedAllSources>
		<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
		<LangVersion>latest</LangVersion>
		<RootNamespace>***.Psi</RootNamespace>
		<AssemblyNameL>***.Psi</AssemblyNameL>
		<Version>1.0.0</Version>
	</PropertyGroup>

	<ItemGroup>
		<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.2" />
        <PackageReference Include="Microsoft.Graph.Communications.Calls.Media" Version="1.2.0.15382" />
		<PackageReference Include="Microsoft.Graph.Communications.Client" Version="1.2.0.15382" />
		<PackageReference Include="Microsoft.Psi.Audio" Version="0.19.100.1-beta" />
		<PackageReference Include="Microsoft.Psi.Audio.Windows" Version="0.19.100.1-beta" />
		<PackageReference Include="OpenSense.Components.OpenCvSharp.Windows" Version="1.0.2" />
	</ItemGroup>

	<ItemGroup>
		<ProjectReference Include="..\Abstractions\Abstractions.csproj" />
	</ItemGroup>

</Project>

KanaHayama avatar Oct 09 '25 22:10 KanaHayama

I am including my two other projects' csproj here in case they are helpful in identifying conflicting assemblies.

Core:

<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
        <TargetFramework>net8.0-windows</TargetFramework>
        <PlatformTarget>x64</PlatformTarget>
        <RuntimeIdentifier>win-x64</RuntimeIdentifier>
        <ImplicitUsings>enable</ImplicitUsings>
        <Nullable>enable</Nullable>
        <EmbedAllSources>true</EmbedAllSources>
        <LangVersion>latest</LangVersion>
        <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
        <RootNamespace>***.Core</RootNamespace>
        <AssemblyName>***.Core</AssemblyName>
        <Version>1.0.0</Version>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="Google.Protobuf" Version="3.28.3" />
        <PackageReference Include="Grpc.Net.ClientFactory" Version="2.66.0" />
        <PackageReference Include="Grpc.Tools" Version="2.67.0">
            <PrivateAssets>all</PrivateAssets>
            <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
        </PackageReference>
        <PackageReference Include="Microsoft.CognitiveServices.Speech" Version="1.41.1" />
        <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" />
        <PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.1" />
        <PackageReference Include="System.ServiceModel.Primitives" Version="8.0.0" />
    </ItemGroup>

    <ItemGroup>
        <ProjectReference Include="..\Abstractions\Abstractions.csproj" />
    </ItemGroup>

    <ItemGroup>
        <Protobuf Include="$(SolutionDir)Protos\media_backend.proto" GrpcServices="None" />
    </ItemGroup>

</Project>

Abstractions csproj:

<Project Sdk="Microsoft.NET.Sdk">

	<PropertyGroup>
		<TargetFramework>netstandard2.0</TargetFramework>
		<PlatformTarget>x64</PlatformTarget>
		<ImplicitUsings>enable</ImplicitUsings>
		<Nullable>enable</Nullable>
		<EmbedAllSources>true</EmbedAllSources>
		<LangVersion>latest</LangVersion>
		<RootNamespace>***.Abstractions</RootNamespace>
		<AssemblyName>***.Abstractions</AssemblyName>
		<Version>1.0.0</Version>
	</PropertyGroup>

	<ItemGroup>
		<PackageReference Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
		<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.2" />
		<PackageReference Include="Microsoft.Psi.Audio" Version="0.19.100.1-beta" />
		<PackageReference Include="Microsoft.Psi.Imaging" Version="0.19.100.1-beta" />
		<PackageReference Include="Microsoft.Psi.Speech" Version="0.19.100.1-beta" />
	</ItemGroup>

</Project>

KanaHayama avatar Oct 09 '25 22:10 KanaHayama

Please note, we just released the next media SDK update - https://www.nuget.org/packages/Microsoft.Skype.Bots.Media/1.32.0.70-preview

I'm not aware of anything in it that would address a crash inside the core media engine initialization (during CreateEngineApiInstance) but maybe worth trying.

ssulzer avatar Oct 09 '25 22:10 ssulzer

Hi @ssulzer, thank you for letting me know the new version. I tried it, and I still have the same issue. Here is an excerpt of the log:

[15:53:01 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Comparing bots version 1.32.0.0070 and minimum supported version 0.0.0.0 <s:***.***.MediaPlatformLogger>
[15:53:01 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Platform has 24 cores <s:***.***.MediaPlatformLogger>
[15:53:01 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] Initializing MP with Service FQDN: ***.***.org, Instance public port: ***, Instance internal port: *** <s:***.***.MediaPlatformLogger>
[15:53:01 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] UseMPAzureAppHostPerfCounterProvider is false. Discarding MP perf counters <s:***.***.MediaPlatformLogger>
[15:53:01 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] MediaPerf is not registered: no key found at SYSTEM\CurrentControlSet\Services\MediaPerf\Performance <s:***.***.MediaPlatformLogger>
[15:53:01 INF] [SkypeBotsMediaPlatform][AppId:***-***-***-***-***][***] UseMPAzureAppHostPerfCounterProvider is false. Not checking for perf counter registration <s:***.***.MediaPlatformLogger>
[15:53:04 FTL] Host terminated unexpectedly. <s:>
Status Code: 0
Microsoft.Graph.Communications.Core.Exceptions.ServiceException: Media platform failed to initialize
 ---> System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.
   at Microsoft.Rtc.Internal.Media.EngineAPI.CreateEngineApiInstance(IntPtr& pEngine, String pQualifier, Boolean pEnableAudioDevices, Boolean pEnableVideoDevices, Boolean pEnableHealth, RtpSystemConfig pSystemConfig, RtpSystemPriority pSystemPriority, String pInitialPlatformSettingsJson)

While updating, there was a version conflict with the System.Diagnostics.PerformanceCounter package, so I updated it to version 9.0.9. Nothing else was changed.

I will develop on my laptop and start to handle the Teams meeting URL format issue, and come back to this issue after that. If you want, you may close this issue at any time. Thank you for your help!

KanaHayama avatar Oct 09 '25 23:10 KanaHayama

I'll keep this issue open, as it seems others may have also encountered the same problem. We'd like to root cause it. What we will probably need is a mini crash dump shared with us which captures the native exception that occurs within the CreateEngineApiInstance call.

ssulzer avatar Oct 10 '25 22:10 ssulzer