edited August 2016 in ORK Support
Hi

Love the Ork tool but I'm having trouble building my test scene for windows UWP when I try building it under the universal 10 SDK I Unity produces loads of errors.

"Reference rewriter: Error: method `System.Reflection.Assembly System.Reflection.Assembly::GetExecutingAssembly()` doesn't exist in target framework. It is referenced from ORKFrameworkCore.dll at System.Void ORKFramework.Watermark::Show().
UnityEngine.Debug:LogError(Object)
PostProcessWinRT:RunReferenceRewriter() (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:591)
PostProcessWinRT:Process() (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:126)
UnityEditor.HostView:OnGUI()"

"Reference rewriter: Error: method `System.Reflection.ConstructorInfo System.Type::GetConstructor(System.Type[])` doesn't exist in target framework. It is referenced from ORKFrameworkCore.dll at System.Object ORKFramework.ReflectionTypeHandler::CreateInstance(System.Type).
UnityEngine.Debug:LogError(Object)
PostProcessWinRT:RunReferenceRewriter() (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:591)
PostProcessWinRT:Process() (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:126)
UnityEditor.HostView:OnGUI()"

I tried using the Ork demo and get the same errors, but when I use a simple scene without Ork it builds fine.

I tried building the project in Visual Studios any way but get errors reverencing the ORKFramework.Reflection again:

"1> Failed to fix references for method System.Type ORKFramework.ReflectionTypeHandler::SerializerGetType(System.String)
1> Failed to fix references for type ORKFramework.ReflectionTypeHandler"

Does anyone else have this problem and if so how have you got round it. I love the tool and the only thing stopping me from buying the full thing is this error as the windows store is one of the areas I want to target.

I would be grateful for any help or advice.
Post edited by jonjaydee on
  • This is because the Windows Store apps are compiled with the .NET Native runtime, rather than the .NET Framework runtime:
    In the .NET Framework, managed development supports metaprogramming through the reflection API. Reflection allows you to inspect objects in an app, call methods on objects discovered through inspection, generate new types at run time, and supports many other dynamic code scenarios. It also supports serialization and deserialization, which allows an object's field values to be persisted and later restored. These scenarios all require the .NET Framework just-in-time (JIT) compiler to generate native code based on available metadata.

    The .NET Native runtime doesn't include a JIT compiler. As a result, all necessary native code must be generated in advance. A set of heuristics is used to determine what code should be generated, but these heuristics cannot cover all possible metaprogramming scenarios. Therefore, you must provide hints for these metaprogramming scenarios by using runtime directives.
    Source: Reflection and .NET Native

    So Reflection has to be handled differently with UWP applications than with the traditional .NET applications. For example, you need to use:

    this.GetType().GetTypeInfo().Assembly.FullName

    Instead of:

    System.Reflection.Assembly.GetExecutingAssembly().FullName

    In short, ORK Framework doesn't do it the .NET Native way, so you are probably out of luck unless @gamingislove decides that he wants to rewrite that aspect of ORK to make it compatible.

    Not the answer you were hoping for, but as far as I know, that's the situation.

  • Thanks for your reply Keldryn but I have managed to get it to work now.

    I downloaded the IL2CPP scripting backend for unity and built it with that which bypasses the problem.

    Thanks
  • edited July 2016
    Cool! I didn't know one could bypass the issue so easily. Glad to hear that.
    Post edited by Keldryn on
  • That's great news - I've just updated to Windows 10 to finally be able to test compiling for windows store in the future, this will make a lot of things easier to also support that platform :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • My trying to port my project to UWP, mas gaves me error. Can anyone help me? ;)
Sign In or Register to comment.