我有一个Azure功能,我需要通过IoT Hub将消息发送回我的设备。 每次我尝试添加语句:无法将Microsoft.Azure.Devices命名空间添加到Azure功能run.csx
using Microsoft.Azure.Devices;
我得到下面的错误:
run.csx(11,23): error CS0234: The type or namespace name 'Devices' does not exist in the namespace 'Microsoft.Azure' (are you missing an assembly reference?)
但奇怪的错误提示,如果我只是去为using Microsoft.Azure
,没有编译错误。
所以我尝试使用设备与我的代码,如static Devices.ServiceClient client;
,但同样的错误。
我也尝试过使用#r "Microsoft.Azure.Devices
,但那也没用。
我试着完全创建一个新的函数应用程序服务,但同样的错误只是不断弹出。
我project.json文件看起来是这样的:
{
"frameworks": {
"net47":{
"dependencies": {
"Microsoft.Azure.Devices": "1.4.1"
}
}
}
}
我尝试使用net46
也。
我的应用程序的小能解密:
所以我的职责应该由ServiceBusTopic
触发,具有BlobStorage
作为输入。
不知道如何将我的数据发送回我的设备,因为此名称空间未被添加。
我正在调查此问题。我能够repro(应该是“net46”,但你尝试过,就像我一样)。与此同时,如果我为Visual Studio 2017使用Azure函数工具,我可以很好地工作。他们使用。net [类库](https://docs.microsoft.com/en-us/azure/azure-functions/functions-dotnet-class-library)比.csx更容易处理。看看在这期间是否有效,我会继续探讨。 – jeffhollan