3

I have a .NET Core 2.2 Web Application and I'm trying to talk to a my Azure Table Storage resource. What I have so far:

using Microsoft.WindowsAzure.Storage;
using Microsoft.Azure.CosmosDB.Table;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace WebApplication1.Repositories
{
    public class AssetRepository
    {
        public AssetRepository()
        {
            CloudStorageAccount storageAccount = CloudStorageAccount.Parse("cstring");
            CloudTableClient tableClient = storageAccount.CreateCloudTableClient();
        }
    }
}

However when I hover over CreateCloudTableClient I see Reference to type CloudStorageAccount claims it is defined in Microsoft.Azure.Storage.Common but it could not be found.

How do I perform basic Table CRUD from within a .NET Core 2.2 web app?

1
  • You need to post more details about connections string and configurations. Commented Dec 16, 2018 at 16:53

2 Answers 2

7

You seem to have mixed up old and newer assemblies.

using Microsoft.WindowsAzure.Storage;
using Microsoft.Azure.CosmosDB.Table;

Either work with the newer NuGet references to Microsoft.Azure.CosmosDB.*, or with the older Microsoft.WindowsAzure.Storage assemblies, but not both.

For example:

using Microsoft.Azure.CosmosDB.Table;   // replaces Microsoft.WindowsAzure.Storage.Table
using Microsoft.Azure.Storage;          // replaces Microsoft.WindowsAzure.Storage
Sign up to request clarification or add additional context in comments.

Comments

0

These are .NET Framework libraries:

using Microsoft.WindowsAzure.Storage; //legacy
using Microsoft.Azure.CosmosDB.Table;

Use this .NET Core library:

using Microsoft.Azure.Cosmos.Table;

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.