GetFileDependsOnNETStandard holds handles to assemblies after it returns
See original GitHub issueI believe this is the root cause of https://github.com/NuGet/Home/issues/5609.
I’ve been looking at this with @mishra14.
It appears that GetFileDependsOnNETStandard, introduced to support .NET Standard 2.0 in VS 15.3, holds locks on files longer than it should.
It appears to close the handle to the files it’s inspecting, but we can observe through the debugger that they don’t get closed immediately–stepping over that line and running a handle.exe
search shows the handle still open.
When devenv.exe
is started from an environment with set ImplicitlyExpandNETStandardFacades=false
, project creation succeeds. That property disables calling GetDependsOnNETStandard
.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
VS 15.3 came with new unexpected and not actionable ...
Instrumentation have shown that GetFileDependsOnNETStandard chokes on assembly obfuscated with .NET Reactor, while ResolveAssemblyReferences ...
Read more >Resolve assembly loads
In most cases, the assembly that is returned by the handler appears in the load context, regardless of the context the handler loads...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I see. I suspect we’re missing this: https://github.com/Microsoft/msbuild/blob/cc5661488dba7c2a25ad1555fee08a9237a2414b/src/Tasks/AssemblyDependency/AssemblyInformation.cs#L500-L503
So in the finally block add:
I see that @ericstj has fixed this issue already. As such I am going to close it. If that’s not the case, just comment and we can re-activate.