添加.NET框架DLL作为参考Windows应用商店的应用程序 [英] Adding .NET Framework DLL as reference to windows store app

查看:469
本文介绍了添加.NET框架DLL作为参考Windows应用商店的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作,我想从美国国家仪器数据采集读取一个简单的温度测量数据的Windows应用商店的应用程序项目。然而,DLL库的数据采集为.NETFramework 4.0格式,并添加时以此为参考,以我的Windows应用商店的应用程序的项目,我得到以下错误:项目的目标是.NetFramework,而该文件的参考指标.NetCore '

I'm working on a windows store app project where I want to read a simple temperature measurement data from a National Instruments DAQ. However the DLL library for the DAQ is in .NETFramework 4.0 format and when adding this as reference to my windows store app project I get the following error: "The project targets ‘.NetFramework’ while the file reference targets ‘.NetCore’"

搜索网,我发现,Windows应用商店的应用程序必须使用引用到另一个.NETCore或随身图书馆二进制而已,它不能引用一个完整的.NET 4.0库。我想有很多人谁也有类似的问题,所以我不知道是否有各地的招数任何一个角落都在那里?

Searching the net, I found out that windows store app must use references to another .NETCore or Portable Library binary only, it cannot reference a full .NET 4.0 library. I guess there is many people who have similar problems,so I wonder if there is any walk around tricks out there?

推荐答案

如果你坚持使用别人提供的一个库,如果试图游说他们生产的一个便携版本都不太可能成功,那么有关你能做的唯一一件事就是找到其他地方举办的DLL,然后与任何承载它交流。例如,对于某些方案有可能写入,比方说,一个ASP.NET Web API的基于服务,这将能够使用完整的.NET框架,从而将能够使用DLL

If you're stuck with using a library supplied by someone else, and if attempts to lobby them to produce a portable version are unlikely to succeed, then about the only thing you can do is find somewhere else to host the DLL, and then communicate with whatever is hosting it. For example, for some scenarios it may be possible to write, say, an ASP.NET Web API based service, which will be able to use the full .NET Framework and will thus be able to use the DLL.

显然,这种交易再一个问题:你现在需要有一台机器可以为你运行一个Web服务。 (不幸的是,我相信微软并没有正式支持运行在运行Windows应用商店的应用程序在同一台机器上的Web应用程序。您可能仍然能够得到它的工作,虽然你无法部署Web应用程序本身通过Windows应用商店。)

Obviously, this trades one problem for another: you now need to have a machine which can run a web service for you. (And unfortunately, I belive Microsoft does not officially support running that web app on the same machine that's running the Windows Store app. You may still be able to get it to work, although you'll not be able to deploy the web app itself via the Windows Store.)

和这里没有容易的道路 - 你得给你通过HTTP服务需要一个层暴露一切,和客户端code来使用这些服务。而且你还需要考虑如何安全地访问该服务。

And there's no easy path here - you'll have to write a layer exposing everything you need via HTTP services, and client-side code to consume those services. And you'll also need to think about how to to secure access to the service.

它可能会更恳求你的供应商......

It may be easier to plead with your supplier...

在理论上,如果恰巧库未使用的核心.NET配置文件以外的任何东西,那么你可以使用ILDASM和ILASM地进行反编译和重新编译code,将其转换为在这样做之前的便携库。不过,这很可能会违反许可协议,如果它的商业code,在任何情况下,很可能无法正常工作。

In theory, if it so happens that the library isn't using anything outside of the core .NET profile, then you could use ILDASM and ILASM to de-compile and re-compile the code, converting it to a portable library before doing so. However, this is quite likely to breach your license agreement if it's commercial code, and in any case, is quite likely not to work.

这篇关于添加.NET框架DLL作为参考Windows应用商店的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆