简体   繁体   English

无法解决“找不到类型或命名空间名称‘mshtml’”错误

[英]Can't resolve "The type or namespace name 'mshtml' could not be found" error

I added Microsoft HTML Object Library as COM Type Libraries to use mshtml .我添加了Microsoft HTML Object Library作为 COM 类型库以使用mshtml

I could build the project when I used in Visual Studio 2017. But after updating to Visual Studio 2019, there is a error The type or namespace name 'mshtml' could not be found .我在 Visual Studio 2017 中使用时可以构建项目。但是更新到 Visual Studio 2019 后,出现错误The type or namespace name 'mshtml' could not be found

I have no idea why the library is not recognized.我不知道为什么图书馆不被认可。

How can I resolve the error?我该如何解决错误?

I installed Unofficial.Microsoft.mshtml from NuGet package manager, then the problem was resolved.我从 NuGet 包管理器安装了Unofficial.Microsoft.mshtml ,然后问题就解决了。

I don't know why official dll doesn't work, though.不过,我不知道为什么官方 dll 不起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM