Previously we'd keep track of any file that we extracted once and try
to reuse that file (by copying it) if we needed the same file later at a
different destination. The reason was that it's theoretically faster to
a file copy than a createfile and write, since the copy can happen
entirely in the kernel. In practice we were foiled by AV scanners.
This happens to be the only time during extraction where we let a file
close after writing it and then try and use it again. Sure enough on
fast machines we were seeing that as soon as we closed it MsMpEng would
map the file for exclusive access causing our copy to fail with a
sharing violation.
To fix this, I've removed the copy optimization and will just copy the
file from the in-memory archive every time.
* Fix the project.json for C# library and add tests
This commit fixes the bug introduced in project.json for the C# Library
template. It also adds two simple tests for the library template that
drop the class library and then restore and another that also builds.
Fixes#3496
Renaming destinationPath to destinationRelativePath for clarity. This
string represents the path relative to the extract directory to which
files will be written.
We were missing an Interlocked.Increment during a parallel operation.
This type will archive multiple files de-duplicated in a zip with a
central manifest that describes how to recreate the actual layout.
In addition, any other zip file will be expanded and deduplicated
so that we can further reduce the size of those zips/nupkgs.
All of these are placed in a zip with no-compression, essentially
using the zip as only a container. We then LZMA compress that
container to achieve maximum compression.
We're builiding a library and don't need the application-related source
so I've removed this in addition to fixing the source to compile as
NETStandard1.0.
- Created a Configurer class that is responsible for deciding when to run the dotnet first time use
experience and invoke the NuGetCachePrimer.
- Added the NuGetCachePrimer which extract the archive and primes the cache.
-- This is just missing creating the sentinel once restore succeeds.
- Added a shell for the NugetPackagesArchiver, which will be responsible for expanding the archive (likely
replaced in the future by an abstraction from Eric's code or its implementation will simply call Eric's code).
- Added a TemporaryFolder abstration to Internal Abstractions that handles deleting the temporary folder once
we are done with it.
Adding the C# lib and xunittest templates to `dotnet new`. These need
to be invoked with the `dotnet new -t lib` and `dotnet new -t
xunittest` keywords respectively.