![](/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.