Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Errors when compilling scripts inside a folder with Assembly Definition files

Discussion in '2017.2 Beta' started by TFlippy, Jul 7, 2017.

  1. TFlippy

    TFlippy

    Joined:
    Nov 12, 2014
    Posts:
    23
    Compilling scripts placed inside a folder with an assembly definition file gives me an error and doesn't show up any of the compiled code inside Visual Studio.

    The message mentions System.Globalization.CultureInfo culture, could it be related to Windows localization settings? I'm currently using Czech as the system language.

    Code (CSharp):
    1. ArgumentException: Value does not fall within the expected range.
    2. SyntaxTree.VisualStudio.Unity.Bridge.CompilationUnit.LanguageOf (SyntaxTree.VisualStudio.Unity.Bridge.CompilationUnit unit) (at <d459da3fb7b54c3291cd57d1330a7d06>:0)
    3. SyntaxTree.VisualStudio.Unity.Bridge.CompilationUnit.CompilationUnits (System.String method) (at <d459da3fb7b54c3291cd57d1330a7d06>:0)
    4. SyntaxTree.VisualStudio.Unity.Bridge.CompilationUnit.CompilationUnits () (at <d459da3fb7b54c3291cd57d1330a7d06>:0)
    5. SyntaxTree.VisualStudio.Unity.Bridge.ProjectSystem.UnitySolutionBuilder..ctor () (at <d459da3fb7b54c3291cd57d1330a7d06>:0)
    6. SyntaxTree.VisualStudio.Unity.Bridge.ProjectSystem.UnitySolutionBuilder.CreateSolutionFromAssetDatabase () (at <d459da3fb7b54c3291cd57d1330a7d06>:0)
    7. SyntaxTree.VisualStudio.Unity.Bridge.ProjectFilesGenerator.GenerateProject () (at <d459da3fb7b54c3291cd57d1330a7d06>:0)
    8. SyntaxTree.VisualStudio.Unity.Bridge.ProjectFilePostprocessor.OnPreGeneratingCSProjectFiles () (at <d459da3fb7b54c3291cd57d1330a7d06>:0)
    9. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <aa1756d827e14afe8f4b9355672b2ab4>:0)
    10. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    11. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <aa1756d827e14afe8f4b9355672b2ab4>:0)
    12. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <aa1756d827e14afe8f4b9355672b2ab4>:0)
    13. UnityEditor.AssetPostprocessingInternal.OnPreGeneratingCSProjectFiles () (at C:/buildslave/unity/build/Editor/Mono/AssetPostprocessor.cs:61)
    14. UnityEditor.VisualStudioIntegration.SolutionSynchronizer.Sync () (at C:/buildslave/unity/build/Editor/Mono/VisualStudioIntegration/SolutionSynchronizer.cs:182)
    15. UnityEditor.VisualStudioIntegration.SolutionSynchronizer.SyncIfNeeded (System.Collections.Generic.IEnumerable`1[T] affectedFiles) (at C:/buildslave/unity/build/Editor/Mono/VisualStudioIntegration/SolutionSynchronizer.cs:171)
    16. UnityEditor.SyncVS.PostprocessSyncProject (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromAssetPaths) (at C:/buildslave/unity/build/Editor/Mono/SyncProject.cs:177)
    17. UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPathAssets) (at C:/buildslave/unity/build/Editor/Mono/AssetPostprocessor.cs:31)
    Code (CSharp):
    1. Unhandled Exception:
    2. System.Threading.AbandonedMutexException: The wait completed due to an abandoned mutex.
    3.  
    4.   at System.Threading.WaitHandle.ThrowAbandonedMutexException () [0x00000] in <aa1756d827e14afe8f4b9355672b2ab4>:0
    5.  
    6.   at System.Threading.WaitHandle.InternalWaitOne (System.Runtime.InteropServices.SafeHandle waitableSafeHandle, System.Int64 millisecondsTimeout, System.Boolean hasThreadAffinity, System.Boolean exitContext) [0x00027] in <aa1756d827e14afe8f4b9355672b2ab4>:0
    7.  
    8.   at System.Threading.WaitHandle.WaitOne (System.Int64 timeout, System.Boolean exitContext) [0x00000] in <aa1756d827e14afe8f4b9355672b2ab4>:0
    9.  
    10.   at System.Threading.WaitHandle.WaitOne (System.Int32 millisecondsTimeout, System.Boolean exitContext) [0x00019] in <aa1756d827e14afe8f4b9355672b2ab4>:0
    11.  
    12.   at System.Threading.WaitHandle.WaitOne () [0x00000] in <aa1756d827e14afe8f4b9355672b2ab4>:0
    13.  
    14.   at Logger.Dispose () [0x00000] in <5407c48515f246c897c47c0270b41a80>:0
    15.  
    16.   at Program.Main (System.String[] args) [0x00061] in <5407c48515f246c897c47c0270b41a80>:0
    17. [ERROR] FATAL UNHANDLED EXCEPTION: System.Threading.AbandonedMutexException: The wait completed due to an abandoned mutex.
    18.  
    19.   at System.Threading.WaitHandle.ThrowAbandonedMutexException () [0x00000] in <aa1756d827e14afe8f4b9355672b2ab4>:0
    20.  
    21.   at System.Threading.WaitHandle.InternalWaitOne (System.Runtime.InteropServices.SafeHandle waitableSafeHandle, System.Int64 millisecondsTimeout, System.Boolean hasThreadAffinity, System.Boolean exitContext) [0x00027] in <aa1756d827e14afe8f4b9355672b2ab4>:0
    22.  
    23.   at System.Threading.WaitHandle.WaitOne (System.Int64 timeout, System.Boolean exitContext) [0x00000] in <aa1756d827e14afe8f4b9355672b2ab4>:0
    24.  
    25.   at System.Threading.WaitHandle.WaitOne (System.Int32 millisecondsTimeout, System.Boolean exitContext) [0x00019] in <aa1756d827e14afe8f4b9355672b2ab4>:0
    26.  
    27.   at System.Threading.WaitHandle.WaitOne () [0x00000] in <aa1756d827e14afe8f4b9355672b2ab4>:0
    28.  
    29.   at Logger.Dispose () [0x00000] in <5407c48515f246c897c47c0270b41a80>:0
    30.  
    31.   at Program.Main (System.String[] args) [0x00061] in <5407c48515f246c897c47c0270b41a80>:0
    32.  
    33. WARNING: The runtime version supported by this application is unavailable.
    34. Using default runtime: v4.0.30319
     
  2. siOnzeeCZ

    siOnzeeCZ

    Joined:
    Oct 21, 2016
    Posts:
    6
    Same here, but in Unity 2017.1.0f3
    Using NET 4.6 + Latest version of https://bitbucket.org/alexzzzz/unity-c-5.0-and-6.0-integration/downloads/

    Code (CSharp):
    1.  
    2. Unhandled Exception:
    3. System.Threading.AbandonedMutexException: The wait completed due to an abandoned mutex.
    4.  
    5.   at System.Threading.WaitHandle.ThrowAbandonedMutexException () [0x00000] in <a90417619fac49d5924050304d0280bb>:0
    6.  
    7.   at System.Threading.WaitHandle.InternalWaitOne (System.Runtime.InteropServices.SafeHandle waitableSafeHandle, System.Int64 millisecondsTimeout, System.Boolean hasThreadAffinity, System.Boolean exitContext) [0x0002d] in <a90417619fac49d5924050304d0280bb>:0
    8.  
    9.   at System.Threading.WaitHandle.WaitOne (System.Int64 timeout, System.Boolean exitContext) [0x00000] in <a90417619fac49d5924050304d0280bb>:0
    10.  
    11.   at System.Threading.WaitHandle.WaitOne (System.Int32 millisecondsTimeout, System.Boolean exitContext) [0x0001c] in <a90417619fac49d5924050304d0280bb>:0
    12.  
    13.   at System.Threading.WaitHandle.WaitOne () [0x00000] in <a90417619fac49d5924050304d0280bb>:0
    14.  
    15.   at Logger.Dispose () [0x00000] in <5407c48515f246c897c47c0270b41a80>:0
    16.  
    17.   at Program.Main (System.String[] args) [0x00061] in <5407c48515f246c897c47c0270b41a80>:0
    18. [ERROR] FATAL UNHANDLED EXCEPTION: System.Threading.AbandonedMutexException: The wait completed due to an abandoned mutex.
    19.  
    20.   at System.Threading.WaitHandle.ThrowAbandonedMutexException () [0x00000] in <a90417619fac49d5924050304d0280bb>:0
    21.  
    22.   at System.Threading.WaitHandle.InternalWaitOne (System.Runtime.InteropServices.SafeHandle waitableSafeHandle, System.Int64 millisecondsTimeout, System.Boolean hasThreadAffinity, System.Boolean exitContext) [0x0002d] in <a90417619fac49d5924050304d0280bb>:0
    23.  
    24.   at System.Threading.WaitHandle.WaitOne (System.Int64 timeout, System.Boolean exitContext) [0x00000] in <a90417619fac49d5924050304d0280bb>:0
    25.  
    26.   at System.Threading.WaitHandle.WaitOne (System.Int32 millisecondsTimeout, System.Boolean exitContext) [0x0001c] in <a90417619fac49d5924050304d0280bb>:0
    27.  
    28.   at System.Threading.WaitHandle.WaitOne () [0x00000] in <a90417619fac49d5924050304d0280bb>:0
    29.  
    30.   at Logger.Dispose () [0x00000] in <5407c48515f246c897c47c0270b41a80>:0
    31.  
    32.   at Program.Main (System.String[] args) [0x00061] in <5407c48515f246c897c47c0270b41a80>:0
    33.  
    34. WARNING: The runtime version supported by this application is unavailable.
    35. Using default runtime: v4.0.30319
    Any progress with your issue?
     
  3. TFlippy

    TFlippy

    Joined:
    Nov 12, 2014
    Posts:
    23
    Are you using the C# 7 version? I'm on 2017.2.b2 and it works fine for me. Remember to remove the old plugin from the project root as well.

    Regarding the error, it turned out I was using the assembly definition files, I just had to append the assembly name with -CSharp in the "name" field.