Azure / Azurite

A lightweight server clone of Azure Storage that simulates most of the commands supported by it with minimal dependencies
MIT License
1.8k stars 320 forks source link

Cannot install Azurite in Visual Studio #1414

Open Mike-E-angelo opened 2 years ago

Mike-E-angelo commented 2 years ago

Which service(blob, file, queue, table) does this issue concern?

Installation

Which version of the Azurite was used?

Didn't get that far

Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)

VisualStudio

What's the Node.js version?

Not Sure

What problem was encountered?

Installing NuGet packages to project...
Installing package 'Azure.Storage.Blobs' with version '12.3.0'.
ErrorNuGet.PackageManagement.PackageReferenceRollbackException: Package restore failed. Rolling back package changes for 'starbeam.one'.
   at NuGet.PackageManagement.NuGetPackageManager.<ExecuteBuildIntegratedProjectActionsAsync>d__82.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.PackageManagement.NuGetPackageManager.<ExecuteNuGetProjectActionsAsync>d__79.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.PackageManagement.NuGetPackageManager.<InstallPackageAsync>d__48.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.PackageManagement.NuGetPackageManager.<InstallPackageAsync>d__47.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.VisualStudio.VsPackageInstaller.<InstallInternalCoreAsync>d__25.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at NuGet.VisualStudio.VsPackageInstaller.<InstallInternalAsync>d__24.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at NuGet.VisualStudio.VsPackageInstaller.<InstallInternalAsync>d__24.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()
   at NuGet.VisualStudio.VsPackageInstaller.InstallPackage(String source, Project project, String packageId, String version, Boolean ignoreDependencies)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at NuGet.VisualStudio.VsPackageInstaller.InstallPackage(String source, Project project, String packageId, String version, Boolean ignoreDependencies)
   at Microsoft.WebTools.Shared.VS.NuGet.NuGetPackageManager.<InstallAsync>d__41.MoveNext()
ErrorFailed to configure NuGet packages.
Adding code to Startup.cs...
ErrorFailed to configure dependency Storage Azurite emulator (Local) storage1.

(Note that no code was actually added to Startup.cs as it does not exist)

Steps to reproduce the issue?

Follow instructions here: https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azurite?tabs=visual-studio

If possible, please provide the debug log using the -d parameter, replacing \<pathtodebuglog> with an appropriate path for your OS, or review the instructions for docker containers:

-d "<pathtodebuglog>"

Please be sure to remove any PII or sensitive information before sharing!
The debug log will log raw request headers and bodies, so that we can replay these against Azurite using REST and create tests to validate resolution.

Have you found a mitigation/solution?

Just complaining about it here. :P

Brainforce1 commented 2 years ago

Am encountering this same issue. Am adding it to a (.NET Core) minimal API project in VS 2022, which might be unsupported for now? Bcs the OP also mentioned the Startup.cs message stating he doesn't have that class either.

blueww commented 2 years ago

@Brainforce1 Your issue looks more like a VS issue. Would you please report a VS issue by following: https://docs.microsoft.com/en-us/visualstudio/ide/how-to-report-a-problem-with-visual-studio?view=vs-2022

ch200c commented 1 year ago

I had the same error for a different package. Turns out, I had a newer version of the package already referenced in my project.

Solution: downgrade Azure.Storage.Blobs to version 12.3.0 or remove the package reference completely and try again.