now that asp.net core 2.0 is here I started to test out the new azure webjobs sdk. Everything works fine but when I Add a project reference (netstandard 2.0 class library) I get this exception.
Stack Trace:
System.MissingMethodException occurred HResult=0x80131513 Message=Method not found: 'System.Collections.Generic.Dictionary
2<System.String,System.Object> Microsoft.Extensions.Configuration.IConfigurationBuilder.get_Properties()'. Source=<Cannot evaluate the exception source> StackTrace: at Microsoft.Extensions.Configuration.FileConfigurationExtensions.GetFileProvider(IConfigurationBuilder builder) at Microsoft.Extensions.Configuration.FileConfigurationSource.EnsureDefaults(IConfigurationBuilder builder) at Microsoft.Extensions.Configuration.Json.JsonConfigurationSource.Build(IConfigurationBuilder builder) at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build() at Microsoft.Azure.WebJobs.Host.ConfigurationUtility.BuildConfiguration() at System.Lazy
1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy
1.CreateValue() at Microsoft.Azure.WebJobs.Host.ConfigurationUtility.get_Configuration() at Microsoft.Azure.WebJobs.Host.ConfigurationUtility.GetSettingFromConfigOrEnvironment(String settingName) at Microsoft.Azure.WebJobs.JobHostConfiguration..ctor(String dashboardAndStorageConnectionString) at Microsoft.Azure.WebJobs.JobHostConfiguration..ctor() at CommunicationsProcessor.Program.Main(String[] args) in C:\Users\RugerTek\Documents\Projects\facturas\CommunicationsProcessor\Program.cs:line 13
Thanks in advance!
I also tested it on my side. But I can't reproduce the issue. Here are the steps what I did.
Step 1, Create a .NET Core 2.0 Console Application. Step 2, Install Microsoft.Azure.WebJobs 3.0.0-beta1-10941 using following command.
Install-Package Microsoft.Azure.WebJobs -Version 3.0.0-beta1-10941
Step 3, Add 2 classes to the project.
class Program
{
static void Main(string[] args)
{
Environment.SetEnvironmentVariable("AzureWebJobsDashboard", "mystorage-connectionstring");
Environment.SetEnvironmentVariable("AzureWebJobsStorage", "mystorage-connectionstring");
var config = new JobHostConfiguration();
if (config.IsDevelopment)
{
config.UseDevelopmentSettings();
}
var host = new JobHost(config);
host.RunAndBlock();
}
}
public class Functions
{
public static void ProcessQueueMessage([QueueTrigger("myqueue")] string message, TextWriter log)
{
log.WriteLine(message);
}
}
Step 4, Create a .NET Standard 2 class library named ALibrary. There is a only a simple type in my class library.
public class Class1
{
public string Property1 { get; set; }
}
Step 5, Add reference to the class library.
Step 6, Build and run my console application(WebJob). I can get the right output from the console window if I add a message to the queue.
Please compare the steps between mine and yours and post the differences if they are.
User contributions licensed under CC BY-SA 3.0