Unity unetweaver异常

时间:2017-09-01 14:06:07

标签: c# unity3d

我得到了这两个编译错误:

UNetWeaver error: Exception :System.UnauthorizedAccessException: Access to the path "C:\Users\futur\Desktop\Anarchy_TheGame\Anarchy Game\Temp\Assembly-CSharp-firstpass.dll" is denied.
  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 
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
  at Mono.Cecil.ModuleDefinition.GetFileStream (System.String fileName, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0 
  at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0 
  at Mono.Cecil.AssemblyDefinition.ReadAssembly (System.String fileName, Mono.Cecil.ReaderParameters 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) [0x00041] in C:\buildslave\unity\build\Extensions\Networking\Weaver\UNetWeaver.cs:1715 
  at Unity.UNetWeaver.Weaver.WeaveAssemblies (IEnumerable`1 assemblies, IEnumerable`1 dependencies, IAssemblyResolver assemblyResolver, System.String outputDir, System.String unityEngineDLLPath, System.String unityUNetDLLPath) [0x0006e] in C:\buildslave\unity\build\Extensions\Networking\Weaver\UNetWeaver.cs:1843 
UnityEngine.Debug:LogError(Object)
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:1851)
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)

我的项目中只有FPSController Directional Light和Terrain。 FPSController脚本(第一人称控制器)显示:

  

无法加载关联的脚本,请修复任何编译错误   并指定一个有效的脚本。

但是这个脚本没有错误 我该如何解决这些错误?我不能在不修复游戏的情况下运行游戏。

2 个答案:

答案 0 :(得分:1)

这是来自5.1.0f3的Unity版本的常见问题。要解决这些问题,建议重新导入所有资产或重新启动Unity。

修改
这不是固定的,因为它在this issue tracker

上说明

目前解决此问题的方法是尝试重新导入资产,或者如果没有解决问题,只需创建一个新项目并将资产复制并粘贴回新项目。

答案 1 :(得分:1)

防病毒软件阻止了Assembly-CSharp-firstpass.dll

  

解决方案:在项目文件夹

的防病毒软件中添加例外