microsoft / MixedRealityCompanionKit

This is a MixedRealityToolkit style repository for code bits and components that may not run directly on Microsoft HoloLens or immersive headsets but instead pair with them to build experiences.
MIT License
591 stars 286 forks source link

'RealtimeStreaming.Network.Listener' is not registered. #342

Open jmichelD5T opened 4 years ago

jmichelD5T commented 4 years ago

Hello, When running the desktop server application, I receive the following error when I try to start the server:

System.TypeLoadException HResult=0x80131522 Message=Requested Windows Runtime type 'RealtimeStreaming.Network.Listener' is not registered. Source=mscorlib StackTrace: at System.StubHelpers.StubHelpers.GetWinRTFactoryObject(IntPtr pCPCMD) at RealtimeStreaming.Network.Listener..ctor(UInt16 port) at DesktopServerApp.ServerManager.d__64.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch()

Inner Exception 1: COMException: Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))

I encountered no build errors when building the source code or the desktop server projects, but I encountered various warnings related to WinRT when building the source. I built both projects for Release/x64. The server program immediately crashes after continuing execution past this error.

If anyone has any ideas on why this might occur, please let me know!

matealex commented 4 years ago

Hello @jmichelD5T I had the same problem and here are two possible solutions that i found:

COM components need to be registered to Windows registers to be used in other applications. That is one way to solve that error.

Another way is to configure the project to use the Registration Free COM Interop method. An example can be found here.
Basically:

  1. Add Microsoft.VCRTForwarders NuGet Package
  2. Create an Application Manifest File
  3. Add an entry in the created manifest file for each imported dll files and each class, like:
<file name="RealtimeStreaming.dll">
    <activatableClass
      name="RealtimeStreaming.Network.Listener"
      threadingModel="both"
      xmlns="urn:schemas-microsoft-com:winrt.v1" />
  </file>
vfa-tuanpv commented 4 years ago

I have a same issue take a lot of time but nothing with RealtimeStreaming.winmd, any help? thank you

dimtsiakm commented 4 years ago

Unfortunately, same here.

Tilretas commented 2 years ago

COM components need to be registered to Windows registers to be used in other applications. That is one way to solve that error.

Hello @matealex, I have a similar problem with "'RealtimeStreaming.Network.Connector' is not registered." I tried to register it following the information provided in the page linked by you, but I couldn't register it. I try the command regasm RealtimeStreaming.winmd, but i get an error every time saying: RegAsm : error RA0000 : Could not load file or assembly ("RealtimeStreaming.winmd") or one of its dependencies.. (translated) I would greatly appreciate any help.