Official Poll: What's preventing you from switching to IL2CPP scripting backend on Windows Store?

Hello dear developers targeting Windows Store!

We have been internally discussing about reasons people are still using the .NET scripting backend. It is no secret that we’re planning to drop .NET scripting backend support eventually, and make Windows Store an IL2CPP-only platform. The timeline for that, however, is a different discussion, and we’d like you to help us figure that one out. This is not something that will be done in 5.6, 5.7 or even 5.8 - and before we do it, we must make sure that we accommodate the needs of the developers and ideally have everyone switched to IL2CPP by that time. The answers to this poll will allow us to prioritize our IL2CPP work items.

So, can you tell us what is preventing you from switching to IL2CPP scripting backend on Windows Store?

5.7 ? 5.8 ? I thought the next release will be named 2017.x :slight_smile:

Eh, whatever. You know what I meant :).

Hi,
We use IL2CPP if properly supported by the target platform but we are not targeting Windows Store on our builds. Probably add this as an option to the poll?
[EDIT] Poll*, not pool (silly me). :smile:

Done

1 Like

I personally only use Windows Store at the moment for testing my asset so I test both .net and il2cpp. For me though, the debugger is a biggie, though most of my debugging has already been done im the editor. I’d also love to see some performance metrics between an il2cpp build and a .net build that has been run through .net native.

The C++ code it generates is a real problem for us. Not being able to debug scripts from the Unity side in the context of our Windows Store app is a real sticking point.

1 Like

Do you mind elaborating? Did you ever try debugging generated C++ code? Is the problem the fact that it is hard to understand which portion of C++ code got generated from your C# code? Have you given Unity 5.6 beta a try where we introduced original source code annotations for generated C++ code? If so, does that help?

We haven’t attempted debugging with C++, but have inspected the output. In our tests, it was hard to find and recognize the generated C++ and where it fits in for complex components.

In general, developing in C# and then doing runtime debugging with C++ will certainly be a hindrance. Developers will need to know C++ well enough to understand the language conventions, and if there is a bug we’re working on fixing, the iteration time between C#/C++ will certainly be a productivity hit.

We have not looked at Unity 5.6… the source code annotations sound like they will help some. We have some work planned to look at it in the coming few weeks.

Thank you for the feedback, that is helpful! Looking forward to you trying 5.6.

I must have missed that: Since when is ILCPP considered stable for Windows Store?

Last time I checked, it was experimental and half of the extensions we use didn’t support it.
What are the pros and cons?
Is there stuff not gonna work?
Only pro of ILCPP is better performance?

We aim to have all plugins and extensions be compatible with IL2CPP in 5.6.

It’s ‘stable’, and people are shipping games using it, but until 5.6 it was still missing some features - namely Windows Runtime support, so some plugins wouldn’t work.

Pros:

  • Identical .NET API compared to other unity platforms - you no longer have to rewrite your code to work on Windows Store;
  • In some cases significantly better performance;
  • IL2CPP uses the same serialization backend as all other Unity platforms, which eliminates certain long standing Windows Store bugs (like the one where we cannot scan static fields for UnityEngine.Object references and thus they will get unloaded when nothing else is referencing them), and enables some features previously unsupported on Windows Store (for instance, type trees for Asset Bundles, which makes you able to build them in one unity version and not have to rebuild them every time you update the editor).

Cons:

  • No C# debugger;
  • Longer build times (we’re working on this one).

IL2CPP is an AOT compiled platform, so obvious things like System.Reflection.Emit do not work. Up until 5.6, many plugins that were made especially for .NET scripting backend wouldn’t work either - you’d have to use the plugin variant that worked on the standalone player instead.

Thanks for the detailed info!
We use IL2CPP for iOS and Android, so I guess the System.Refleciton.Emit won’t be an issue anyway.

We are now just upgrading to 5.5, it’ll take a while until we use 5.6.
We have to evaluate 5.6 soon, since lightmapping completly changes, so I guess when we do that, we can also give IL2CPP a shot … the API unification sounds promissing.

On the other hand, does that actually mean I cannot access native code from unity script anymore?
E.g. this util function:

  public static bool IsWindowsMobile()
  {
#if UNITY_WSA_10_0 && NETFX_CORE

    string platformFamily = Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily;

    if (platformFamily.Equals("Windows.Desktop"))
    {
      return false;
    }
    else if (platformFamily.Equals("Windows.Mobile"))
    {
      return true;
    }

    return false;  

#elif UNITY_WP_8_1
    return true;
#elif UNITY_WSA
  return false;
#else
    return false;
#endif
  }

That should almost work just fine in 5.6 with IL2CPP - you’ll just have to change “NETFX_CORE” define to “ENABLE_WINMD_SUPPORT”. As I said before, we aim to make IL2CPP compatible with code you used with .NET scripting backend.

NETFX_CORE define used to mean two things: that your C# scripts were compiled against .NET Core 5 class libraries, and that you could reference “.winmd” files from scripts. With IL2CPP in 5.6, you can target full .NET 4.6 desktop class libraries. .NET 4.6 for desktop is almost entirely a superset of .NET Core 5, but it has minor differences - so we decided to not define NETFX_CORE instead introduce a new define that means that you can reference “.winmd” files from C# scripts. We also have new defines for different API compatibility level player setting on all platforms on Mono and IL2CPP scripting backend - NET_2_0, NET_2_0_SUBSET and NET_4_6.

The minor differences I mentioned is the lack of these types in .NET 4.6 profile that used to work on .NET scripting backends:

Microsoft.VisualBasic.CallType
Microsoft.VisualBasic.CompilerServices.Conversions
Microsoft.VisualBasic.CompilerServices.DesignerGeneratedAttribute
Microsoft.VisualBasic.CompilerServices.IncompleteInitialization
Microsoft.VisualBasic.CompilerServices.NewLateBinding
Microsoft.VisualBasic.CompilerServices.ObjectFlowControl
Microsoft.VisualBasic.CompilerServices.Operators
Microsoft.VisualBasic.CompilerServices.OptionCompareAttribute
Microsoft.VisualBasic.CompilerServices.OptionTextAttribute
Microsoft.VisualBasic.CompilerServices.ProjectData
Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute
Microsoft.VisualBasic.CompilerServices.StaticLocalInitFlag
Microsoft.VisualBasic.CompilerServices.Utils
Microsoft.VisualBasic.Constants
Microsoft.VisualBasic.HideModuleNameAttribute
Microsoft.VisualBasic.Strings
System.Collections.Immutable.IImmutableDictionary`2
System.Collections.Immutable.IImmutableList`1
System.Collections.Immutable.IImmutableQueue`1
System.Collections.Immutable.IImmutableSet`1
System.Collections.Immutable.IImmutableStack`1
System.Collections.Immutable.ImmutableArray
System.Collections.Immutable.ImmutableArray`1
System.Collections.Immutable.ImmutableDictionary
System.Collections.Immutable.ImmutableDictionary`2
System.Collections.Immutable.ImmutableHashSet
System.Collections.Immutable.ImmutableHashSet`1
System.Collections.Immutable.ImmutableInterlocked
System.Collections.Immutable.ImmutableList
System.Collections.Immutable.ImmutableList`1
System.Collections.Immutable.ImmutableQueue
System.Collections.Immutable.ImmutableQueue`1
System.Collections.Immutable.ImmutableSortedDictionary
System.Collections.Immutable.ImmutableSortedDictionary`2
System.Collections.Immutable.ImmutableSortedSet
System.Collections.Immutable.ImmutableSortedSet`1
System.Collections.Immutable.ImmutableStack
System.Collections.Immutable.ImmutableStack`1
System.Diagnostics.StackFrameExtensions
System.Globalization.GlobalizationExtensions
System.Linq.ImmutableArrayExtensions
System.Net.Http.RtcRequestFactory
System.Numerics.Vector
System.Numerics.Vector`1
System.Numerics.VectorExtensions
System.Reflection.AssemblyExtensions
System.Reflection.AssemblyFlags
System.Reflection.AssemblyHashAlgorithm
System.Reflection.DeclarativeSecurityAction
System.Reflection.DispatchProxy
System.Reflection.EventInfoExtensions
System.Reflection.ManifestResourceAttributes
System.Reflection.Metadata.AssemblyDefinition
System.Reflection.Metadata.AssemblyDefinitionHandle
System.Reflection.Metadata.AssemblyFile
System.Reflection.Metadata.AssemblyFileHandle
System.Reflection.Metadata.AssemblyFileHandleCollection
System.Reflection.Metadata.AssemblyReference
System.Reflection.Metadata.AssemblyReferenceHandle
System.Reflection.Metadata.AssemblyReferenceHandleCollection
System.Reflection.Metadata.BlobHandle
System.Reflection.Metadata.BlobReader
System.Reflection.Metadata.Constant
System.Reflection.Metadata.ConstantHandle
System.Reflection.Metadata.ConstantTypeCode
System.Reflection.Metadata.CustomAttribute
System.Reflection.Metadata.CustomAttributeHandle
System.Reflection.Metadata.CustomAttributeHandleCollection
System.Reflection.Metadata.CustomAttributeNamedArgumentKind
System.Reflection.Metadata.DeclarativeSecurityAttribute
System.Reflection.Metadata.DeclarativeSecurityAttributeHandle
System.Reflection.Metadata.DeclarativeSecurityAttributeHandleCollection
System.Reflection.Metadata.Ecma335.EditAndContinueLogEntry
System.Reflection.Metadata.Ecma335.EditAndContinueOperation
System.Reflection.Metadata.Ecma335.ExportedTypeExtensions
System.Reflection.Metadata.Ecma335.HeapIndex
System.Reflection.Metadata.Ecma335.MetadataAggregator
System.Reflection.Metadata.Ecma335.MetadataReaderExtensions
System.Reflection.Metadata.Ecma335.MetadataTokens
System.Reflection.Metadata.Ecma335.TableIndex
System.Reflection.Metadata.EntityHandle
System.Reflection.Metadata.EventAccessors
System.Reflection.Metadata.EventDefinition
System.Reflection.Metadata.EventDefinitionHandle
System.Reflection.Metadata.EventDefinitionHandleCollection
System.Reflection.Metadata.ExceptionRegion
System.Reflection.Metadata.ExceptionRegionKind
System.Reflection.Metadata.ExportedType
System.Reflection.Metadata.ExportedTypeHandle
System.Reflection.Metadata.ExportedTypeHandleCollection
System.Reflection.Metadata.FieldDefinition
System.Reflection.Metadata.FieldDefinitionHandle
System.Reflection.Metadata.FieldDefinitionHandleCollection
System.Reflection.Metadata.GenericParameter
System.Reflection.Metadata.GenericParameterConstraint
System.Reflection.Metadata.GenericParameterConstraintHandle
System.Reflection.Metadata.GenericParameterConstraintHandleCollection
System.Reflection.Metadata.GenericParameterHandle
System.Reflection.Metadata.GenericParameterHandleCollection
System.Reflection.Metadata.GuidHandle
System.Reflection.Metadata.Handle
System.Reflection.Metadata.HandleComparer
System.Reflection.Metadata.HandleKind
System.Reflection.Metadata.InterfaceImplementation
System.Reflection.Metadata.InterfaceImplementationHandle
System.Reflection.Metadata.InterfaceImplementationHandleCollection
System.Reflection.Metadata.ManifestResource
System.Reflection.Metadata.ManifestResourceHandle
System.Reflection.Metadata.ManifestResourceHandleCollection
System.Reflection.Metadata.MemberReference
System.Reflection.Metadata.MemberReferenceHandle
System.Reflection.Metadata.MemberReferenceHandleCollection
System.Reflection.Metadata.MemberReferenceKind
System.Reflection.Metadata.MetadataKind
System.Reflection.Metadata.MetadataReader
System.Reflection.Metadata.MetadataReaderOptions
System.Reflection.Metadata.MetadataStringComparer
System.Reflection.Metadata.MetadataStringDecoder
System.Reflection.Metadata.MethodBodyBlock
System.Reflection.Metadata.MethodDefinition
System.Reflection.Metadata.MethodDefinitionHandle
System.Reflection.Metadata.MethodDefinitionHandleCollection
System.Reflection.Metadata.MethodImplementation
System.Reflection.Metadata.MethodImplementationHandle
System.Reflection.Metadata.MethodImplementationHandleCollection
System.Reflection.Metadata.MethodImport
System.Reflection.Metadata.MethodSpecification
System.Reflection.Metadata.MethodSpecificationHandle
System.Reflection.Metadata.ModuleDefinition
System.Reflection.Metadata.ModuleDefinitionHandle
System.Reflection.Metadata.ModuleReference
System.Reflection.Metadata.ModuleReferenceHandle
System.Reflection.Metadata.NamespaceDefinition
System.Reflection.Metadata.NamespaceDefinitionHandle
System.Reflection.Metadata.Parameter
System.Reflection.Metadata.ParameterHandle
System.Reflection.Metadata.ParameterHandleCollection
System.Reflection.Metadata.PEReaderExtensions
System.Reflection.Metadata.PropertyAccessors
System.Reflection.Metadata.PropertyDefinition
System.Reflection.Metadata.PropertyDefinitionHandle
System.Reflection.Metadata.PropertyDefinitionHandleCollection
System.Reflection.Metadata.SerializationTypeCode
System.Reflection.Metadata.SignatureAttributes
System.Reflection.Metadata.SignatureCallingConvention
System.Reflection.Metadata.SignatureHeader
System.Reflection.Metadata.SignatureKind
System.Reflection.Metadata.SignatureTypeCode
System.Reflection.Metadata.StandaloneSignature
System.Reflection.Metadata.StandaloneSignatureHandle
System.Reflection.Metadata.StringHandle
System.Reflection.Metadata.TypeDefinition
System.Reflection.Metadata.TypeDefinitionHandle
System.Reflection.Metadata.TypeDefinitionHandleCollection
System.Reflection.Metadata.TypeLayout
System.Reflection.Metadata.TypeReference
System.Reflection.Metadata.TypeReferenceHandle
System.Reflection.Metadata.TypeReferenceHandleCollection
System.Reflection.Metadata.TypeSpecification
System.Reflection.Metadata.TypeSpecificationHandle
System.Reflection.Metadata.UserStringHandle
System.Reflection.MethodImportAttributes
System.Reflection.MethodInfoExtensions
System.Reflection.PortableExecutable.Characteristics
System.Reflection.PortableExecutable.CoffHeader
System.Reflection.PortableExecutable.CorFlags
System.Reflection.PortableExecutable.CorHeader
System.Reflection.PortableExecutable.DirectoryEntry
System.Reflection.PortableExecutable.DllCharacteristics
System.Reflection.PortableExecutable.Machine
System.Reflection.PortableExecutable.PEHeader
System.Reflection.PortableExecutable.PEHeaders
System.Reflection.PortableExecutable.PEMagic
System.Reflection.PortableExecutable.PEMemoryBlock
System.Reflection.PortableExecutable.PEReader
System.Reflection.PortableExecutable.PEStreamOptions
System.Reflection.PortableExecutable.SectionCharacteristics
System.Reflection.PortableExecutable.SectionHeader
System.Reflection.PortableExecutable.Subsystem
System.Reflection.PropertyInfoExtensions
System.Reflection.TypeExtensions
System.StringNormalizationExtensions
System.Text.CodePagesEncodingProvider
System.Threading.PreAllocatedOverlapped
System.Threading.ThreadPoolBoundHandle

IL2CPP with zip plugin I use crashes the player on x86 only. I believe the bug has been submitted but I am not sure how long it will take to be fixed, if fixed at all.

It doesn’t work with Windows Store IAP.
We could submit our game to the Windows Store and works fine, sadly we can’t implement IAP because doesn’t work with IL2CPP.

Do you have a case number? We definitely fix bugs.

Yeah, it’s a known issue, but we’re aiming to make it work for 5.6.

I will try to get the bug report number from the plugin author and post it here.

Two issues are preventing:

  1. Lack of IAP (should work in 5.6, i know)
  2. Lack of Win 8.1 support, which is important for mobiles

I’m so glad to hear that Unity is working on this. We really appreciate the effort, our thanks and best wishes.