询问者
MSB401"CL"任务意外失败 error

问题
-
严重性 代码 说明 项目 文件 行 禁止显示状态
错误 MSB4018 “CL”任务意外失败。
System.TypeInitializationException: “Microsoft.Build.Utilities.FileTracker”的类型初始值设定项引发异常。 ---> System.UnauthorizedAccessException: 拒绝访问。 (异常来自 HRESULT:0x80070005 (E_ACCESSDENIED))
在 System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
在 Microsoft.Build.Shared.NativeMethodsShared.ThrowExceptionForErrorCode(Int32 errorCode)
在 Microsoft.Build.Shared.NativeMethodsShared.GetLongFilePath(String path)
在 Microsoft.Build.Utilities.FileTracker..cctor()
--- 内部异常堆栈跟踪的结尾 ---
在 Microsoft.Build.Utilities.FileTracker.FormatRootingMarker(ITaskItem[] sources)
在 Microsoft.Build.CPPTasks.CL.ComputeOutOfDateSources()
在 Microsoft.Build.CPPTasks.TrackedVCToolTask.SkipTaskExecution()
在 Microsoft.Build.Utilities.ToolTask.Execute()
在 Microsoft.Build.CPPTasks.VCToolTask.Execute()
在 Microsoft.Build.CPPTasks.TrackedVCToolTask.Execute()
在 Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
在 Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() Projectlistnode C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets 423- 已移动 Jeanine ZhangMicrosoft contingent staff 2020年9月9日 6:46
全部回复
-
-
Hi Kaylee77,
"MSB4018 “CL”任务意外失败" 一般是运行环境配置的问题。我们可以尝试卸载并重新安装Visual Studio以解决此问题。
如果此问题仍然存在,请尝试修改TEMP和TMP环境变量(用户和系统),并将temp目录重新指向其他位置,并将这两个文件夹的权限设置为“完全控制”。
Best Regards,
Dylan
MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com
- 已建议为答案 Dylan Zhu-MSFTMicrosoft contingent staff 2020年9月14日 1:14
-
通过修改TEMP/TMP的路径解决了,感谢
- 已建议为答案 Sara LiuMicrosoft contingent staff, Moderator 2020年9月22日 5:49
-
Hi Kaylee77,
很高兴听到我的回复可以帮助到你。
我们建议你可以把它标记为答案,这会有利于其他也有相同问题的社区成员检索到这个问题。
谢谢你的配合。
Best Regards,
Dylan
MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com