如何解决Microsoft.Assumes + InternalErrorException:文件不应依赖于自身在asp.net Core 3.1 Visual Studio Windows上
试图在Windows VM上的Visual Studio 2019中打开在Visual Studio for Mac中创建的项目,并收到此错误。
=====================
8/22/2020 3:14:58 AM
NotRecoverable
Microsoft.Assumes+InternalErrorException: File should not depend on itself.
at Microsoft.Assumes.Fail(String message)
at Microsoft.VisualStudio.ProjectSystem.Designers.PhysicalProjectTreeProvider.ResolveDependentItems(Dictionary`2 pendingItemsByDirectory)
at Microsoft.VisualStudio.ProjectSystem.Designers.PhysicalProjectTreeProvider.GenerateOriginalTree(ConfiguredProjectExports configuredProjectExports,CancellationToken cancellationToken)
at Microsoft.VisualStudio.ProjectSystem.Designers.PhysicalProjectTreeProvider.<GenerateOriginalTreeAsync>d__208.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.ProjectSystem.ProjectTreeProviderBase.TreeUpdateSubmission.<UpdateTree>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.VisualStudio.ProjectSystem.CoreProjectTreeProviderBase.<>c__DisplayClass76_1.<<Initialize>b__2>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.ProjectSystem.CoreProjectTreeProviderBase.<>c__DisplayClass78_0.<<SubmitTreeUpdateCoreAsync>g__waitOnTask|0>d.MoveNext()
RunningInVisualStudio Microsoft.VisualStudio.ProjectSystem.RetailRuntime HostSetActiveProjectConfiguration
===================
解决方法
我在proj文件中设置了Generated文件和其他相关文件的相关性时遇到了类似的问题。 就我而言,依赖文件的掩码File * .cs包括File.cs
<ItemGroup Label="Database"> <Compile Update="Data\File*.cs"> <DependentUpon>File.cs</DependentUpon>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。