UnityEditor unusable ? :: error CS0016

Hello my friends…
im getting the following errors every time I try to compile my scripts:

error CS0016: Could not write to file `Temp/Assembly-CSharp.dll', cause: Sharing violation on path C:\Users\Office\Documents\Jumper\Temp\Assembly-CSharp.dll.mdb

Compilation failed: 1 error(s), 0 warnings


UNetWeaver error: Exception :System.ArgumentException: Member 'System.Int32 UnityEngine.Networking.NetworkConnection::hostId' is declared in another module and needs to be imported
  at Mono.Cecil.MetadataBuilder.LookupToken (IMetadataTokenProvider provider) [0x00000] in <filename unknown>:0 
  at Mono.Cecil.Cil.CodeWriter.WriteOperand (Mono.Cecil.Cil.Instruction instruction) [0x00000] in <filename unknown>:0 
  at Mono.Cecil.Cil.CodeWriter.WriteInstructions () [0x00000] in <filename unknown>:0 
  at Mono.Cecil.Cil.CodeWriter.WriteResolvedMethodBody (Mono.Cecil.MethodDefinition method) [0x00000] in <filename unknown>:0 
  at Mono.Cecil.Cil.CodeWriter.WriteMethodBody (Mono.Cecil.MethodDefinition method) [0x00000] in <filename unknown>:0 
  at Mono.Cecil.MetadataBuilder.AddMethod (Mono.Cecil.MethodDefinition method) [0x00000] in <filename unknown>:0 
  at Mono.Cecil.MetadataBuilder.AddMethods (Mono.Cecil.TypeDefinition type) [0x00000] in <filename unknown>:0 
  at Mono.Cecil.MetadataBuilder.AddType (Mono.Cecil.TypeDefinition type) [0x00000] in <filename unknown>:0 
  at Mono.Cecil.MetadataBuilder.AddTypeDefs () [0x00000] in <filename unknown>:0 
  at Mono.Cecil.MetadataBuilder.BuildTypes () [0x00000] in <filename unknown>:0 
  at Mono.Cecil.MetadataBuilder.BuildModule () [0x00000] in <filename unknown>:0 
  at Mono.Cecil.MetadataBuilder.BuildMetadata () [0x00000] in <filename unknown>:0 
  at Mono.Cecil.ModuleWriter.<BuildMetadata>b__0 (Mono.Cecil.MetadataBuilder builder, Mono.Cecil.MetadataReader _) [0x00000] in <filename unknown>:0 
  at Mono.Cecil.ModuleDefinition.Read[MetadataBuilder,MetadataBuilder] (Mono.Cecil.MetadataBuilder item, System.Func`3 read) [0x00000] in <filename unknown>:0 
  at Mono.Cecil.ModuleWriter.BuildMetadata (Mono.Cecil.ModuleDefinition module, Mono.Cecil.MetadataBuilder metadata) [0x00000] in <filename unknown>:0 
  at Mono.Cecil.ModuleWriter.WriteModuleTo (Mono.Cecil.ModuleDefinition module, System.IO.Stream stream, Mono.Cecil.WriterParameters parameters) [0x00000] in <filename unknown>:0 
  at Mono.Cecil.ModuleDefinition.Write (System.IO.Stream stream, Mono.Cecil.WriterParameters parameters) [0x00000] in <filename unknown>:0 
  at Mono.Cecil.ModuleDefinition.Write (System.String fileName, Mono.Cecil.WriterParameters parameters) [0x00000] in <filename unknown>:0 
  at Mono.Cecil.AssemblyDefinition.Write (System.String fileName, Mono.Cecil.WriterParameters parameters) [0x00000] in <filename unknown>:0 
  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:1733 
  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:1757 
Unity.UNetWeaver.Log:Error(String) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/Program.cs:20)
Unity.UNetWeaver.Weaver:WeaveAssemblies(IEnumerable`1, IEnumerable`1, IAssemblyResolver, String, String, String) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetWeaver.cs:1764)
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)
UnityEditor.Scripting.Serialization.Weaver:WeaveUnetFromEditor(String, String, String, String, Boolean)


Failure generating network code.
UnityEditor.Scripting.Serialization.Weaver:WeaveUnetFromEditor(String, String, String, String, Boolean)

I dont know what happend it was just there. Im trying to get rid of this error since 2 days but I dont know what the problem could be. I saw the part with “hostId” but i dont even use this variable.

And I know this question was asked before and the most time they say I should turn off my anti virus but i dont even have such a program installed ¯_(ツ)_/¯

I hope someone of you has a solution for this problem !

Yeah finally I discovered the problem . There was an error with the following script:

using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Networking;
using System.Collections.Generic;

public class ScoreboardManager : NetworkBehaviour

	public static ScoreboardManager INSTANCE;

	public GameObject scoreboardItem;
	public Transform scoreboardContainer;

	public SyncListScoreboardEntry scoreboardEntrys = new SyncListScoreboardEntry ();

	void Start ()
		INSTANCE = this;

	void RpcRefreshScoreboard ()
		Debug.Log ("Scoreboard needs to refresh !");

		if (scoreboardEntrys == null)

		var children = new List<GameObject> ();
		foreach (Transform child in scoreboardContainer)
			children.Add (child.gameObject);
		children.RemoveAt (0);
		children.ForEach (child => Destroy (child));

		foreach (ScoreboardEntry element in scoreboardEntrys) {
			GameObject item = (GameObject)Instantiate (scoreboardItem, Vector2.zero, Quaternion.identity);

			item.transform.GetChild (0).GetComponent<Text> ().text = element.name;
			item.transform.GetChild (1).GetComponent<Text> ().text = element.score.ToString ();
			item.transform.GetChild (2).GetComponent<Text> ().text = element.deaths.ToString ();

			item.transform.SetParent (scoreboardContainer);
			item.transform.localPosition = Vector2.zero;
			item.GetComponent<RectTransform> ().localScale = Vector3.one;

			//GUILayout.Box("Name: " + element.name + "  Score: " + element.score);

	public void UpdateScoreboard ()
		OnlinePlayer[] pls = NetworkingManager.INSTANCE.onlinePlayers.ToArray ();

		if (scoreboardEntrys != null)
			scoreboardEntrys.Clear ();

		for (int i = 0; i < pls.Length; i++) {
			ScoreboardEntry entry = new ScoreboardEntry ();
			entry.name = pls *.name;*

_ entry.deaths = pls .deaths;_
_ entry.score = pls .score;
//entry.conn = pls*.networkConnection;*_

* scoreboardEntrys.Add (entry);*

Debug.Log (i + “Info:” + pls .name + " " + pls .deaths);
* }*

* RpcRefreshScoreboard ();*
* }*

* public struct ScoreboardEntry*
* {*
* public string name;*
* public int score;*
* public int deaths;*
* //public NetworkConnection conn;*
* }*

* public class SyncListScoreboardEntry : SyncListStruct*
* {*

* }*
In this script I used the NetworkConnection and if I comment it out and restart the Unity3D-Editor the error is gone. But I think it is very annoying that I have to restart Unity to get rid of this error. But thank you
> Thank you Jessespike for the hint with the NetworkConnection :slight_smile: