0

我正在开发 DOT 5.0 版本。(核心 MVC 应用程序)。

在 Azure 中上传我的文件时(编码期间)遇到错误。

Asset outputAsset = await CreateOutputAssetAsync(client, config.ResourceGroup, config.AccountName,
                                            outputAssetName, uploadedAsset.Description);
private static async Task<Asset> CreateOutputAssetAsync(IAzureMediaServicesClient client,
            string resourceGroupName, string accountName, string assetName, string assetDescription)
        {
            // Check if an Asset already exists
            Asset outputAsset = await client.Assets.GetAsync(resourceGroupName, accountName, assetName);
string outputAssetName = assetName;
Asset asset = new Asset()
            {
                Description = "Encoded-" + assetDescription,
                StorageAccountName = "MyStoarestorage" 
           };
           return await client.Assets.CreateOrUpdateAsync(resourceGroupName, accountName, outputAssetName, asset);
        }

等待 client.Assets.GetAsync的行失败。我错过了任何包裹吗?按照下面的 URL 并安装它。(https://docs.microsoft.com/en-us/azure/media-services/latest/configure-connect-dotnet-howto)。

请建议。 注意:- 相同的代码在我的桌面应用程序中运行良好,并上传带有 AZURE 编码的视频。但是何时应用相同的代码 .NET 5.0 CORE MVC 应用程序一些它是如何不工作的

4

1 回答 1

0

Microsoft.Azure.Manangement.Media5.0 版本中,我们对尝试检索不存在的资产 ( source ) 的 get 函数进行了重大更改:

  • 所有返回 404 Not found 的调用都会引发 ErrorResponseException 而不是返回 null。此更改旨在与其他 Azure SDK 保持一致。

您能否检查您是否在桌面应用程序中使用了旧版本的库?这可能是行为差异的原因。

于 2022-02-11T18:34:07.310 回答