诡异的错误,但是原因超级简单,就是临时文件夹的问题,为什么抛出错误而不是解决它呢?或者报告更明确的错误信息也好啊。
https://stackoverflow.com/questions/3221565/microsoft-build-utilities-filetracker-threw-an-exception-error-happens-with-dif
Old question but I hope it will help someone who googles it. Its not exactly the Nullref in the original question which was caused by the bug tracked by Microsoft but I want to share it.
I had serious problems building C++ projects which I tracked down to be caused by the Temp environment variables (propably containing spaces in the path names).
Unerwarteter Fehler bei der CL-Aufgabe. System.TypeInitializationException: Der Typeninitialisierer für "Microsoft.Build.Utilities.FileTracker" hat eine Ausnahme verursacht. ---> System.IO.FileNotFoundException: Das System kann die angegebene Datei nicht finden. (Ausnahme von HRESULT: 0x80070002) bei System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) bei System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode) bei Microsoft.Build.Shared.NativeMethodsShared.ThrowExceptionForErrorCode(Int32 errorCode) bei Microsoft.Build.Shared.NativeMethodsShared.GetLongFilePath(String path) bei Microsoft.Build.Utilities.FileTracker..cctor() --- Ende der internen Ausnahmestapelüberwachung --- bei Microsoft.Build.CPPTasks.CL.ComputeOutOfDateSources() bei Microsoft.Build.CPPTasks.TrackedVCToolTask.SkipTaskExecution() bei Microsoft.Build.Utilities.ToolTask.Execute() bei Microsoft.Build.CPPTasks.TrackedVCToolTask.Execute() bei Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() bei Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()
Changing TEMP and TMP to:
%USERPROFILE%\Appdata\Local\Temp
solved it.
好消息是,后续版本已经正确处理。
正文完