A few simple DependencyModel bugs#1907
Conversation
…mbly returns null. Fix #1017
Fix #617
Fix #622. Also remove hash check for loading assemblies from the package cache. This matches the 2.0 dotnet host behavior changed in dotnet#1330.
After dotnet/sdk#1053 is merged, it is possible for an app to run on the shared framework, but not be "portable". DependencyContextLoader should always load the "runtime" context, if it is present. Also, with #1597, there may be other deps files for the app. It should load those as well. Fix #1886
| @@ -1,3 +1,4 @@ | |||
| { | |||
| "projects": [ "src", "test", "setuptools", "build_projects" ] | |||
| "projects": [ "src", "test", "setuptools", "build_projects" ], | |||
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| if (!string.IsNullOrEmpty(_packageCacheDirectory)) | ||
| { | ||
| var hashSplitterPos = library.Hash.IndexOf('-'); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| @@ -7,32 +12,49 @@ namespace Microsoft.Extensions.DependencyModel | |||
| internal class DependencyContextPaths | |||
| { | |||
| private static readonly string DepsFilesProperty = "APP_CONTEXT_DEPS_FILES"; | |||
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| internal static string GetDefaultPackageCacheDirectory(IEnvironment environment) | ||
| { | ||
| return environment.GetEnvironmentVariable("DOTNET_PACKAGES_CACHE"); | ||
| return environment.GetEnvironmentVariable("DOTNET_HOSTING_OPTIMIZATION_CACHE"); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| { | ||
| return EnvironmentMockBuilder.Create() | ||
| .AddVariable("DOTNET_PACKAGES_CACHE", CachePath) | ||
| .AddVariable("DOTNET_HOSTING_OPTIMIZATION_CACHE", CachePath) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| [Fact] | ||
| public void ChecksHashFile() | ||
| public void IgnoresHashFile() |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
The optimization package cache feature is no longer available in .NET Core 2.0. This resolver is no longer needed, since assemblies can no longer be resolved from this environment variable.
|
I've addressed all feedback. PTAL and let me know what you think. |
I batched up 4 little bugs to the DependencyModel, since I thought it would be easier to review them all at once, instead of bugging everyone 4 separate times.
It may be easiest to review commit-by-commit.
Fixes #617, #622, #1017, and #1886