Azure Function: Did not find functions with language [dotnet-isolated]

I cannot succed in starting my Azure Function. I got the following error:

[2024-04-25T09:22:29.421Z] Found 
 C:Usersgdifronzosource_C#AE.Resp.Device.Sync 
 AE.Resp.Device.SyncAE.Resp.Device.SyncAE 
.Resp.Device.Sync.csproj.    Using for user secrets file configuration.
[2024-04-25T09:22:30.766Z] A host error has occurred during startup operation 
'd5c1ddb1-1e25-406a-b64c-ef69bf086ab4'.

[2024-04-25T09:22:30.768Z] Microsoft.Azure.WebJobs.Script: Did not find functions with 
language [dotnet-isolated].
[2024-04-25T09:22:30.786Z] Failed to stop host instance '8db57ba1-9d37-44cd-a3d9- 
e6e01699e700'.
[2024-04-25T09:22:30.788Z] Microsoft.Azure.WebJobs.Host: The host has not yet started.
Value cannot be null. (Parameter 'provider')

My local.settings.json is the following:

{
"IsEncrypted": false,
 "Values": {
 "AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
"FhirServerUrl": "https://xxxxxxxxxxxx.azurewebsites.net",
"TimeTriggerSchedule": "0 */5 * * *",
"MaximumExecutionTime": 21600,
"MongoDbConnectionString": "mongodb+srv://xxxxxxxxxxx",
"MongoDbThumbprint": "xxxxxxxx"
  }
}

Azurite local emulator is on. My Program.cs in the Azure Function project is:

IHostBuilder builder = new HostBuilder().ConfigureFunctionsWebApplication();

 var configuration = new ConfigurationBuilder()
    .AddEnvironmentVariables()
    .AddJsonFile("local.settings.json", true, true)
    .Build();

X509Certificate2 mongoCertificate;
 string mongoConnectionString = configuration.GetValue<string> 
 ("MongoDbConnectionString") 
  ?? 
 throw new CertificateNotFoundException("Unable to load configuration with key 
'MongoDbConnectionString'");

try
{
  mongoCertificate = 
Utils.LoadCertificate(configuration.GetRequiredSection("MongoDbThumbprint").Value);
}
catch
{
  throw;
}

MongoDBService mongoDBService = new(mongoConnectionString, mongoCertificate);

builder.ConfigureServices(services =>
{
  services.AddApplicationInsightsTelemetryWorkerService();
  services.ConfigureFunctionsApplicationInsights();
  services.AddSingleton<IDeviceSyncService, DeviceSyncService>();
  services.AddSingleton(mongoDBService.CreateRepository<ExecutionParameters> 
 ("deviceSync"));
 });

IHost host = builder.Build();

host.Run();

The functios is:

private readonly ILogger _logger = loggerFactory.CreateLogger<DeviceSyncFunction>();
private readonly IDeviceSyncService _deviceSyncService = deviceSyncService;

[Function("DeviceSyncFunction")]
 public void Run([TimerTrigger("%TimerExpression%", RunOnStartup = true)] TimerInfo 
timerInfo)
{

try
{
    _logger.LogInformation($"Timer trigger function executed at: {DateTime.UtcNow} 
  UTC");

    _deviceSyncService.GenerateDevices();

    _logger.LogInformation($"Timer trigger function terminated at: {DateTime.UtcNow} 
  UTC");
  }
  catch (OperationCanceledException opex)
  {
    _logger.LogWarning(opex, opex.Message);
  }
  catch (FhirOperationException ex)
  {
    _logger.LogError(ex, ex.Message, ex.StackTrace);
  }
  catch (Exception ex)
  {
    _logger.LogCritical(ex, ex.Message);
  }
 }

And the project file .cproj is:

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <AzureFunctionsVersion>v4</AzureFunctionsVersion>
    <OutputType>Exe</OutputType>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
    <FrameworkReference Include="Microsoft.AspNetCore.App" />
    <None Include="local.settings.json">
        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        <CopyToPublishDirectory>Never</CopyToPublishDirectory>
    </None>     
    <PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.21.0" />
    <PackageReference 
    Include="Microsoft.Azure.Functions.Worker.Extensions.Http"Version="3.1.0" />
    <PackageReference 
    Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" 
   Version="1.2.1"/>
    <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" 
    Version="4.3.0" />
    <PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.17.2"/>
    <PackageReference Include="Microsoft.ApplicationInsights.WorkerService" 
      Version="2.22.0" />
    <PackageReference Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" 
   Version="1.2.0" />
</ItemGroup>

<ItemGroup>
 <ProjectReference 
   Include="..AE.Resp.Device.Sync.ModelAE.Resp.Device.Sync.Model.csproj" />
  <ProjectReference 
 Include="..AE.Resp.Device.Sync.ServiceAE.Resp.Device.Sync.Service.csproj" />
 <ItemGroup>
    <None Update="host.json">
        <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
 </ItemGroup>

  <ItemGroup>
      <Using Include="System.Threading.ExecutionContext" Alias="ExecutionContext" />
  </ItemGroup>  

</Project>

I can’t even figure out what’s happening. As I said, azurite local emulator is on, I don’t have any problem with it. ChatGPT says that the configuration is correct. I’m trying to troubleshoot, but I cannot find anything clear. When I try to start-up another Azure Function with the same settings and dependencies (I’ve copied and past dependencies on project file and also the Program.cs and local.settings are similar), I succed. So the problem seem not an hidden wrong settings on my local computer. Any idea?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật