我如何引用"便携及QUOT;从碧​​霞功能.NET程序集? [英] How do I reference a "Portable" .NET assembly from an Azure Cloud Function?

查看:215
本文介绍了我如何引用"便携及QUOT;从碧​​霞功能.NET程序集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经成功地通过引用和的NuGet一个project.json装配这是一个便携式集会。我所有的代码编译在Azure的功能,但它的运行时,我得到:

I've successfully referenced an assembly via Nuget and project.json that is a "Portable" assembly. All my code compiles in the Azure function, but when it's run I get:

无法加载文件或程序集System.Net,版本= 2.0.5.0,文化=中性公钥= 7cec85d7bea7798e,重定目标=是或它的一个依赖。该系统找不到指定的文件。

Could not load file or assembly 'System.Net, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies. The system cannot find the file specified.

据我了解,这是System.Net的移植版本,并只天青的预安装4.6版本的System.Net的。

As I understand it this is the portable version of System.Net, and Azure only preinstalls the 4.6 version of System.Net.

我如何解决此问题?

推荐答案

这是由已经在当前的Azure功能的主机里程碑解决,将与下一个版本(可能是朝周结束)部署的错误引起的。你可以找到关于这个问题,在这里修复的详细信息: https://开头github.com/Azure/azure-webjobs-sdk-script/issues/478

This is caused by a bug that has been addressed on the current Azure Functions host milestone and will be deployed with the next release (likely towards the end of the week). You can find more information about the issue and the fix here: https://github.com/Azure/azure-webjobs-sdk-script/issues/478

在此期间,一个解决方法是复制System.Net从该框架文件夹到bin文件夹,你的函数的文件夹内。主机会自动解决它作为一个私人集会。

In the meantime, a workaround would be to copy System.Net from the Framework folder into a bin folder, inside of your function's folder. The host will automatically resolve it as a private assembly.

这篇关于我如何引用"便携及QUOT;从碧​​霞功能.NET程序集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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