Error CS1061 'DeviceClient' does not contain a definition for 'SetInputMessageHandlerAsync'

697 Views Asked by At

I try to build IoT Edge module termo sensor from the Microsoft sources. When I build project, I got the error:

"Error CS1061 'DeviceClient' does not contain a definition for 'SetInputMessageHandlerAsync' and no accessible extension method 'SetInputMessageHandlerAsync' accepting a first argument of type 'DeviceClient' could be found (are you missing a using directive or an assembly reference?)"

Source was built with error

Then I created IoT Edge module from the scratch, compare assembly version and start building the module and everything was built ok.

IoT module from the scratch was built Ok

I follow to the DeviceClient class from the VS 2017 IDE for the app which is built ok.

SetInputMessageHandlerAsync is available in DeviceClient class.

But when I follow to the DeviceClient class in the application with building problem - I saw, that there is no such method.

SetInputMessageHandlerAsync is absent in DeviceClient class.

I compare assembly version - it's equal.

1

There are 1 best solutions below

0
On

I found the problem. In the module from the scratch is used ModuleClient instead of DeviceClient in the Microsoft Sources. :-)