Unity 文件加载失败:"System.Threading.Tasks.Dataflow"



这周我偶然遇到了一个bug,它阻止了我继续工作,我不知道如何解决它。我打开一个Unity项目的VS Code,它告诉我

OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: c:UsersjamieDocumentsUnityProjectsOTHERWOODLYAssembly-CSharp.csproj

问题是由错误日志中的这一行引起的,但我也会在帖子末尾发布整个错误:

System.IO.FileNotFoundException: Could not load file or assembly 'System.Threading.Tasks.Dataflow, Version=4.6.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

我已经尝试更新。net并重新下载了Mono的最新版本。我还将这些设置添加到VS Code

中的c#设置中。
"omnisharp.path": "latest",
"omnisharp.useGlobalMono": "always",

似乎没有什么能解决它。这里真的很茫然,如果有人有任何想法,我将非常感激!

完整错误信息:

[info]: OmniSharp.MSBuild.ProjectManager
Loading project: c:UsersjamieDocumentsUnityProjectsOTHERWOODLYAssembly-CSharp-Editor.csproj
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file 'c:UsersjamieDocumentsUnityProjectsOTHERWOODLYAssembly-CSharp-Editor.csproj'.
c:UsersjamieDocumentsUnityProjectsOTHERWOODLYAssembly-CSharp-Editor.csproj(0,0)
System.IO.FileNotFoundException: Could not load file or assembly 'System.Threading.Tasks.Dataflow, Version=4.6.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Threading.Tasks.Dataflow, Version=4.6.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at Microsoft.Build.BackEnd.Logging.LoggingService.ProcessLoggingEvent(Object buildEvent, Boolean allowThrottling)
at Microsoft.Build.BackEnd.Logging.LoggingService.LogProjectEvaluationStarted(BuildEventContext projectEvaluationEventContext, String projectFile)
at Microsoft.Build.Evaluation.Evaluator`4.Evaluate()
at Microsoft.Build.Evaluation.Evaluator`4.Evaluate(IEvaluatorData`4 data, ProjectRootElement root, ProjectLoadSettings loadSettings, Int32 maxNodeCount, PropertyDictionary`1 environmentProperties, ILoggingService loggingService, IItemFactory`2 itemFactory, IToolsetProvider toolsetProvider, ProjectRootElementCacheBase projectRootElementCache, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, EvaluationContext evaluationContext, Boolean interactive)
at Microsoft.Build.Evaluation.Project.ProjectImpl.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
at Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
at Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(EvaluationContext evaluationContext)
at Microsoft.Build.Evaluation.Project.ProjectImpl.Initialize(IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary`2 globalProperties, String toolsVersion)
at OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore(String filePath, IReadOnlyDictionary`2 projectConfigurationsInSolution) in D:a1ssrcOmniSharp.MSBuildProjectLoader.cs:line 157
at OmniSharp.MSBuild.ProjectLoader.BuildProject(String filePath, IReadOnlyDictionary`2 configurationsInSolution) in D:a1ssrcOmniSharp.MSBuildProjectLoader.cs:line 75
at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load(String filePath, ProjectIdInfo projectIdInfo, ProjectLoader loader, Guid sessionId, DotNetInfo dotNetInfo) in D:a1ssrcOmniSharp.MSBuildProjectFileProjectFileInfo.cs:line 116
at OmniSharp.MSBuild.ProjectManager.<>c__DisplayClass31_0.<LoadProject>b__0() in D:a1ssrcOmniSharp.MSBuildProjectManager.cs:line 304
at OmniSharp.MSBuild.ProjectManager.LoadOrReloadProject(String projectFilePath, Func`1 loader) in D:a1ssrcOmniSharp.MSBuildProjectManager.cs:line 315

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLMSoftwareMicrosoftFusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLMSoftwareMicrosoftFusion!EnableLog].

我相信我也有同样的问题,并通过下载Visual Studio Build Tools 2019 https://visualstudio.microsoft.com/visual-cpp-build-tools/解决了这个问题,然后用它来安装"。. NET桌面构建工具。我没有包括任何可选选项。然后我重新启动VS Code,错误消失了。

相关内容

最新更新