无法使用 DllImport 找到 VSIX dll [英] Can't find VSIX dlls with DllImport

查看:31
本文介绍了无法使用 DllImport 找到 VSIX dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 VSIX 扩展,它依赖于从非托管 DLL 部署的代码.我已经在 VSIX 中包含了 DLL,并且我用 zip 程序打开了 VSIX,以确认它已正确部署.但是,当我使用 DllImport 属性时,.NET Framework 声称它找不到它.如何从 VSIX 中打包的 DLL 中导入函数?

I have a VSIX extension which depends on code deployed from an unmanaged DLL. I've included the DLL with the VSIX, and I cracked open the VSIX with a zip program to confirm that it is deployed correctly. However, when I use the DllImport attribute, the .NET Framework claims that it can't find it. How can I import functions from a DLL packaged inside my VSIX?

推荐答案

我不知道这里出了什么问题,但我重新安装了 Windows 和 Visual Studio,没有对项目进行任何更改,现在一切正常.我在为其他应用程序查找 DLL 时遇到了其他一些问题,我猜它们是相关的,我一定是搞砸了一些设置.

I dunno what is going wrong here, but I reinstalled Windows and Visual Studio, made no changes to the project, and now everything is fine. I had some other issues with finding DLLs for other applications, and I guess they were related, I must have just screwed up some setting.

这篇关于无法使用 DllImport 找到 VSIX dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆