LabView calls the C # mixed-mode dll,

Source: Internet
Author: User

LabView calls the C # mixed-mode dll,

Under some specific requirements, our C # program may need to make a dll for LabView to call, and we cannot ensure that the C # program is completely written by ourselves without calling a third-party dll library. In many cases, we need to use Sqlite. net, AForge. net and other open-source libraries. At this time, we find that we need to use the hybrid mode to be compatible with these libraries.. NET 2.0 is an open-source library developed during runtime.

I. hybrid mode in C #

If it is a C # application, we only need to add the "Application configuration file" in the corresponding project of the project, that is, the app. config file:

<? Xml version = "1.0" encoding = "UTF-8"?> <Configuration> <startup useLegacyV2RuntimeActivationPolicy = "true"> <supportedRuntime version = "v4.0"/> </startup> </configuration>

Then we will see the corresponding configuration file in the compiled executable file. Its name is similar to the final generated executable file:

<? Xml version = "1.0" encoding = "UTF-8"?> <Configuration> <startup useLegacyV2RuntimeActivationPolicy = "true"> <supportedRuntime version = "v4.0"/> </startup> </configuration>

4. Place all the Assembly called by LabView in the root directory (this operation prevents some assembly from failing to find the other Assembly it references)

5. Run the executable file generated by LabView

For more information, see the NI Official Website: Loading. NET 2.0, 3.0, and 3.5 Assemblies in LabVIEW.

PS: of course, this method also has a problem, that is, it cannot be directly debugged.

Hope to help you! I also hope that you can give me some advice if you have a better method!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.