6

I know that there are a lot of threads talking about this topics but please let me discuss my problem in some details.

In our project, we are using a lot of devices (Cameras, Printers, Fingerprint devices, Smartcard readers) in desktop applications and we have already C# components that are developed to deal with these devices using their SDKs.

The problem now is that we are moving into web development and we are supposed to convert our WPF desktop applications into ASP.NET MVC web applications and also we should use our existing components for the devices.

The possible solutions to deal with devices from web .Net application are:

  1. Using ActiveX (Which is dead or will die soon and it required some COM experience and very hard to develop).
  2. Using Silverlight (Also, is dead or will die soon and it is very limited such that we can not add reference to existing C# components).
  3. Using Java Applets (which require some Java experience and we will rewrite existing c# components in Java).

Is there any other solution so that we can deal with devices from ASP.NET MVC application over Intranet?

4
  • 2
    Java Applets in the browser are as good as dead.
    – Snarf
    Aug 12, 2015 at 19:11
  • The accepted answer at stackoverflow.com/questions/13021723/… might be helpful. Aug 12, 2015 at 19:43
  • 1
    The problem now is that we are moving into web development - exactly. Web "applications" are not suitable when you require hardware access like that. Keep your desktop app and use the web for what the web is intended to.
    – Fede
    Aug 13, 2015 at 3:37
  • m looking for the same any solutions yet?
    – Samra
    Sep 19, 2017 at 6:57

2 Answers 2

1

You can write browser extensions for Chrome, Firefox, and Edge (soon). I'm not sure how much code reuse you'll get across the browsers if you need to target them all, and I'm not sure of the extent to which you can run arbitrary code to connect to devices from your extensions, but it's something you should look into. You can then have your browser extensions communicate with your webpages to pass the necessary data.

Your users would need to install the extension for their browser to receive the functionality.

0

You can still distribute small "helper" applications that are based on a pared down version of your current WPF applications. These would perform the device access, and communicate directly back to your web server. The web site would serve as the interface.

This would allow you to leverage your existing device communication code. On the downside, it requires a separate install on the client, which means one more thing for the user to do and one more thing to keep updated.

6
  • I don't think this is a solution. Breaking a single .Net application into separate smaller applications just for the sake of using a crappy web browser is a very poor decision.
    – Fede
    Aug 13, 2015 at 3:39
  • @HighCore it is a perfectly viable alternative that I have seen companies use. It's not perfect for every situation, but it's one possible solution.
    – mason
    Aug 13, 2015 at 3:41
  • what advantage does this approach provide versus a full fledged .Net (WPF) app, please?
    – Fede
    Aug 13, 2015 at 3:46
  • @HighCore the question specifically states they are moving to a web interface instead. I don't know why. There are plenty of advantages to that. You should be able to think of some of them. For example, perhaps your site should talk to a GPS device, so you leverage existing .NET code to perform the sync, while taking advantage of the web's ability to run on any device, write once run anywhere. Maybe his new boss likes the web. Or they find it easier to hire web devs than WPF. Like I said, I don't know the exact reasons for the move to the web, but a little imagination shows there's reasons.
    – mason
    Aug 13, 2015 at 3:53
  • @HighCore if you can't see the benefits of the web, that's fine. But you're not contributing anything to this discussion. I didn't say the .NET app would run anywhere, I said the web would. In the case of a GPS app, like for example for tracking jogs, then perhaps you want to leverage existing code to perform the sync on a Windows computer, but users should be able to view the day from any computer, tablet, or phone. And the web is write once, run anywhere. Rather than maintaining multiple disparate apps for each platform, now you just need one. There are advantages to this approach.
    – mason
    Aug 13, 2015 at 4:26