Feature `out variable declaration' cannot be used error on Entities 0.0.12-preview.5

I am getting the following errors:

C:/Users/cetin/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.entities@0.0.12-preview.5/Unity.Entities/SerializeUtility.cs(28,73): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 6.0 language specification

Same error, same file, (153,52)
Same error, same file, (153,78)

I already have the .NET 4.x enabled:

3518350--281316--Capture.PNG

The issue is not present on the preview.4 of the same version.

2 Likes

After doing a Reimport All, the errors in my first post are gone, and I get these instead:

8 times:

 (0,0): Unable to start the incremental compiler service:System.Exception: Subscribe exception: EAGAIN(11): Resource temporarily unavailable
System.Threading.ThreadHelper:ThreadStart()

4 times:

(0,0): Object reference not set to an instance of an object

And the Package Manager windows is inaccessible due to the button missing.

Please note that I don’t have the incremental compiler package in the manifest file.

Seems like they are trying to bundle Inc compiler together in preparation for ref return in the lib…

Am getting similar errors:

Library/Unity/cache/packages/packages.unity.com/com.unity.entities@0.0.12-preview.5/Unity.Entities/SerializeUtility.cs(28,73): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 6.0 language specification

/Library/Unity/cache/packages/packages.unity.com/com.unity.entities@0.0.12-preview.5/Unity.Entities/SerializeUtility.cs(153,52): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 6.0 language specification

/Library/Unity/cache/packages/packages.unity.com/com.unity.entities@0.0.12-preview.5/Unity.Entities/SerializeUtility.cs(153,78): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 6.0 language specification

Using .NET 4.x

Preview 4 works

1 Like

Note that while I did not get this error (But I did not use the serialize feature just yet, maybe that’s related) however with preview.4 I have an another error about iterator on ComponentDataArray when using its accessor (the [ ]) , which was fixed in preview.5.

If this error still persists, try remove the ECS package, restart Unity, install ECS package again and check if it solves your problem.

Wonder if someone was able to find a solution to this problem? 0.0.12-preview.6 is out and some people still get stuck using 0.0.12-preview.4 because of this… i will love be able to try the new EntityCommandBuffer.Concurrent. :frowning:

I’m running Linux editor, wonder if it is platform relate, because some folks here did not get the error.

I test it using 2018.1.3f1 and 2018.2.0b7 … same error, removed the ecs package and reinstall it, closed and opening the editor… same, Reimport All… same, with incrementalcompiler 0.0.42-preview.1 and without (also try using 0.0.42-preview.4 just in case)… nothing , and change the variable scope in every ā€˜out var’ inside the code is not and option, cus the problem goes deeper then that. Obviously i have not idea what im doing :smile: so i was hoping guys with more experience like you could shed some light on this problem.

Try closing unity, then delete the obj, Library and Temp folder inside the project. Might need to delete the .csproj also as those and unity should rebuild those.

I tried deleting the .csproj before, this time also did as you suggested and deleted obj, library and temp folders with an old project and even tried with a brand new project… but the error still there.

Wonder if ppl using windows/mac have the same issue, and if they are using mono or il2cpp, cus could be a classic … your linux is missing dependencies… kind of problem.

Ok, the hacky way to bypass the error is creating a mcs.rsp with -langversion:experimental on it, then add it to the Asset folder, that allow me, entities 0.0.12-preview.6 functionality, but unity editor still not working out of the box at leas for me.

4 Likes

What do you mean by still not working?
With adding the mcs.rsp with the corresponding content you described fixed the ā€œout variable declarationā€ errors and lets me play this game. TBH, I have no idea, why this is the case but I would be glad if you could elaborate what this does (or link to your resource :slight_smile: ).
The EntryPointNotFoundExceptions (see below) which are thrown ever since I try ECS (preview.4 and 6) are there anyway but do not hinder me from playing the sample.
Arch Linux, Unity 2018.1.3f1 and 2018.2.0b7

System.AggregateException: One or more errors occurred. ---> System.TypeInitializationException: The type initializer for 'ZeroMQ.lib.zmq' threw an exception. ---> System.EntryPointNotFoundException: mono_dllmap_insert
  at (wrapper managed-to-native) ZeroMQ.lib.Platform+Posix.mono_dllmap_insert(intptr,intptr,intptr,intptr,intptr)
  at ZeroMQ.lib.Platform+Posix.MonoDllMapInsert (System.String libraryName, System.String libraryPath) [0x0000e] in <89499c667382432583a6a5f1fb22bd37>:0
  at ZeroMQ.lib.Platform+Posix.LoadUnmanagedLibrary (System.String libraryName) [0x0022e] in <89499c667382432583a6a5f1fb22bd37>:0
  at ZeroMQ.lib.zmq..cctor () [0x00588] in <89499c667382432583a6a5f1fb22bd37>:0
   --- End of inner exception stack trace ---
  at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_generic_class_init(intptr)
  at ZeroMQ.ZContext..ctor () [0x00006] in <89499c667382432583a6a5f1fb22bd37>:0
  at UnityEditor.ServiceBroker.Client+<>c__DisplayClass6_0`1[T].<Subscribe>b__0 () [0x00000] in <d12a2b5a37c340e09a4b14574b3a784b>:0
  at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in <e1a80661d61443feb3dbdaac88eeb776>:0
  at System.Threading.Tasks.Task.Execute () [0x00010] in <e1a80661d61443feb3dbdaac88eeb776>:0
   --- End of inner exception stack trace ---
  at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00011] in <e1a80661d61443feb3dbdaac88eeb776>:0
  at System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00043] in <e1a80661d61443feb3dbdaac88eeb776>:0
  at System.Threading.Tasks.Task.Wait () [0x00000] in <e1a80661d61443feb3dbdaac88eeb776>:0
  at UnityEditor.Compilation.CompilerConnection.SubscribeInternal (System.Int32 millisecondTimeout, System.Boolean retryOnTimeout, System.Int32& attempts) [0x0002c] in <d5f4d17a9e23471b97eef6dda1b7cd7c>:0
  at UnityEditor.Compilation.CompilerConnection.SubscribeInternal (System.Int32 attempts) [0x00000] in <d5f4d17a9e23471b97eef6dda1b7cd7c>:0
  at UnityEditor.Compilation.CompilerConnection.InitializeSingleton () [0x0002f] in <d5f4d17a9e23471b97eef6dda1b7cd7c>:0
  at UnityEditor.Compilation.RoslynCompilerBootstrap..cctor () [0x0000a] in <d5f4d17a9e23471b97eef6dda1b7cd7c>:0
---> (Inner Exception #0) System.TypeInitializationException: The type initializer for 'ZeroMQ.lib.zmq' threw an exception. ---> System.EntryPointNotFoundException: mono_dllmap_insert
  at (wrapper managed-to-native) ZeroMQ.lib.Platform+Posix.mono_dllmap_insert(intptr,intptr,intptr,intptr,intptr)
  at ZeroMQ.lib.Platform+Posix.MonoDllMapInsert (System.String libraryName, System.String libraryPath) [0x0000e] in <89499c667382432583a6a5f1fb22bd37>:0
  at ZeroMQ.lib.Platform+Posix.LoadUnmanagedLibrary (System.String libraryName) [0x0022e] in <89499c667382432583a6a5f1fb22bd37>:0
  at ZeroMQ.lib.zmq..cctor () [0x00588] in <89499c667382432583a6a5f1fb22bd37>:0
   --- End of inner exception stack trace ---
  at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_generic_class_init(intptr)
  at ZeroMQ.ZContext..ctor () [0x00006] in <89499c667382432583a6a5f1fb22bd37>:0
  at UnityEditor.ServiceBroker.Client+<>c__DisplayClass6_0`1[T].<Subscribe>b__0 () [0x00000] in <d12a2b5a37c340e09a4b14574b3a784b>:0
  at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in <e1a80661d61443feb3dbdaac88eeb776>:0
  at System.Threading.Tasks.Task.Execute () [0x00010] in <e1a80661d61443feb3dbdaac88eeb776>:0 <---

UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes()
1 Like

FYI in case it helps anyone at Unity sort this out, I had this same problem when upgrading to Entities 0.0.12-preview.8 and Incremental Compiler 0.0.42-preview.12 just now, having recently updated to Unity 2018.2. Previously working code started erroring out with the out variable issue. Rebuilding the project and the other tips here didn’t work. So here’s what I did:

  1. Reverted the packages back to Entities preview.4 and Incremental preview.1.
  2. These now let me compile and run the code with older versions, getting rid of any errors.
  3. Once that was working, I then reinstalled Entities preview.12 and Incremental preview.12 and this time they installed just fine and no compiler issues. Project ran fine in the editor
  4. Now the bad news - upon exiting the editor and reloading the project, the problems come back. So it’s a short lived fix.

So basically reverting to an older working state and then reinstalling the packages seems to do something but there’s still evidently some guff going on with package issues. In the meantime, the older versions seem to remain functional.

what i was trying to say is that without the mcs.rsp file inside the asset folder i will get the same error again, that why it is not working out of the box for me… only if i add the file manually.

I do not know if this will help u, i’m running ubuntu 18.04, when i switch to 2018.2.0f1 i had the same problems, and the editor was crashing constantly, what fix it for my was adding the Gtk+ dev. Now i’m running 2018.2.0f2 with Entities 0.0.12-preview.8, Incremental Compiler 0.0.42-preview.12 and burst 0.2.4-preview.20 without problem (for now :stuck_out_tongue: ) of course the mcs.rsp file still a must for me.

Still a problem

This is due to using the incremental compiler version 0.0.42-preview.12
Please update tot0. 0.0.42-preview.16

Let me know if the issue persists

Dom

2 Likes

3578788--289159--upload_2018-7-28_7-51-41.png

3578788--289160--upload_2018-7-28_7-53-26.png

3578788--289159--upload_2018-7-28_7-51-41.png

I successfully uninstalled every version of .Net from 4.5 but now I can’t reinstall it
Woot?

Check this out: https://blogs.msdn.microsoft.com/astebner/2008/08/28/net-framework-cleanup-tool-users-guide/

Thanks but it doesn’t work.

Here is my solution
Did not include Incremental compiler cos it is too slow

With the latest incremental compiler installed, Unity hangs when I create a new script.

Edit: After about 5 minutes I get this error in the console:

(0,0): Unity.Compiler.Client.InvokeCompiler Exception:System.NullReferenceException: Object reference not set to an instance of an object
  at UnityEditor.Compilation.RoslynIncrementalCompiler.InvokeCompiler (System.String[] unityCompilerArguments, UnityEditor.Compilation.CustomCompiler+OnCompilerMessage onMessage, UnityEditor.Compilation.CustomCompiler+OnCompilationDone onDone) [0x000e2] in <2d6d91dfaaf94b06b79250aad042efa3>:0