且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

添加.NET框架DLL作为参考Windows应用商店的应用程序

更新时间:2022-12-21 08:03:40

如果你坚持使用别人提供的一个库,如果试图游说他们生产的一个便携版本都不太可能成功,那么有关你能做的唯一一件事就是找到其他地方举办的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.