Victor A Chavez
Victor A Chavez

Reputation: 191

StorageCredentials.cs not found

I'm using WindowsAzure.Storage, in a .NET CORE 2.0 library (dll) but when I unit test I get StorageCredentials.cs not found.

 public class AzureFileStorage : IDocumentStorage
{
    CloudStorageAccount storageAccount;
    CloudFileClient fileClient;
    StorageCredentials credit;

    public AzureFileStorage()
    {
        credit = new StorageCredentials(appSettings.Current.Settigns["azAccountName"],appSettings.Current.Settigns["keyValue"]);
        storageAccount = new CloudStorageAccount(credit, true);
        fileClient = storageAccount.CreateCloudFileClient();
    }
}

I can navigate tot he file and the file/class is there, Am I missing something? enter image description here

Also, the path starting C:\Program Files (x86)\Jenkins\ is nowhere to find on my computer.

Upvotes: 0

Views: 538

Answers (1)

Janley Zhang
Janley Zhang

Reputation: 1577

According to your error message, I suppose the issue is related with Debug settings.

There are some ways you could have a try.

1.Open Tools>Debugging>General>tick Enable Just My Code. For more details, please refer to this article.

2.Right click "Solution >Properties and then go to "Debug Source Files". Check under "Do not look for these source files" window if you have your problematic file path written in it. For more details, please refer to this article.

enter image description here

  1. Uncheck Enable source server support in Debugging/General.

enter image description here

4.The system has a StorageCredentials class. After I have installed WindowsAzure.Storage nuget package(like 8.7.0), I could use this class by adding using Microsoft.WindowsAzure.Storage.Auth reference;

5..Net core 2.0 compatibility.I also meet a similar error like you. Just the class is different. Above the package is an exclamation mark. It says this package version can not support .NET Standard 2.0. It supports in version 5.2.4. You know the standard 2.0 is new, there are still some features can not support in it. You could also check your package dependencies of compatibility. If your error is this, you could to wait for core 2.0 to update to support for some packages. Or choose a compatible version of packages.

enter image description here

Upvotes: 1

Related Questions