Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

UNetWeaver error: Exception :System.IO.IOException: Sharing violation on path Assembly-CSharp.dll

Discussion in 'Editor & General Support' started by SteamPunkProgrammer, Feb 16, 2016.

  1. SteamPunkProgrammer

    SteamPunkProgrammer

    Joined:
    Jan 27, 2015
    Posts:
    8
    I'm constantly getting a sharing violation with the assembly-csharp.dll, its definitely related to UNET.

    Code (csharp):
    1.  
    2. UNetWeaver error: Exception :System.IO.IOException: Sharing violation on path D:\UnityProjects\Project Arrow v3\Temp\Assembly-CSharp.dll
    3.   at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00251] in /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/FileStream.cs:320
    4.   at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0
    5.   at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
    6.   at Mono.Cecil.ModuleDefinition.GetFileStream (System.String fileName, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0
    7.   at Mono.Cecil.ModuleDefinition.Write (System.String fileName, Mono.Cecil.WriterParameters parameters) [0x00000] in <filename unknown>:0
    8.   at Mono.Cecil.AssemblyDefinition.Write (System.String fileName, Mono.Cecil.WriterParameters parameters) [0x00000] in <filename unknown>:0
    9.   at Unity.UNetWeaver.Weaver.Weave (System.String assName, IEnumerable`1 dependencies, IAssemblyResolver assemblyResolver, System.String unityEngineDLLPath, System.String unityUNetDLLPath, System.String outputDir) [0x00212] in C:\buildslave\unity\build\Extensions\Networking\Weaver\UNetWeaver.cs:1724
    10.   at Unity.UNetWeaver.Weaver.WeaveAssemblies (IEnumerable`1 assemblies, IEnumerable`1 dependencies, IAssemblyResolver assemblyResolver, System.String outputDir, System.String unityEngineDLLPath, System.String unityUNetDLLPath) [0x00062] in C:\buildslave\unity\build\Extensions\Networking\Weaver\UNetWeaver.cs:1748
    11. UnityEngine.Debug:LogError(Object)
    12. Unity.UNetWeaver.Log:Error(String) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/Program.cs:20)
    13. Unity.UNetWeaver.Weaver:WeaveAssemblies(IEnumerable`1, IEnumerable`1, IAssemblyResolver, String, String, String) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetWeaver.cs:1755)
    14. Unity.UNetWeaver.Program:Process(String, String, String, String[], String[], IAssemblyResolver, Action`1, Action`1) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/Program.cs:34)
    15. UnityEditor.Scripting.Serialization.Weaver:WeaveUnetFromEditor(String, String, String, String, Boolean)
    16.  
    Often times the only solution is to reboot (restarting unity has no effect, likely because some hidden process is keeping the file open, and I have no idea what one), but its gotten so bad now unity is basically unusable and for a full release patch, this isn't good, I saw this issue back in the beta patch but here it is still. Does anyone know of a work around for this?
     
  2. dmoroni

    dmoroni

    Joined:
    Mar 10, 2015
    Posts:
    23
    I'm getting the same error and I agree with the above user, this way the multiplayer system is unusable.
    Any good news about it? This is the error I get:

    Code (CSharp):
    1. UNetWeaver error: Exception :System.IO.IOException: Sharing violation on path C:\Dati\Progetti Unity\TEST_Multiplayer\TEST_01\Temp\Assembly-CSharp.dll
    2.   at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00251] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/FileStream.cs:320
    3.   at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0
    4.   at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
    5.   at Mono.Cecil.ModuleDefinition.GetFileStream (System.String fileName, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0
    6.   at Mono.Cecil.ModuleDefinition.Write (System.String fileName, Mono.Cecil.WriterParameters parameters) [0x00000] in <filename unknown>:0
    7.   at Mono.Cecil.AssemblyDefinition.Write (System.String fileName, Mono.Cecil.WriterParameters parameters) [0x00000] in <filename unknown>:0
    8.   at Unity.UNetWeaver.Weaver.Weave (System.String assName, IEnumerable`1 dependencies, IAssemblyResolver assemblyResolver, System.String unityEngineDLLPath, System.String unityUNetDLLPath, System.String outputDir) [0x00212] in C:\buildslave\unity\build\Extensions\Networking\Weaver\UNetWeaver.cs:1724
    9.   at Unity.UNetWeaver.Weaver.WeaveAssemblies (IEnumerable`1 assemblies, IEnumerable`1 dependencies, IAssemblyResolver assemblyResolver, System.String outputDir, System.String unityEngineDLLPath, System.String unityUNetDLLPath) [0x00062] in C:\buildslave\unity\build\Extensions\Networking\Weaver\UNetWeaver.cs:1748
    10. UnityEngine.Debug:LogError(Object)
    11. Unity.UNetWeaver.Log:Error(String) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/Program.cs:20)
    12. Unity.UNetWeaver.Weaver:WeaveAssemblies(IEnumerable`1, IEnumerable`1, IAssemblyResolver, String, String, String) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetWeaver.cs:1755)
    13. Unity.UNetWeaver.Program:Process(String, String, String, String[], String[], IAssemblyResolver, Action`1, Action`1) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/Program.cs:34)
    14. UnityEditor.Scripting.Serialization.Weaver:WeaveUnetFromEditor(String, String, String, String, Boolean)
     
  3. LindYo

    LindYo

    Joined:
    Jun 6, 2016
    Posts:
    1
    Any solution to this error? I've been constantly getting this too.
     
  4. Fadedd

    Fadedd

    Joined:
    Mar 27, 2017
    Posts:
    1
    i am getting exact the same error, too
     
  5. Deleted User

    Deleted User

    Guest

    I'm having problems related to this on my iMac setup. The same project seems to run fine on windows. Def tied to UNetWeaver
     
  6. aaronfranke

    aaronfranke

    Joined:
    Jan 23, 2017
    Posts:
    20
    Same problem here, Unity 2017.2.0f3
     
  7. florinel2102

    florinel2102

    Joined:
    May 21, 2019
    Posts:
    75
    Same 2020.3.19f1 :(