错误 1 “GenerateResource”任务意外失败。
System.TypeInitializationException: “Microsoft.Build.Utilities.FileTracker”的类型初始值设定项引发异常。 ---> System.NullReferenceException: 未将对象引用设置到对象的实例。
在 Microsoft.Build.Utilities.FileTracker..cctor()
--- 内部异常堆栈跟踪的结尾 ---
在 Microsoft.Build.Utilities.FileTracker.EnsureFileTrackerOnPath(String rootPath)
在 Microsoft.Build.Tasks.GenerateResource.Execute()
在 Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
在 Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult) WindowsFormsApplication1
Windows7 x64,vs2010.
解决方法
打开文件: C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/Microsoft.Common.Targets
找到
<GenerateResource
…
TrackFileAccess="$(TrackFileAccess)"
TrackerLogDirectory="$(TrackerLogDirectory)"
…
</GenerateResource>
删除
TrackFileAccess="$(TrackFileAccess)"
TrackerLogDirectory="$(TrackerLogDirectory)"