C# 无法加载文件或程序集';System.Threading.Tasks.Dataflow,版本=4.6.3.0

C# 无法加载文件或程序集';System.Threading.Tasks.Dataflow,版本=4.6.3.0,c#,unity3d,visual-studio-code,omnisharp,C#,Unity3d,Visual Studio Code,Omnisharp,我使用的是Unity+vs code+Window10 有一天,OmniSharp无缘无故地停止了工作。感谢您的帮助! 我已尝试重新安装vscode、.net核心sdk和c#扩展。不走运 [warn]: OmniSharp.MSBuild.ProjectManager Failed to load project file 'c:\CYF\Unity\BehaviourTreeAI\bhtree\Assembly-CSharp-Editor.csproj'. c:\CYF\Uni

我使用的是Unity+vs code+Window10

有一天,OmniSharp无缘无故地停止了工作。感谢您的帮助! 我已尝试重新安装vscode、.net核心sdk和c#扩展。不走运

[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'c:\CYF\Unity\BehaviourTreeAI\bhtree\Assembly-CSharp-Editor.csproj'.
c:\CYF\Unity\BehaviourTreeAI\bhtree\Assembly-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:\a\1\s\src\OmniSharp.MSBuild\ProjectLoader.cs:line 157
   at OmniSharp.MSBuild.ProjectLoader.BuildProject(String filePath, IReadOnlyDictionary`2 configurationsInSolution) in D:\a\1\s\src\OmniSharp.MSBuild\ProjectLoader.cs:line 75
   at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load(String filePath, ProjectIdInfo projectIdInfo, ProjectLoader loader, Guid sessionId, DotNetInfo dotNetInfo) in D:\a\1\s\src\OmniSharp.MSBuild\ProjectFile\ProjectFileInfo.cs:line 116
   at OmniSharp.MSBuild.ProjectManager.<>c__DisplayClass31_0.<LoadProject>b__0() in D:\a\1\s\src\OmniSharp.MSBuild\ProjectManager.cs:line 304
   at OmniSharp.MSBuild.ProjectManager.LoadOrReloadProject(String projectFilePath, Func`1 loader) in D:\a\1\s\src\OmniSharp.MSBuild\ProjectManager.cs:line 315

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!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 [HKLM\Software\Microsoft\Fusion!EnableLog].
[warn]:OmniSharp.MSBuild.ProjectManager
无法加载项目文件“c:\CYF\Unity\Behavior TreeAI\bhtree\Assembly CSharp Editor.csproj”。
c:\CYF\Unity\behaviortTreeAi\bhtree\Assembly CSharp Editor.csproj(0,0)
System.IO.FileNotFoundException:无法加载文件或程序集“System.Threading.Tasks.Dataflow,版本=4.6.3.0,区域性=中性,PublicKeyToken=b03f5f7f11d50a3a”或其依赖项之一。系统找不到指定的文件。
文件名:“System.Threading.Tasks.Dataflow,版本=4.6.3.0,区域性=neutral,PublicKeyToken=b03f5f7f11d50a3a”
在Microsoft.Build.BackEnd.Logging.LoggingService.ProcessLoggingEvent(对象构建事件,布尔allowThrottling)中
在Microsoft.Build.BackEnd.Logging.LoggingService.LogProjectEvaluationStarted(BuildEventContext项目EvaluationEventContext,String项目文件)中
在Microsoft.Build.Evaluation.Evaluator`4.Evaluate()中
在Microsoft.Build.Evaluation.Evaluator`4.Evaluate(IEEvaluatorData`4数据、ProjectRootElement根、ProjectLoadSettings加载设置、Int32 maxNodeCount、PropertyDictionary`1环境属性、ILoggingService loggingService、IItemFactory`2 itemFactory、IToolsetProvider工具集Provider、ProjectRootElementCacheBase projectRootElementCache、BuildEventContext BuildEventContext、ISdkResolverService sdkResolverService,Int32 submissionId,EvaluationContext EvaluationContext,布尔交互式)
在Microsoft.Build.Evaluation.Project.ProjectImpl.Reevaluation(iLogginService loggingServiceForEvaluation、ProjectLoadSettings、loadSettings、EvaluationContext EvaluationContext)
在Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluationIfNecessary(ILoggingService loggingServiceForEvaluation、ProjectLoadSettings、loadSettings、EvaluationContext EvaluationContext)
在Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluationIfNecessary(EvaluationContext EvaluationContext)上重新评估
在Microsoft.Build.Evaluation.Project.ProjectImpl.Initialize(IDictionary`2全局属性、字符串工具版本、字符串子解决方案版本、项目加载设置加载设置、评估上下文评估上下文)
位于Microsoft.Build.Evaluation.Project..ctor(字符串项目文件、IDictionary`2全局属性、字符串工具版本、字符串子解决方案版本、项目集合项目集合、项目加载设置加载设置、评估上下文评估上下文)
位于Microsoft.Build.Evaluation.ProjectCollection.LoadProject(字符串文件名,IDictionary`2全局属性,字符串工具版本)
在D:\a\1\s\src\OmniSharp.MSBuild\ProjectLoader.EvaluateProjectFileCore(字符串文件路径,IReadOnlyDictionary`2 projectConfigurationsInSolution)中的OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore处:第157行
在D:\a\1\s\src\OmniSharp.MSBuild\ProjectLoader.BuildProject(字符串文件路径,IReadOnlyDictionary`2 configurationsInSolution)中的D:\a\1\s\src\OmniSharp.MSBuild\ProjectLoader.cs:第75行
在D:\a\1\s\src\OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load(字符串文件路径、projectdinfo projectdinfo、ProjectLoader加载器、Guid sessionId、DotNetInfo DotNetInfo)中的OmniSharp.MSBuild\ProjectFile\ProjectFileInfo.cs:第116行
在D:\a\1\s\src\OmniSharp.MSBuild\ProjectManager.c\uuu中显示class31\u 0.b\uu 0(),第304行
在D:\a\1\s\src\OmniSharp.MSBuild\ProjectManager.LoadOrReloadProject(字符串projectFilePath,Func`1 loader)中的OmniSharp.MSBuild.ProjectManager.cs:第315行
警告:程序集绑定日志记录已关闭。
要启用程序集绑定失败日志记录,请将注册表值[HKLM\Software\Microsoft\Fusion!EnableLog](DWORD)设置为1。
注意:程序集绑定失败日志记录会带来一些性能损失。
要关闭此功能,请删除注册表值[HKLM\Software\Microsoft\Fusion!EnableLog]。

我今天也犯了同样的错误

在我的例子中,虽然我目前只使用VS代码,但我仍然安装了Visual Studio 2017社区版和Visual Studio Build Tools 2017


将我的VS代码升级到1.54.0(今天发布)后将Visual Studio Community Edition和Visual Studio Build Tools升级到2019版后,该漏洞就消失了。没有更多的Omnisharp错误,没有更多的问题通知警报,Intellisense又开始工作了。

我也遇到了这个问题,我认为这是一个Omnisharp漏洞。我刚刚更新到Omnisharp 1.37.8-beta.2版,看起来像是我的包括此问题的错误修复,它为我修复了此问题