Azure -Funktionen v1 auf .NET Framework 4.8: TimerTigger wird nicht entdeckt [keine Auftragsfunktionen gefunden. VersuchC#

Ein Treffpunkt für C#-Programmierer
Anonymous
 Azure -Funktionen v1 auf .NET Framework 4.8: TimerTigger wird nicht entdeckt [keine Auftragsfunktionen gefunden. Versuch

Post by Anonymous »

Ich versuche, eine von Timer ausgelöste Funktion in einem V1 -Azure -Funktionsprojekt auszuführen.

Code: Select all

  using System;
using System.Threading.Tasks;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;

namespace ScreeningSync
{
public static class ScreeningSyncFunction
{
[FunctionName("ScreeningSyncFunction")]
public static async Task Run([TimerTrigger("*/5 * * * * *")] TimerInfo timer,ILogger log)
{
log.LogInformation($"Sync Triggered at {DateTime.UtcNow:O}");

var config = new ConfigurationBuilder()
.SetBasePath(Environment.CurrentDirectory)
.AddJsonFile("local.settings.json", optional: true)
.AddEnvironmentVariables()
.Build();

var services = new ServiceCollection()
.AddSingleton(config)
.Configure(config.GetSection(nameof(OAuthSettings)))
.AddHttpClient()
.AddLogging(lb => lb.AddConsole())
.AddSingleton()
.AddSingleton()
.AddSingleton()
.AddSingleton()
.AddSingleton()
.BuildServiceProvider();

var syncSvc = services.GetRequiredService();
await syncSvc.GetAllScreeningRecords();

log.LogInformation($"Sync Completed at {DateTime.UtcNow:O}");
}
}
}
Wenn ich den Func -Hoststart ausführe, sehe ich:

my csproj enthält derzeit folgende:

net48
v1
10.0
Library

















< /code>
Ich habe es ausprobiert: < /p>
  • Hinzufügen /Entfernen von Microsoft.Azure.Webjobs.extensions (v2.x, v3.x, v4.x) < /p>
    < /li>
    Funterlagen Microsoft.Azure.WebJobs.Extensions.Http
  • Clearing bin/obj, dotnet nuget locals all --clear, restoring,

    rebuilding and also Running with --no-debug and different ports
Jedes Mal, wenn ich entweder "0 Jobfunktionen" oder nu1107-Versionen zwischen microsoft.azure.Webjobs (Host will 2.3.x, Erweiterungen in 3.x/4.x) erhalte. dass [TimerTigger] entdeckt wird?>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post