Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.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#在Azure blob存储中保存字符串,出现奇怪的错误_C#_Azure - Fatal编程技术网

试图用C#在Azure blob存储中保存字符串,出现奇怪的错误

试图用C#在Azure blob存储中保存字符串,出现奇怪的错误,c#,azure,C#,Azure,我正在对一个网站进行API调用,获取一些数据并尝试将其保存为Azure blob存储中的blob 我在调试输出窗口中遇到奇怪的异常,但在我的try/catch异常处理中没有出现异常(我在那里也设置了一个断点)。数据没有保存在Azure中 这是我的密码: CloudStorageAccount storageAccount = CloudStorageAccount.Parse( CloudConfigurationManager.GetSetting("connectio

我正在对一个网站进行API调用,获取一些数据并尝试将其保存为Azure blob存储中的blob

我在调试输出窗口中遇到奇怪的异常,但在我的try/catch异常处理中没有出现异常(我在那里也设置了一个断点)。数据没有保存在Azure中

这是我的密码:

CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
            CloudConfigurationManager.GetSetting("connectionString"));
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
CloudBlobContainer container = blobClient.GetContainerReference("data");
                container.CreateIfNotExists();
CloudBlockBlob blockBlob = container.GetBlockBlobReference($"{measurementString}.json");
await blockBlob.UploadTextAsync(resultContent);
通过断点,我可以看到容器已创建

我得到一个例外:

Exception thrown: 'System.Net.WebException' in System.dll
Exception thrown: 'System.Net.WebException' in System.dll
Exception thrown: 'Microsoft.WindowsAzure.Storage.StorageException' in Microsoft.WindowsAzure.Storage.dll
Exception thrown: 'Microsoft.WindowsAzure.Storage.StorageException' in Microsoft.WindowsAzure.Storage.dll`
我的.NET版本是4.5.2,我的软件包版本是:

Environment: <packages> <package id="Microsoft.Azure.KeyVault.Core" version="2.0.4" targetFramework="net452" /> <package id="Microsoft.WindowsAzure.ConfigurationManager" version="3.2.3" targetFramework="net452" /> <package id="WindowsAzure.Storage" version="8.1.3" targetFramework="net452" /> </packages> 
环境:
当我在wait blockBlob.UploadTextAsync(resultContent);,上放置断点时;,它永远不会出现


编辑:我更改了blob名称字符串.ToLower(),现在它似乎工作正常。我想就是这样

我更改了blob名称字符串.ToLower(),现在它似乎工作正常。我想就是这样

…例外情况是什么?消息、详细信息..?就是这样-我只能在底部的调试输出窗口中看到异常。没有细节。你知道我怎样才能得到它们吗?作为一个非常简单的方法,只需在代码周围放置一个try-catch块,并在catch块中放置一个断点:)我确实做到了,它们没有出现在那里。你能把所有这些详细信息放在注释中,然后编辑你的问题吗?这变得很难阅读/理解。像这样的细节不应该放在评论中。