Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

A few simple DependencyModel bugs#1907

Merged
eerhardt merged 6 commits into
dotnet:masterfrom
eerhardt:DependencyContextBugs
Apr 3, 2017
Merged

A few simple DependencyModel bugs#1907
eerhardt merged 6 commits into
dotnet:masterfrom
eerhardt:DependencyContextBugs

Conversation

@eerhardt
Copy link
Copy Markdown
Member

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

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
Comment thread global.json
@@ -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.


if (!string.IsNullOrEmpty(_packageCacheDirectory))
{
var hashSplitterPos = library.Hash.IndexOf('-');

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@@ -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.

This comment was marked as spam.

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.

{
return EnvironmentMockBuilder.Create()
.AddVariable("DOTNET_PACKAGES_CACHE", CachePath)
.AddVariable("DOTNET_HOSTING_OPTIMIZATION_CACHE", CachePath)

This comment was marked as spam.


[Fact]
public void ChecksHashFile()
public void IgnoresHashFile()

This comment was marked as spam.

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.
@eerhardt
Copy link
Copy Markdown
Member Author

I've addressed all feedback. PTAL and let me know what you think.

@eerhardt eerhardt merged commit 8b1a5b8 into dotnet:master Apr 3, 2017
@eerhardt eerhardt deleted the DependencyContextBugs branch April 3, 2017 17:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants