roslyn: Design-time builds should not lock tasks coming from packages
Steps to Reproduce:
- Open a project in VS2015 which has dependency on
Microsoft.Bcl.Build.Tasks.dll
. - Build the project and keep the project opened.
- While the project is still opened in VS after the build, open cmd and cd into the solution directory and run
rmdir /s/q packages
(or PowerShell’srm -r -fo packages
).- Alternatively, if the project is under git SC, run
git clean -xdf
command in cmd/ps, everything which is not under source control gets deleted, except forMicrosoft.Bcl.Build.Tasks.dll
.
- Alternatively, if the project is under git SC, run
Expected Behavior: packages folder gets deleted. VS should release the handle to resource in user space, when there is no user-driven operation going on.
Actual Behavior:
packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.Tasks.dll - Access is denied.
VS2015 does not release handle to this particular file unless we close the solution and kill devenv and wait for like 20 extra seconds before user gets a chance to remove the packages folder.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 19 (13 by maintainers)
Agree there are others as well. That’s why I keep one instance of PowerShell running to execute
kill -name devenv; kill -name msbuild; git clean -xdf; ./SolutionName.sln
every now and then.devenv
andmsbuild
are two processes usually holding the assembly handles. In my experience, for 95+% of cases it isMicrosoft.Bcl.Build.Tasks.dll
in use.This won’t be backported to VS14. CPS is the “Common Project System”, the base infrastructure that we’re building the new project system on.
The new project system hasn’t been turned on in VS15 yet - so there’s nothing to verify yet - here’s our roadmap of when it will be enabled: https://github.com/dotnet/roslyn-project-system/blob/master/docs/Roadmap.md