0
Fixed

Bolt Type options fail with .NET4.6

Julien Vulliet 3 years ago updated by Lazlo Bonin (Lead Developer) 3 years ago 8

Hello, 

I started using Bolt, and wanted to try to import a few extra .NET types.



When using Framework 3.5 scripting backend, all works fine, but when switching to 4.6, trying to add type brings the following error:

ArgumentException: The type 'System.Void' may not be used as a type argument.
System.RuntimeType.ThrowIfTypeNeverValidGenericArgument (System.RuntimeType type) (at <9c9f068c46c64ffd91fda7af157b4d15>:0)
System.RuntimeType.SanityCheckGenericArguments (System.RuntimeType[] genericArguments, System.RuntimeType[] genericParamters) (at <9c9f068c46c64ffd91fda7af157b4d15>:0)
System.RuntimeType.MakeGenericType (System.Type[] instantiation) (at <9c9f068c46c64ffd91fda7af157b4d15>:0)
Ludiq.TypeOptionTree+<>c.<Prewarm>b__12_1 (System.Type t) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Reflection/TypeOptionTree.cs:57)
System.Linq.Enumerable+WhereSelectEnumerableIterator`2[TSource,TResult].MoveNext () (at <11c1c8f1ba1046b191f565f88728429e>:0)
System.Linq.Enumerable+ConcatIterator`1[TSource].MoveNext () (at <11c1c8f1ba1046b191f565f88728429e>:0)
System.Linq.Enumerable+WhereEnumerableIterator`1[TSource].MoveNext () (at <11c1c8f1ba1046b191f565f88728429e>:0)
System.Collections.Generic.HashSet`1[T].UnionWith (System.Collections.Generic.IEnumerable`1[T] other) (at <11c1c8f1ba1046b191f565f88728429e>:0)
System.Collections.Generic.HashSet`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] collection, System.Collections.Generic.IEqualityComparer`1[T] comparer) (at <11c1c8f1ba1046b191f565f88728429e>:0)
System.Collections.Generic.HashSet`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] collection) (at <11c1c8f1ba1046b191f565f88728429e>:0)
Ludiq.LinqUtility.ToHashSet[T] (System.Collections.Generic.IEnumerable`1[T] enumerable) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Utilities/LinqUtility.cs:38)
Ludiq.TypeOptionTree.Prewarm () (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Reflection/TypeOptionTree.cs:57)
Ludiq.FuzzyWindow+<>c__DisplayClass31_0.<Initialize>b__0 () (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:326)
Ludiq.FuzzyWindow.Work () (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:217)
UnityEngine.Debug:LogException(Exception)
Ludiq.FuzzyWindow:Work() (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:222)
System.Threading.ThreadHelper:ThreadStart()


Thanks

Julien

Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):

Are you using anything that's in 4.6 that isn't in the older version? If that's the case, I can only assume it isn't suppose to work, because Bolt isn't upgraded to support 4.6. it will be though. It's on the roadmap for 1.4 Runtime update. Copy and pasted below from the roadmap, with a link to it's topic.

Version 1.4: Runtime & internal updates

  • Update to .NET 4.6 and require Unity 2017.2+ (#386)


Also, If you know C# at all, I believe you could just create a script for these for now. Instead of using a 4.6 type in bolt itself. Then use your C# script as a unit.

I can use scripts for some parts (which I do already), but I got a lot of other custom made c# libraries which make use of .net4+, and would not really be possible to recompile them for 3.5 easily. There's no emergency still, so I can wait :)

Actually I just seen this post, I get an equivalent error :

http://support.ludiq.io/forums/5-bolt/topics/483-bug-fuzzy-finder-in-unit-option-wizard-when-i-try-to-insert-a-new-type/

I just start an empty project, and switch build settings to 4.6, that's enough to have the error popping around (as mentioned in the other post). 

Pending Review

Hi Julien,

Which version of Bolt are you using? I thought I had fixed this issue in an earlier release.

I'm running 1.1.2 (got it from asset store yesterday)

Fixed in Alpha

Found & fixed, void was now being included as part of mscorlib in .NET 4.6 so it got picked up.