UnityPlayer.dll throws Platform::COMException ^

Hello!

Sorry for bothering with same question again, but I really need urgent help from community in porting the game (one near the top 10) to Windows Phone. Completely stuck, and have no clues :-`

UnityPlayer.dll crashes without any hints why, not even stepping into my scripts. The last line in Output window is:

First-chance exception at 0x77271ECF in TaskHost.exe: Microsoft C++ exception: Platform::COMException ^ at memory location 0x06A9FC24. HRESULT:0x80131040

The UnityPlayer.log contains nothing special or unexpected:

Build from '' branch, version is '4.3.1f1 (cebd4d9b5122)' (Release build).
Physical memory: 395 MB, commited memory limit: 180 MB.
PlayerConnection initialized from C:/Data/Programs/{88BE10A2-D68E-CB45-BB67-E691A9969C9A}/Install/Data (debug = 0)
PlayerConnection initialized network socket : 0.0.0.0 55260
GetLocalIP: Error during connect, 10065 Multi-casting "[IP] 127.0.0.1 [Port] 55260 [Flags] 2 [Guid] 1482656952 [EditorId] 3152935875 [Version] 1048832 [Id] WP8Player(0.0.0.0) [Debug] 0" to [225.0.0.222:54997]...
Direct3D:
    Version:  Direct3D 11.0 [level 9.3]
    Renderer: Qualcomm Adreno 305 (WDDM v1.2) (ID=0x30303330)
    Vendor:   Qualcomm
    VRAM:     96 MB
Initialize engine version: 4.3.1f1 (cebd4d9b5122)
Default GameObject Tag: GUIHelper already registered
 
(Filename: C:/BuildAgent/work/d3d49558e4d408f4/Runtime/BaseClasses/Tags.cpp Line: 68)

Call Stack is:

KERNELBASE.DLL!RaiseException()    Unknown
Msvcr110.dll!_CxxThrowException(void * pExceptionObject, const _s__ThrowInfo * pThrowInfo) Line 152 C++
Vccorlib110.dll!__abi_WinRTraiseCOMException(long hr) Line 502  C++
UnityPlayer.dll!ScriptingTypeProvider_Metro::NativeTypeFor(const char * namespaze, const char * name) Line 29   C++
UnityPlayer.dll!ScriptingTypeRegistry::GetType(const char * namespaze, const char * name) Line 19   C++
UnityPlayer.dll!MonoScript::RebuildFromAwake() Line 149 C++
UnityPlayer.dll!PersistentManager::LoadFileCompletelyThreaded(const std::basic_string<char,std::char_traits<char>,stl_allocator<char,51,4> >  pathname, int * fileIDs, int * instanceIDs, int size, bool loadScene, LoadProgress * loadProgress) Line 1452 C++
UnityPlayer.dll!PreloadLevelOperation::Perform() Line 652   C++
UnityPlayer.dll!PreloadManager::Run() Line 235  C++
UnityPlayer.dll!PreloadManager::Run(void * managerPtr) Line 187 C++
UnityPlayer.dll!Thread::RunThreadWrapper(void * ptr) Line 44    C++
UnityPlayer.dll!<lambda_14163fd8e7b3473ba35abd0bcfa8d126>::operator()(Windows::Foundation::IAsyncAction ^ __formal) Line 273    C++
UnityPlayer.dll!Windows::System::Threading::WorkItemHandler::[Windows::System::Threading::WorkItemHandler::__abi_IDelegate]::__abi_Windows_System_Threading_WorkItemHandler___abi_IDelegate____abi_Invoke(Windows::Foundation::IAsyncAction ^ __param0) C++
THREADPOOLWINRT.DLL!Windows::System::Threading::CThreadPoolWorkItem::CommonWorkCallback(void)   Unknown
THREADPOOLWINRT.DLL!Windows::System::Threading::CThreadPoolWorkItem::TimeSlicedCallback(void *) Unknown
NTDLL.DLL!RtlUserThreadStart() Unknown

Environment:

  • Windows Pro 8.1 64-bit
  • Unity Pro 4.3.1f1
  • Microsoft Visual Studio Express 2012 for Windows Phone (provided with Windows Phone SDK 8.0)
  • Nokia Lumia 520

Any ideas would be very much appreciated!

This usually is caused by either using an incompatible managed plugin, or having a version mismatch in a plugin itself - as in if you use a different plugin for Windows Phone that is called the same, the version Must match. Do you think any of these apply to you?

Thank you very much for reply!

Yes, it does apply; it turned out to be mismatch between versions of Photon3Unity3D.dll and WP8/Photon3Unity3D.dll.

So I’ve got a feature request—could you make this issue less silent and more explicit? Ideally it would be good to have compile time failure instead of runtime crash. However in general, as far as I understand, assembly resolution/loading/binding is runtime issue. In this case it would be good at least to have high level managed exception, which can be observed by developer and helps him to find out what is going wrong.

Nice to meet such responsive developer, thank you one more time!

You’re right, it is pretty cryptic. We would gladly fix it - we already handle some cases, but apparently not all of them. Just so it doesn’t get lost, please report it as a feature suggestion explaining the situation and attaching an example project, even if almost empty one to demonstrate the issue.

Tried to reproduce on minimalistic project; but observed behavior was a little bit different. This time it failed with exception message on device without crashing.
https://mega.co.nz/#!I5BUxIhL!E7uXR1RdgH4JkNAKLA_7HXrPAjotw8ixTL0cdU0Rvqc

1462318–79870–$Vati.zip (125 KB)