I am working on DOT 5.0 Version. (CORE MVC Application).
While uploading my file in Azure (During Encoding) Facing an Error.
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);
}
The line await the client.Assets.GetAsync failed. Did I have missed any packages? Follow the below URL and Install it. (https://learn.microsoft.com/en-us/azure/media-services/latest/configure-connect-dotnet-howto).
Please Suggest. Note:- SAME CODE IS WORKING FINE IN MY DESKTOP APPLICATION And UPLOAD VIDEO WITH ENCODING IN AZURE. but When to apply the SAME CODE .NET 5.0 CORE MVC Application some how it is not working
In
Microsoft.Azure.Manangement.Media
version 5.0, we have a breaking change for get functions trying to retrieve non-existing assets (source):Can you check if you are using an older version of the library in your desktop application? That might be the reason for the difference in behavior.