![](/img/trans.png)
[英]Project works in Visual Studio. But vscode + Omnisharp fails with "You need to specify platform (x86, Win32 or x64)" for Nuget pkg: ScreenRecorderLib
[英]Unable to load assembly with platform setting all win32 or x86
您首先需要确定 x86 和 x64 库位置:
x86path = (Path.GetDirectoryName(Assembly.GetAssembly(GetType()).CodeBase) + @"\x86\").Replace("file:\\", ""); x64path = (Path.GetDirectoryName(Assembly.GetAssembly(GetType()).CodeBase) + @"\x64\").Replace("file:\\", "");
然后要使用您想要的库并正确调用它,您需要尝试 InteropDotNet 包: https : //github.com/AndreyAkinshin/InteropDotNet
Github: https : //www.nuget.org/packages/InteropDotNet/
您可能不想使用整个包,但它有一个很好的功能,可以生成调用本机库的代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.