试图将BouncyCastle c#dll添加到我的WP8原生应用程序中。
我为Windows Phone 8创建了一个Windows运行时组件 我在组件中扭曲现有的C#dll并创建MyBouncyCastleComponent.winmd 我打开我的WP8原生项目,并添加winmd作为参考结果: 在编译时 “警告:没有为.winmd文件提供实现文件”
在运行时它崩溃,当我停止模拟器时,我得到“WinRT信息:类未注册” (它比这长得多,抱怨在窗口文件中缺少PDB文件,如Windows.winmd和System.Windows.RuntimeHost.ni.dll)
我用ILDASM打开了winmd。 解密和加密的实现在那里? 我究竟做错了什么?
我知道有人问过没有为.winmd文件提供实施文件但是还没有答案。 我再试一次......(无法弄清楚如何将其添加为问题)
编辑: 只是一个澄清。 当我说:“ 我在组件中扭曲现有的C#dll并创建MyBouncyCastleComponent.winmd ” 我所做的是将BouncyCastle 源代码放入运行时组件中,并使用包装类来公开我需要的BouncyCastle方法。
Trying to add BouncyCastle c# dll to my WP8 native app.
I create a Windows Runtime Component for Windows Phone 8 I warp an existing C# dll in the component and create MyBouncyCastleComponent.winmd I open my WP8 native project and I add the winmd as a referenceResult: At compile time "warning: No implementation file was provided for the .winmd file"
At runtime it crashes and when I stop the emulator I got "WinRT information: Class not registered" (its much longer than that, complaining about missing PDB file's in window files like Windows.winmd and System.Windows.RuntimeHost.ni.dll)
I opened the winmd with ILDASM. The implementations of decrypt and encrypt are there? What am I doing wrong?
I know its been asked No implementation file was provicded for the .winmd file but there is no answer yet. I'm trying again... (couldn't figure out how to add it as a question there)
EDIT: Just a clarification. when I say: "I warp an existing C# dll in the component and create MyBouncyCastleComponent.winmd" what I did was take BouncyCastle source code put it in the runtime component with a wrapper class to expose the BouncyCastle methods I needed.
最满意答案
看起来你正试图通过箍来尝试获得一个为完整的.NET框架编译的C#DLL,以便在Windows Phone上运行。 Windows Phone使用不同的.NET配置文件,并且与完整的.NET框架不是二进制兼容的,因此这不起作用。
对于BouncyCastle,您需要引用专门为Windows Phone构建的二进制DLL - 例如,通过BouncyCastle源代码自己构建一个。
更新:当您使用BouncyCastle的子集时,您可以将所需的源代码放在可移植类库项目中,以便可以直接在Windows Phone和Windows应用商店应用中使用。
It very much looks like you're jumping through hoops to try and get a C# DLL compiled for the full .NET framework to work on Windows Phone. Windows Phone uses a different .NET profile and isn't binary compatible with the full .NET framework, so this cannot work.
For BouncyCastle you will need to reference a binary DLL built specifically for Windows Phone - for example by building one yourself from the BouncyCastle source code.
UPDATE: As you're using a subset of BouncyCastle you may be able to put the source code you need inside a Portable Class Library project so it can be directly used in both Windows Phone and Windows Store apps.
更多推荐
winmd,BouncyCastle,dll,电脑培训,计算机培训,IT培训"/> <meta name="descri
发布评论