Microsoft.Build.Utilities.FileTracker threw an exception error. Happens with different projects

前端 未结 4 1842
陌清茗
陌清茗 2021-01-17 15:47

Lately with Visual Studio 2010 Ultimate, C#, in Win7 64bit, I get the error below when I compile any project. The workaround is to add false<

4条回答
  •  [愿得一人]
    2021-01-17 16:32

    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.d__20.MoveNext()
    

    Changing TEMP and TMP to:

    %USERPROFILE%\Appdata\Local\Temp
    

    solved it.

提交回复
热议问题