最近由于以下错误,我无法在工作中构建我的项目:
Cannot find the interop type that matches the embedded type 'DOMDocument'. Are you missing an assembly reference?
老实说,我不太确定如何处理错误,也无法找出问题所在。它给了我一个文件,它在顶部有这些导入语句:
Imports X.Online.Core
Imports X.Online.Connectivity
Imports X.Online.Classes
Imports Microsoft.VisualBasic
Imports System.ComponentModel
Imports System.Web
Imports X.Asp.Classes
Imports X.Asp.Core
Imports X.Asp.SiteSpecific
Imports MSXML2
Imports X.Online.State
Imports Elmah
据我所知,似乎我遗漏了一些东西,我看了看,起初我认为它是一个丢失的 MSXML2,但它在我的引用文献中显示为“Interop.MSXML2”,所以现在我我不确定那是问题所在。我应该补充一点,这个问题是在从 Windows 7 升级到 Windows 10 后出现的。
我还阅读了此处列出的建议:https://blogs.msdn.microsoft.com/vbteam/2010/06/11/troubleshooting-errors-when-embedding-type-information-doug-rothaus/
而且我还尝试修复我的 .net 4 安装。
如果有人可以就我如何解决此错误提供一些建议,我将不胜感激!
最佳答案
只是为了让人们知道,如果其他人有过类似的问题。我的问题似乎是 Visual Studio 为两个项目导入了互操作文件,但两个项目都链接到了 .dll 的单独版本。我删除了它们并确保添加对完全相同文件的引用,这解决了我的问题。
关于.net - Visual Studio : Cannot find the interop type that matches the embedded type 'DOMDocument' . 您是否缺少程序集引用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37006701/