Visual Studio不认识引用的组件?
几年前开放了一个旧项目。构建失败之所以失败,是因为Visual Studio(2019)无法识别出显然在那里的组件 - 特别是AUTOFAC。
- 但是,在代码中,所有类型都没有显示出Awol。
这里发生了什么? IntelliSense甚至没有接收类型 (尝试清洁,重建,重新导入包))
Opened an old project from years ago. Build fails because Visual Studio (2019) does not recognize an assembly that is clearly there - specifically, Autofac.
You can see it in project references (not marked as missing)
You can see it in the Object Browser, listing all the types referenced in the code
- But in code, none of the types show up, gone AWOL.
What is going on here? Intellisense doesn't even pick up types
(Tried cleaning, rebuilding, re-importing packages)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,这就是有效的。我必须删除对AutoFac DLL的引用,然后将其添加回。注意 - 我从相同的确切位置添加了回去,相同的确切版本。但是之后,Visual Studio“神奇地”认识到它。
如果您遇到类似的问题,而没有其他作用,请尝试一下。我不知道原因,我只能认为这是Visual Studio中的某种错误。
Okay, this is what worked. I had to remove the reference to the Autofac dll, and then add it back. Note - I added it back from the same exact location, the same exact version. But after this, Visual Studio 'magically' recognized it.
If you come across a similar problem, and nothing else works, give it a try. I don't know the reason, I can only assume this is some sort of a bug in Visual Studio.