Using Third-Party .NET 4.6.2 Framework Driver in UWP Application

Ryan Anders-McDowell 21 Reputation points
2022-04-05T06:24:23.087+00:00

I am building a Universal Windows Platform (UWP) application that needs to interface with a serial device using the third-party NI-VISA .NET driver, which targets .NET Framework 4.6.2 1.

When I tried to reference the driver in my UWP application, I realized that making it compatible with the project would be difficult/impossible, since the project uses .NETCore rather than the .NET Framework. This leads me to ask the following questions:

  • Is it true that using a third-party .NET Framework driver in a UWP application is not possible?
  • Are there any workarounds or alternative approaches to solving this issue?

For reference, this is the error I received in Visual Studio 2019 when I attempted to reference the driver:

A reference to 'C:\Program Files (x86)\IVI Foundation\VISA\Microsoft.NET\Framework32\v4.0.30319\NI VISA.NET 21.5\NationalInstruments.Visa.dll' could not be added. The project targets '.NETCore' while the file reference targets '.NETFramework'. This is not a supported scenario.

Thank you for your time,
Ryan

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,648 questions
Universal Windows Platform (UWP)
0 comments No comments
{count} votes

Accepted answer
  1. Roy Li - MSFT 32,731 Reputation points Microsoft Vendor
    2022-04-05T07:49:38.197+00:00

    Hello,

    Welcome to Microsoft Q&A!

    Is it true that using a third-party .NET Framework driver in a UWP application is not possible?

    Yes, it is not possible to do that.

    Are there any workarounds or alternative approaches to solving this issue?

    A workaround is that you could create a console application and use the driver in that console application. Then package the console application with your UWP app together using desktop bridge.

    When the UWP app is running, it could launch the console application to do the task that you need. For more detailed steps, you could open your favorite search engine and search for UWP with Desktop Extension written by Stefan Wick. That blog contains full tutorial about how to implement this.

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful