首页 > 解决方案 > Unity3d 错误 CS2011:打开响应文件时出错(临时文件夹不正确)

问题描述

我需要你的帮助。(已经张贴在这里没有帮助)

我刚刚在“C:\Program Files\Unity\Hub\Editor\2019.1.5f1\”的第二台计算机上安装了 Unity,启动 Unity 后直接出现 5 个错误,既不能编译任何东西,也不能进入 Unity 播放模式。在我的第一台计算机上,这些错误不存在。无论是空白项目还是拥有大量资产的项目都没有关系。两台计算机都在装有 Visual Studio Professional 2017 的 Windows 10 64 位上运行。到目前为止,重新安装 Unity 和 Visual Studio 并没有帮助。

图片:有错误的 Unity 控制台

我已经阅读了许多其他有关“打开响应文件时出错”的类似问题的帖子,但它们大多指的是带有写保护的符号链接或路径。我的问题似乎有所不同,编辑器位于“C:\Program Files\Unity\Hub\Editor\2019.1.5f1\”,项目位于“C:\Projekte\New Unity Project\”。更改项目路径并不重要。我已经尝试了 3 个不同的驱动器位置。

在 Editor.log 文件中搜索详细信息,我可以看到 5 个临时文件产生了这种错误:

 -----Compiler Commandline Arguments:
 Filename: C:\Program Files\Unity\Hub\Editor\2019.1.5f1\Editor\Data\Tools\RoslynScripts\unity_csc.bat
 Arguments: /noconfig @Temp/UnityTempFile-e08d5c71413756945837148f68a69ad6
 Responsefile: Temp/UnityTempFile-e08d5c71413756945837148f68a69ad6 Contents: 
 /target:library
 /nowarn:0169
 /out:Temp/Unity.TextMeshPro.dll

[接下来是大约 300 行设置,/reference's,/define's 和路径 - 之后是...]

 -----CompilerOutput:-stdout--exitcode: 1--compilationhadfailure: True--outfile: Temp/Unity.TextMeshPro.dll
 Microsoft (R) Visual C# Compiler version 2.9.1.65535 (9d34608e)
 Copyright (C) Microsoft Corporation. All rights reserved.

 error CS2011: Error opening response file 'C:\Windows\System32\Temp/UnityTempFile-6d2a68ef4f8feff48b081cfff22fd108'
 warning CS2008: No source files specified.
 error CS1562: Outputs without source must have the /out option specified
 -----CompilerOutput:-stderr----------
 -----EndCompilerOutput---------------
 - Finished compile Library/ScriptAssemblies/Unity.TextMeshPro.dll

它们的不同之处在于以下几行:

错误一:

 -----CompilerOutput: [...] True--outfile: Temp/Unity.TextMeshPro.dll
 error CS2011: Error opening response file 'C:\Windows\System32\Temp/UnityTempFile-6d2a68ef4f8feff48b081cfff22fd108'
 - Finished compile Library/ScriptAssemblies/Unity.TextMeshPro.dll

错误2:

 -----CompilerOutput: [...] True--outfile: Temp/Unity.Timeline.dll
 error CS2011: Error opening response file 'C:\Windows\System32\Temp/UnityTempFile-e08d5c71413756945837148f68a69ad6'
 - Finished compile Library/ScriptAssemblies/Unity.Timeline.dll

错误 3:

 -----CompilerOutput: [...] True--outfile: Temp/Unity.PackageManagerUI.Editor.dll
 error CS2011: Error opening response file 'C:\Windows\System32\Temp/UnityTempFile-f2661e8f7fbea0e48843d231bc5bf5d2'
 - Finished compile Library/ScriptAssemblies/Unity.PackageManagerUI.Editor.dll

错误 4:

 -----CompilerOutput: [...] True--outfile: Temp/Unity.CollabProxy.Editor.dll
 error CS2011: Error opening response file 'C:\Windows\System32\Temp/UnityTempFile-6b0dbb9b1dfd0a24f95ef817f65e991f'
 - Finished compile Library/ScriptAssemblies/Unity.CollabProxy.Editor.dll

错误 5:

 -----CompilerOutput: [...] True--outfile: Temp/Unity.Analytics.DataPrivacy.dll
 error CS2011: Error opening response file 'C:\Windows\System32\Temp/UnityTempFile-6b3cf37143da036458b1886861b10eb3'
 - Finished compile Library/ScriptAssemblies/Unity.Analytics.DataPrivacy.dll

但它们的共同点是缺少“C:\Windows\System32\Temp\”中的响应文件。我不知道他们为什么要在这个文件夹中查找,因为所有这 5 个临时文件都存在,但在 Unity 项目文件夹中,我希望它们在其中。Unity 只是不在此文件夹中查找。

图片:位于正确文件资源管理器位置的 Unity 临时文件

这可能是什么以及您将如何解决它?

真诚的,克里斯蒂安

标签: c#windowsunity3dcompiler-errorstemporary-files

解决方案


我最近发现了一个相关的帖子

事实证明,我的工作场所在注册表中设置了 HKEY_CURRENT_USER\SOFTWARE\Microsoft\Command Processor\Autorun 键以将我当前的工作目录更改为 system32,从而导致问题。

我从注册表中删除了密钥,现在它又可以工作了!


推荐阅读