Any thoughts on what might be causing this exception ?
Exception during runtime resolution of assembly 'Microsoft.Azure.ServiceBus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7e34167dcc6d6d8c': 'System.InvalidCastException: [A]System.AppDomain cannot be cast to [B]System.AppDomain. Type A originates from 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' in the context 'Default' at location 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.0.0\System.Private.CoreLib.dll'. Type B originates from 'System.Runtime.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' in the context 'Default' at location 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.0.0\System.Runtime.Extensions.dll'.
I have created a class library with .net Standard 2.0 and added 2 azure functions one for httpTrigger & other for serviceBusTrigger.
httpTrigger is working as expected however serviceBusTrigger is crashing with below error Error Message.
ServiceBusTrigger.cs :
using Microsoft.Azure.ServiceBus;
namespace TriggerCore
{
public static class SBTrigger
{
static SBTrigger()
{
}
public static void Run(Message message)
{
}
}
}
function.json :
{
"bindings": [
{
"type": "serviceBusTrigger",
"queueName": "myqueue",
"accessRights": "manage",
"name": "message"
}
],
"disabled": false,
"scriptFile": "../TriggerCore.dll",
"entryPoint": "TriggerCore.SBTrigger.Run"
}
Microsoft.Azure.ServiceBus version 1.0.0
NetStandard.Library version 2.0.0