views:

303

answers:

3

Hi all.
I am tring to add dll file to my Silverlight application but get error which says that I can't add reference which wasn't built with Silverlight runtime.
Is there any solution?
Thanks.

+2  A: 

Try creating an empty Silverlight class library, then add all your code to that project, then you will be able to add it to a silverlight application as a reference.

If this does not meet your needs, upgrade to Silverlight 4, you should be able to add libraries to your project with no problems, but the library will still run in the limited security context of the silverlight runtime

Edit:

Try using a reflector like C# reflector for .net to disassemble the dll, then you can migrate the code, otherwise best advice is to move to Silverlight 4 if you are just starting the project

Neil
Thanks for answer, but I can't copy code from dll, because dll is not written by me, it's from other library. Any ideas?
Samvel Siradeghyan
+1  A: 

Nothing you can do for S3 unless you have access to the source (Even if you did have the source, the silverlight sandbox is restrictive so it probably wouldn't compile anyway)

vidalsasoon
+3  A: 

Hi
Try to use WCF Service to connect to your DLL.I did that way and it solved my problem.

Noro
Hi user187156. Thanks for answer. I was tring to solve this problem 2 days, but nothing helped. Your answer solved the problem. Thank you very much.
Samvel Siradeghyan