-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AreNuGetPackagesSafe task failed unexpectedly #11
Comments
Is it doing that even after restarting Visual Studio ? |
I encounter this issue intermittently. In my case, I have 3 start-up projects: 2 web applications and a console application. The error occurs both when starting with debugging (F5) and when (re)building all. It did some investigation with Process Monitor. These are the results: First taskProcess Event Second taskProcess Event ConclusionThe Parent PID belongs to Visual Studio 2017. It is clear that msbuild is started in parallel and both processes attempt to open the same file for writing. It the second file is not granted the access, the build fails. |
Error 1 The "AreNuGetPackagesSafe" task failed unexpectedly.
System.IO.IOException: The process cannot access the file 'C:\Projects\Alme\Agent\Development\NextIT.Alme.Server\packages\SafeNuGet.1.0.9\build\cache\unsafepackages.xml' 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, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync)
at System.IO.FileInfo.OpenRead()
at Owasp.SafeNuGet.Unsafe.PackageListLoader.GetCachedUnsafePackages(String cachePath, Int32 cacheTimeInMinutes, Boolean& cacheHit)
at Owasp.SafeNuGet.AreNuGetPackagesSafe.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__20.MoveNext() NextIT.Utilities.Generics
The text was updated successfully, but these errors were encountered: