App Function Queue Trigger -- The type or namespace name 'ServiceBus' does not exist in the namespace 'Microsoft' RRS feed

  • Question

  • Hi,

    I'm trying to create a App Function Queue Trigger to processing a BrokeredMessage. I have created a project.sjon file with the following text.

    "frameworks": {
    "dependencies": {
    "WindowsAzure.ServiceBus": "4.1.6"


    When I save it, the following log is created.

    2017-11-17T14:05:30.805 Restoring packages.
    2017-11-17T14:05:30.805 Starting NuGet restore
    2017-11-17T14:05:32.211 Restoring packages for D:\home\site\wwwroot\ServiceBusQueueTriggerCSharp1\project.json...
    2017-11-17T14:05:32.946 GET
    2017-11-17T14:05:33.102 OK 155ms
    2017-11-17T14:05:33.149 GET
    2017-11-17T14:05:33.305 OK 144ms
    2017-11-17T14:05:33.633 Installing WindowsAzure.ServiceBus 4.1.6.
    2017-11-17T14:05:36.897 Committing restore...
    2017-11-17T14:05:36.910 Writing lock file to disk. Path: D:\home\site\wwwroot\ServiceBusQueueTriggerCSharp1\project.lock.json
    2017-11-17T14:05:36.988 D:\home\site\wwwroot\ServiceBusQueueTriggerCSharp1\project.json
    2017-11-17T14:05:36.988 Restore completed in 4812ms.
    2017-11-17T14:05:37.004 NuGet Config files used:
    2017-11-17T14:05:37.004 C:\DWASFiles\Sites\mawsFnPlaceholder636\AppData\NuGet\NuGet.Config
    2017-11-17T14:05:37.004 Feeds used:
    2017-11-17T14:05:37.039 Installed:
    2017-11-17T14:05:37.039 1 package(s) to D:\home\site\wwwroot\ServiceBusQueueTriggerCSharp1\project.json
    2017-11-17T14:05:37.113 Packages restored.
    2017-11-17T14:05:37.426 Script for function 'ServiceBusQueueTriggerCSharp1' changed. Reloading.
    2017-11-17T14:05:37.508 Compilation succeeded.

    When I add the using statement to the function code 

    using System;
    using System.Threading.Tasks;
    using Microsoft.ServiceBus.Messaging;
    public static void Run(BrokeredMessage message, TraceWriter log)
    log.Info($"C# ServiceBus queue trigger function processed message:");

    Save the code, i get the following log

    2017-11-17T14:06:52.187 Script for function 'ServiceBusQueueTriggerCSharp1' changed. Reloading.
    2017-11-17T14:06:52.313 run.csx(3,17): error CS0234: The type or namespace name 'ServiceBus' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
    2017-11-17T14:06:52.313 run.csx(5,24): error CS0246: The type or namespace name 'BrokeredMessage' could not be found (are you missing a using directive or an assembly reference?)
    2017-11-17T14:06:52.328 Compilation failed.

    Does anyone have any ideas as to what I'm missing?


    Friday, November 17, 2017 2:38 PM

All replies