Question

I have MyDotNet4.dll that user installs as application on machine. In my case this is components that will take care of interfacing with TWAIN scanner.

I also have my Silverlight application with elevated permissions (SL4 OOB or SL5 in/out of browser)

I want to somehow invoke methods of MyDotNet4.dll using Silverlight code. Is that possible? How? Any pointers or sample code?

My idea is to have Silverlight app and if user needs scanning - I will let him download and install real windows app and than I would like to somehow talk to this app from Silverlight.

Was it helpful?

Solution

Silverlight does have local messaging but that works only between two silverlight apps. See the following for LocalMessaging

From this similar SO post: Communicating with a Silverlight 4 LocalMessageReceiver from a Desktop Application and this other thread here on the silverlight forums seems you're out of luck and you will have to implement your own communication scheme.

I'm assuming your SL app needs to invoke the scanning app and get the image. You could run your scanning app like this and then have the app drop the picture in a know directory which your SL app can then pick.

OTHER TIPS

It may not work, but have a look at this blog, http://netfxharmonics.com/2008/12/Reusing-NET-Assemblies-in-Silverlight, see The Assembly-Level Technique section if (as your question suggests) you do not have the source code for the dll in question. I have faint recollection that I used that method as a test a long while back, but since I had the source I ended up going with the file level approach to share common code between a dll referenced by my Silverlight project and my console app project

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top