【问题标题】:Windows PDB writer version Error while running an Azure Time Trigger Function运行 Azure 时间触发器函数时出现 Windows PDB 编写器版本错误
【发布时间】:2019-08-26 05:36:33
【问题描述】:

我在 Azure 门户中开发了一个 Azure 时间触发功能,每天触发一次。 触发函数昨天工作正常,但是今天函数在运行函数时突然返回以下错误。

2019-08-26T05:10:55.509 [Error] Function compilation error
2019-08-26T05:10:55.509 [Error] error CS0041: Unexpected error writing debug information -- 'The version of Windows PDB writer is older than required: 'diasymreader.dll''
2019-08-26T05:10:55.539 [Error] Exception while executing function: Functions.TimerTriggerCSharp1. Microsoft.Azure.WebJobs.Script: Script compilation failed.
2019-08-26T05:10:55.586 [Error] Function completed (Failure, Id=361874a9-10d7-4fc2-9a53-ec17f7a65a78, Duration=100ms)

下面是我创建的 project.json 文件。

{
  "frameworks": {
    "net46":{
      "dependencies": {
        "Microsoft.Azure.DocumentDB": "2.0.0"
      }
    }
   }
}

下面是.csx文件

#r "Microsoft.Azure.Documents.Client"

    using System;
    using Microsoft.Azure.Documents;
    using Microsoft.Azure.Documents.Client;
    using Microsoft.Azure.WebJobs.Host;
    using Newtonsoft.Json;

    public static async Task Run(TimerInfo myTimer,  IEnumerable<dynamic> 
    inputDocument, TraceWriter log)
    {
    log.Info($"C# Timer trigger function started at: {DateTime.Now}");

    // Get the date 6 months before from Current Time in IST and convert to Epoch value. 
    TimeZoneInfo INDIAN_ZONE = TimeZoneInfo.FindSystemTimeZoneById("India 
    Standard Time");
    DateTime indianTime =  
    TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow.AddDays(-180), 
    INDIAN_ZONE);


    long epochTime = (long)(indianTime - new DateTime(1970, 1, 
    1)).TotalSeconds;

    DocumentClient client;
    string endpoint = "https://***cosmosdb.documents.azure.com:443/";
    string key = "****";
    client = new DocumentClient(new Uri(endpoint), key);

    foreach (var doc in inputDocument)
        {
            string partKey = doc.NUM;
            StoredProcedureResponse<bool> sprocResponse = await 
    client.ExecuteStoredProcedureAsync<bool>(

   "/dbs/DB_NAME/colls/COLLECTION_NAME/sprocs/STORED PROC_NAME/",new 
    RequestOptions { PartitionKey = new PartitionKey(partKey) });

            log.Info($"Cosmos DB is updated at: {DateTime.Now}");
        }
    }

由于它昨天工作正常,这个错误突然失败的原因可能是什么?如何解决这个问题? 触发函数在 Azure Portal 中开发。

【问题讨论】:

  • 您是否尝试过重启函数应用以及应用服务计划?
  • 是的,我试过了,重新启动功能应用程序后它正在工作。但是该函数是时间触发函数,如果它抛出相同的错误会影响函数执行吗?。

标签: azure-functions azure-functions-runtime azure-functions-core-tools azure-function-app azure-triggers


【解决方案1】:

但是该函数是时间触发函数,如果抛出同样的错误会影响函数执行吗?

是的,它会影响函数的执行,无论是定时器触发还是队列触发。正如日志所说,Function completed (Failure,表示函数执行失败。

【讨论】:

  • 那么导致编译失败的 PDB 编写器错误可能是什么原因,是否有任何解决方法可以避免这种失败?
猜你喜欢
  • 2022-10-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-12-05
  • 2022-06-30
  • 2011-07-04
  • 2017-12-15
  • 1970-01-01
相关资源
最近更新 更多