Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/313.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Microsoft.WindowsAzure.Storage:服务器遇到内部错误,但没有说明根本原因_C#_.net Core_Azure Functions_Azure Storage_Azurite - Fatal编程技术网

C# Microsoft.WindowsAzure.Storage:服务器遇到内部错误,但没有说明根本原因

C# Microsoft.WindowsAzure.Storage:服务器遇到内部错误,但没有说明根本原因,c#,.net-core,azure-functions,azure-storage,azurite,C#,.net Core,Azure Functions,Azure Storage,Azurite,在本地,我用azurite创建了一个Blob存储容器,我可以用Storarge Explorer写入/删除文件 此代码开始时很好,但在视图秒后结束,出现未处理的异常 using System.IO; using Microsoft.Azure.WebJobs; using Microsoft.Extensions.Logging; namespace WatchStorage { #region Constructor public class WatchStorageFun

在本地,我用azurite创建了一个Blob存储容器,我可以用Storarge Explorer写入/删除文件

此代码开始时很好,但在视图秒后结束,出现未处理的异常

using System.IO;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;


namespace WatchStorage
{
    #region Constructor
    public class WatchStorageFunctions
    {
        private ILogger Logger { get; set; }
       
        public WatchStorageFunctions(ILogger<WatchStorageFunctions> logger)
        {
            this.Logger = logger;
        }
        #endregion

        [FunctionName("TaskWatchWebjobs")]
         public void RunTaskWatchWebjobs([BlobTrigger("azuritstore/{name}", Connection = "AzureWebJobsStorage")]Stream myBlob, string name)
        {
            this.Logger.LogInformation($"C# Blob trigger function Processed blob\n Name:{name} \n Size: {myBlob.Length} Bytes");
        }
    }
}
错误消息只是

[] Host lock lease acquired by instance ID '00000000000000000000000049821116'.
[] An unhandled exception has occurred. Host is shutting down.
[] Microsoft.WindowsAzure.Storage: Server encountered an internal error. Please try again after some time.
[] Stopping host...
[] Stopping JobHost
[] Job host stopped
[] Host shutdown completed.
我是新的东西,希望有一个更详细的错误消息。可能吗?
如有任何进一步的提示,我们将不胜感激

是的,您可以在本地调试中看到详细的错误消息。我已经在我的终端创建了一个Azure Blob触发器,并将向您展示如何查看详细错误。请检查以下内容:

  • 在代码中提到的容器中上载一个blob(对于我来说是示例工作项):
  • 添加try-catch和logging语句,如下所示:
  • 现在,您将能够在VS控制台中看到日志错误:
  • 对于托管功能应用程序中的错误消息,您将能够在底部的功能应用程序>功能应用程序\u名称>功能\u名称>代码+测试>日志窗格中查看门户上的日志。

  • 感谢您的详细回答,不幸的是“发生了一个错误,说明不了多少”对吗?编辑了这个问题,并有错误输出您是否有一个名为“azuritstore”的容器?您可以通过以下方式安装Azurite吗?并通过运行以下cli命令来检查它:azurite--silent--location c:\azurite--debug c:\azurite\debug.log?谢谢,看起来很有希望。不幸的是,现在VisualStudio抱怨它无法启动存储模拟器。它不应该这样做,因为我在VS代码中有azurite,或者其他地方有你的命令。任何关于如何启动azure storage emulator的提示?这是Visual Studio代码插件的问题。禁用它并运行您的命令就成功了!
    [] Host lock lease acquired by instance ID '00000000000000000000000049821116'.
    [] An unhandled exception has occurred. Host is shutting down.
    [] Microsoft.WindowsAzure.Storage: Server encountered an internal error. Please try again after some time.
    [] Stopping host...
    [] Stopping JobHost
    [] Job host stopped
    [] Host shutdown completed.