aspnet / LibraryManager

MIT License
457 stars 83 forks source link

Error during restore mentioning libman.config.json in use. #719

Closed ericstj closed 1 year ago

ericstj commented 1 year ago

Describe the bug

Error System.IO.IOException: The process cannot access the file 'C:\Users\ericstj\.librarymanager\libman.config.json' because it is being used by another process. full stack below.

My best guess here is a concurrency issue with multiple projects using the same task on different nodes. This was a clean machine that never saw this repo before, nor used LibMan at all.


C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018: The "Microsoft.Web.LibraryManager.Build.RestoreTask" task failed unexpectedly. [C:\src\dotnet\eshoponcontainers\src\Services\Identity\Identity.API\Identity.API.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018: System.TypeInitializationException: The type initializer for 'Microsoft.Web.LibraryManager.Cache.WebRequestHandler' threw an exception. [C:\src\dotnet\eshoponcontainers\src\Services\Identity\Identity.API\Identity.API.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:  ---> System.TypeInitializationException: The type initializer for 'Microsoft.Web.LibraryManager.Configuration.Settings' threw an exception. [C:\src\dotnet\eshoponcontainers\src\Services\Identity\Identity.API\Identity.API.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:  ---> System.IO.IOException: The process cannot access the file 'C:\Users\ericstj\.librarymanager\libman.config.json' because it is being used by another process. [C:\src\dotnet\eshoponcontainers\src\Services\Identity\Identity.API\Identity.API.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options) [C:\src\dotnet\eshoponcontainers\src\Services\Identity\Identity.API\Identity.API.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode) [C:\src\dotnet\eshoponcontainers\src\Services\Identity\Identity.API\Identity.API.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode) [C:\src\dotnet\eshoponcontainers\src\Services\Identity\Identity.API\Identity.API.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode) [C:\src\dotnet\eshoponcontainers\src\Services\Identity\Identity.API\Identity.API.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize) [C:\src\dotnet\eshoponcontainers\src\Services\Identity\Identity.API\Identity.API.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at System.IO.StreamReader..ctor(String path) [C:\src\dotnet\eshoponcontainers\src\Services\Identity\Identity.API\Identity.API.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at Microsoft.Web.LibraryManager.Configuration.Settings..ctor() [C:\src\dotnet\eshoponcontainers\src\Services\Identity\Identity.API\Identity.API.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at Microsoft.Web.LibraryManager.Configuration.Settings..cctor() [C:\src\dotnet\eshoponcontainers\src\Services\Identity\Identity.API\Identity.API.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    --- End of inner exception stack trace --- [C:\src\dotnet\eshoponcontainers\src\Services\Identity\Identity.API\Identity.API.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at Microsoft.Web.LibraryManager.Configuration.Settings.get_DefaultSettings() [C:\src\dotnet\eshoponcontainers\src\Services\Identity\Identity.API\Identity.API.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at Microsoft.Web.LibraryManager.Configuration.ProxySettings.get_Default() [C:\src\dotnet\eshoponcontainers\src\Services\Identity\Identity.API\Identity.API.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at Microsoft.Web.LibraryManager.Cache.WebRequestHandler..cctor() [C:\src\dotnet\eshoponcontainers\src\Services\Identity\Identity.API\Identity.API.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    --- End of inner exception stack trace --- [C:\src\dotnet\eshoponcontainers\src\Services\Identity\Identity.API\Identity.API.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at Microsoft.Web.LibraryManager.Cache.WebRequestHandler.get_Instance() [C:\src\dotnet\eshoponcontainers\src\Services\Identity\Identity.API\Identity.API.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at Microsoft.Web.LibraryManager.Build.Contracts.Dependencies.Initialize() [C:\src\dotnet\eshoponcontainers\src\Services\Identity\Identity.API\Identity.API.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at Microsoft.Web.LibraryManager.Build.Contracts.Dependencies..ctor(IHostInteraction hostInteraction, IEnumerable`1 assemblyPaths) [C:\src\dotnet\eshoponcontainers\src\Services\Identity\Identity.API\Identity.API.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at Microsoft.Web.LibraryManager.Build.Contracts.Dependencies.FromTask(String workingDirectory,IEnumerable`1 assemblyPaths) [C:\src\dotnet\eshoponcontainers\src\Services\Identity\Identity.API\Identity.API.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at Microsoft.Web.LibraryManager.Build.RestoreTask.Execute() [C:\src\dotnet\eshoponcontainers\src\Services\Identity\Identity.API\Identity.API.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [C:\src\dotnet\eshoponcontainers\src\Services\Identity\Identity.API\Identity.API.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)[C:\src\dotnet\eshoponcontainers\src\Services\Identity\Identity.API\Identity.API.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018: The "Microsoft.Web.LibraryManager.Build.RestoreTask" task failed unexpectedly. [C:\src\dotnet\eshoponcontainers\src\Web\WebStatus\WebStatus.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018: System.TypeInitializationException: The type initializer for 'Microsoft.Web.LibraryManager.Cache.WebRequestHandler' threw an exception. [C:\src\dotnet\eshoponcontainers\src\Web\WebStatus\WebStatus.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:  ---> System.TypeInitializationException: The type initializer for 'Microsoft.Web.LibraryManager.Configuration.Settings' threw an exception. [C:\src\dotnet\eshoponcontainers\src\Web\WebStatus\WebStatus.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:  ---> System.IO.IOException: The process cannot access the file 'C:\Users\ericstj\.librarymanager\libman.config.json' because it is being used by another process. [C:\src\dotnet\eshoponcontainers\src\Web\WebStatus\WebStatus.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options) [C:\src\dotnet\eshoponcontainers\src\Web\WebStatus\WebStatus.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode) [C:\src\dotnet\eshoponcontainers\src\Web\WebStatus\WebStatus.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode) [C:\src\dotnet\eshoponcontainers\src\Web\WebStatus\WebStatus.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode) [C:\src\dotnet\eshoponcontainers\src\Web\WebStatus\WebStatus.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize) [C:\src\dotnet\eshoponcontainers\src\Web\WebStatus\WebStatus.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at System.IO.StreamReader..ctor(String path) [C:\src\dotnet\eshoponcontainers\src\Web\WebStatus\WebStatus.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at Microsoft.Web.LibraryManager.Configuration.Settings..ctor() [C:\src\dotnet\eshoponcontainers\src\Web\WebStatus\WebStatus.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at Microsoft.Web.LibraryManager.Configuration.Settings..cctor() [C:\src\dotnet\eshoponcontainers\src\Web\WebStatus\WebStatus.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    --- End of inner exception stack trace --- [C:\src\dotnet\eshoponcontainers\src\Web\WebStatus\WebStatus.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at Microsoft.Web.LibraryManager.Configuration.Settings.get_DefaultSettings() [C:\src\dotnet\eshoponcontainers\src\Web\WebStatus\WebStatus.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at Microsoft.Web.LibraryManager.Configuration.ProxySettings.get_Default() [C:\src\dotnet\eshoponcontainers\src\Web\WebStatus\WebStatus.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at Microsoft.Web.LibraryManager.Cache.WebRequestHandler..cctor() [C:\src\dotnet\eshoponcontainers\src\Web\WebStatus\WebStatus.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    --- End of inner exception stack trace --- [C:\src\dotnet\eshoponcontainers\src\Web\WebStatus\WebStatus.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at Microsoft.Web.LibraryManager.Cache.WebRequestHandler.get_Instance() [C:\src\dotnet\eshoponcontainers\src\Web\WebStatus\WebStatus.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at Microsoft.Web.LibraryManager.Build.Contracts.Dependencies.Initialize() [C:\src\dotnet\eshoponcontainers\src\Web\WebStatus\WebStatus.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at Microsoft.Web.LibraryManager.Build.Contracts.Dependencies..ctor(IHostInteraction hostInteraction, IEnumerable`1 assemblyPaths) [C:\src\dotnet\eshoponcontainers\src\Web\WebStatus\WebStatus.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at Microsoft.Web.LibraryManager.Build.Contracts.Dependencies.FromTask(String workingDirectory,IEnumerable`1 assemblyPaths) [C:\src\dotnet\eshoponcontainers\src\Web\WebStatus\WebStatus.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at Microsoft.Web.LibraryManager.Build.RestoreTask.Execute() [C:\src\dotnet\eshoponcontainers\src\Web\WebStatus\WebStatus.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [C:\src\dotnet\eshoponcontainers\src\Web\WebStatus\WebStatus.csproj]
C:\.tools\.nuget\packages\microsoft.web.librarymanager.build\2.1.175\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)[C:\src\dotnet\eshoponcontainers\src\Web\WebStatus\WebStatus.csproj]

To Reproduce

I cloned and tried to build https://github.com/dotnet-architecture/eshoponcontainers on a new machine.

Expected behavior

Restore completes successfully.

Additional context

Building with dotnet build of the root sln in eshop. Using 8.0 RC2 dotnet