开发者

Using Native dlls in C# Com wrapper and Use dll in silverlight

开发者 https://www.devze.com 2022-12-21 15:57 出处:网络
As part of my project I need to use some Unamanged code dlls in Silverlight. If I wrap these unmanaged dlls in a C# dll will I be able to access the native dlls from silverlight. I use Visual Studio 2

As part of my project I need to use some Unamanged code dlls in Silverlight. If I wrap these unmanaged dlls in a C# dll will I be able to access the native dlls from silverlight. I use Visual Studio 2010 开发者_JS百科 and Silverlight 4.0


With Silverlight 4, you can call out to COM objects installed on the local machine. However to do this the user has to choose to allow the Silverlight App full access to their machine.

In addition the COM object needs to already be installed on the machine. Therefore the user would first have to separately download and install your DLLs before using any features that relied on them in your Silverlight application.


Silverlight runs in the browser sandbox so it wont allow you to call directly to unmanaged assembly. Eventhough you wrap the unmanaged code in a C# assembly, it still get loaded within the same app domain that is restricted by the same security restriction.

I have read that you can use html interoperability between silverlight and ActiveX, but I haven't experienced it myself. Alternatively, you can deploy the complete WPF application and if you sign it with appropriate certificate and security setting, it can access unmanaged code - if this is an option.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号