RickStrahl / Westwind.Globalization

Database driven resource localization for .NET applications
543 stars 135 forks source link

Exception on Installation #43

Closed rdugre closed 9 years ago

rdugre commented 9 years ago

When I try to install the NuGet package "Westwind.Globalization.Web" (version 2.2.0), I get the following exception. This prevents it from being installed properly. Any ideas?

System.IO.IOException: The process cannot access the file 'C:\Users\rob\.nuget\packages\Westwind.Globalization.Web\2.2.0\Westwind.Globalization.Web.2.2.0.nupkg' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at NuGet.Packaging.NuGetPackageUtils.ExtractFiles(ZipArchive archive, String targetPath, Func`2 shouldInclude)
   at NuGet.Packaging.NuGetPackageUtils.ExtractNupkg(ZipArchive archive, String targetPath)
   at NuGet.Packaging.NuGetPackageUtils.ExtractPackage(String targetPath, FileStream stream)
   at NuGet.Packaging.NuGetPackageUtils.<>c__DisplayClass1_0.<<InstallFromSourceAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at NuGet.Common.ConcurrencyUtilities.<ExecuteWithFileLocked>d__0`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at NuGet.Common.ConcurrencyUtilities.<ExecuteWithFileLocked>d__0`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at NuGet.Packaging.NuGetPackageUtils.<InstallFromSourceAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at NuGet.Protocol.Core.v3.GlobalPackagesFolderUtility.<AddPackageAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at NuGet.Protocol.Core.v3.DownloadResourceV3.<GetDownloadResourceResultAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.PackageManagement.PackageDownloader.<GetDownloadResourceResultAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at NuGet.PackageManagement.NuGetPackageManager.<ExecuteNuGetProjectActionsAsync>d__42.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at NuGet.PackageManagement.NuGetPackageManager.<ExecuteNuGetProjectActionsAsync>d__42.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.PackageManagement.UI.UIActionEngine.<ExecuteActionsAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.PackageManagement.UI.UIActionEngine.<PerformActionAsync>d__3.MoveNext()
========== Finished ==========
rdugre commented 9 years ago

I was able to successfully install version 2.1.0. Also, I am developing an ASP.NET 4.51 Web project (in C#) and with Visual Studio 2015 (v14.0.23107.0)... in case any of that helps.

Once I am on version 2.1.0, I am not able to upgrade to version 2.2.0.

RickStrahl commented 9 years ago

Not sure why you're seeing that. I can install just fine.

Can you give more details exactly on what you're doing? What type of project? Was there a previous install? Is an application running since it seems like there are locked files? Could it be a permissions problem of some sort?

It sounds like you already have the file in your project and the file is in use somehow (not sure how that would happen really since ASP.NET shadow copies). Try shutting down VS and then doing an install of 2.20 after you open the project.

RickStrahl commented 9 years ago

Ok - we had some odd issues with the package that caused problems for some people but not for others (including me after a few attempts).

I pushed a new package to NuGet today (2.2.1) and it looks like that's working more reliably. Not sure what went wrong - it looks some odd NuGet issue when the package was published.

Please give a try with the latest and see if the problem goes away.

rdugre commented 9 years ago

Yes, it appears to be installing properly now. Thanks for looking into this for me!

RickStrahl commented 9 years ago

Thanks for the feedback!