diff --git a/eng/Signing.props b/eng/Signing.props index b4cc294c261b5..05f2a8bcb3957 100644 --- a/eng/Signing.props +++ b/eng/Signing.props @@ -72,7 +72,6 @@ - diff --git a/eng/Subsets.props b/eng/Subsets.props index ef7ed6207ee1b..476eece69c795 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -24,7 +24,7 @@ ./build.sh /p:Subset=CoreHost-Managed - This builds the CoreHost and also the Managed (e.g. Microsoft.Extensions.DependencyModel) + This builds the CoreHost and also the Managed (e.g. Microsoft.DotNet.PlatformAbstractions) projects. A '-' is the delimiter between multiple subsets to build. ./build.sh -test /p:Subset=Test @@ -105,7 +105,7 @@ - + @@ -245,7 +245,6 @@ - diff --git a/src/installer/Microsoft.DotNet.CoreSetup.sln b/src/installer/Microsoft.DotNet.CoreSetup.sln index ec986644ff57a..e3b39fe6aff62 100644 --- a/src/installer/Microsoft.DotNet.CoreSetup.sln +++ b/src/installer/Microsoft.DotNet.CoreSetup.sln @@ -11,12 +11,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.PlatformAbstractions", "managed\Microsoft.DotNet.PlatformAbstractions\Microsoft.DotNet.PlatformAbstractions.csproj", "{04D84DC8-A509-43FE-B846-16B770D9E3AA}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.DependencyModel", "managed\Microsoft.Extensions.DependencyModel\Microsoft.Extensions.DependencyModel.csproj", "{566D86A6-D940-4270-867E-C9EA0EA01F6E}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HostActivation.Tests", "test\HostActivation.Tests\HostActivation.Tests.csproj", "{23F4AB97-D15C-4C51-A641-DF5C5D5EF70F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.DependencyModel.Tests", "test\Microsoft.Extensions.DependencyModel.Tests\Microsoft.Extensions.DependencyModel.Tests.csproj", "{D86A859D-E6FA-4E73-A255-5776FC473A25}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestUtils", "test\TestUtils\TestUtils.csproj", "{D6676666-D14D-4DFA-88FB-76E3E823E2E1}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.NET.HostModel", "managed\Microsoft.NET.HostModel\Microsoft.NET.HostModel.csproj", "{325FB7F2-2E2E-422D-ADAA-F0B63E84CF24}" @@ -61,22 +57,6 @@ Global {04D84DC8-A509-43FE-B846-16B770D9E3AA}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU {04D84DC8-A509-43FE-B846-16B770D9E3AA}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU {04D84DC8-A509-43FE-B846-16B770D9E3AA}.RelWithDebInfo|x64.Build.0 = Release|Any CPU - {566D86A6-D940-4270-867E-C9EA0EA01F6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {566D86A6-D940-4270-867E-C9EA0EA01F6E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {566D86A6-D940-4270-867E-C9EA0EA01F6E}.Debug|x64.ActiveCfg = Debug|Any CPU - {566D86A6-D940-4270-867E-C9EA0EA01F6E}.Debug|x64.Build.0 = Debug|Any CPU - {566D86A6-D940-4270-867E-C9EA0EA01F6E}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU - {566D86A6-D940-4270-867E-C9EA0EA01F6E}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU - {566D86A6-D940-4270-867E-C9EA0EA01F6E}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU - {566D86A6-D940-4270-867E-C9EA0EA01F6E}.MinSizeRel|x64.Build.0 = Debug|Any CPU - {566D86A6-D940-4270-867E-C9EA0EA01F6E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {566D86A6-D940-4270-867E-C9EA0EA01F6E}.Release|Any CPU.Build.0 = Release|Any CPU - {566D86A6-D940-4270-867E-C9EA0EA01F6E}.Release|x64.ActiveCfg = Release|Any CPU - {566D86A6-D940-4270-867E-C9EA0EA01F6E}.Release|x64.Build.0 = Release|Any CPU - {566D86A6-D940-4270-867E-C9EA0EA01F6E}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU - {566D86A6-D940-4270-867E-C9EA0EA01F6E}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU - {566D86A6-D940-4270-867E-C9EA0EA01F6E}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU - {566D86A6-D940-4270-867E-C9EA0EA01F6E}.RelWithDebInfo|x64.Build.0 = Release|Any CPU {23F4AB97-D15C-4C51-A641-DF5C5D5EF70F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {23F4AB97-D15C-4C51-A641-DF5C5D5EF70F}.Debug|Any CPU.Build.0 = Debug|Any CPU {23F4AB97-D15C-4C51-A641-DF5C5D5EF70F}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -93,22 +73,6 @@ Global {23F4AB97-D15C-4C51-A641-DF5C5D5EF70F}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU {23F4AB97-D15C-4C51-A641-DF5C5D5EF70F}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU {23F4AB97-D15C-4C51-A641-DF5C5D5EF70F}.RelWithDebInfo|x64.Build.0 = Release|Any CPU - {D86A859D-E6FA-4E73-A255-5776FC473A25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D86A859D-E6FA-4E73-A255-5776FC473A25}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D86A859D-E6FA-4E73-A255-5776FC473A25}.Debug|x64.ActiveCfg = Debug|Any CPU - {D86A859D-E6FA-4E73-A255-5776FC473A25}.Debug|x64.Build.0 = Debug|Any CPU - {D86A859D-E6FA-4E73-A255-5776FC473A25}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU - {D86A859D-E6FA-4E73-A255-5776FC473A25}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU - {D86A859D-E6FA-4E73-A255-5776FC473A25}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU - {D86A859D-E6FA-4E73-A255-5776FC473A25}.MinSizeRel|x64.Build.0 = Debug|Any CPU - {D86A859D-E6FA-4E73-A255-5776FC473A25}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D86A859D-E6FA-4E73-A255-5776FC473A25}.Release|Any CPU.Build.0 = Release|Any CPU - {D86A859D-E6FA-4E73-A255-5776FC473A25}.Release|x64.ActiveCfg = Release|Any CPU - {D86A859D-E6FA-4E73-A255-5776FC473A25}.Release|x64.Build.0 = Release|Any CPU - {D86A859D-E6FA-4E73-A255-5776FC473A25}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU - {D86A859D-E6FA-4E73-A255-5776FC473A25}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU - {D86A859D-E6FA-4E73-A255-5776FC473A25}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU - {D86A859D-E6FA-4E73-A255-5776FC473A25}.RelWithDebInfo|x64.Build.0 = Release|Any CPU {D6676666-D14D-4DFA-88FB-76E3E823E2E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D6676666-D14D-4DFA-88FB-76E3E823E2E1}.Debug|Any CPU.Build.0 = Debug|Any CPU {D6676666-D14D-4DFA-88FB-76E3E823E2E1}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -241,8 +205,6 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(NestedProjects) = preSolution - EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {28B9726D-802B-478D-AF7A-B9243B9E180B} EndGlobalSection diff --git a/src/installer/managed/Microsoft.DotNet.PlatformAbstractions/Microsoft.DotNet.PlatformAbstractions.csproj b/src/installer/managed/Microsoft.DotNet.PlatformAbstractions/Microsoft.DotNet.PlatformAbstractions.csproj index 7ad385fb855d7..06a5298a88209 100644 --- a/src/installer/managed/Microsoft.DotNet.PlatformAbstractions/Microsoft.DotNet.PlatformAbstractions.csproj +++ b/src/installer/managed/Microsoft.DotNet.PlatformAbstractions/Microsoft.DotNet.PlatformAbstractions.csproj @@ -9,9 +9,7 @@ - - diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextJsonReader.JsonTextReader.cs b/src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextJsonReader.JsonTextReader.cs deleted file mode 100644 index 0c6c5ca04c649..0000000000000 --- a/src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextJsonReader.JsonTextReader.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.IO; -using Newtonsoft.Json; - -namespace Microsoft.Extensions.DependencyModel -{ - public partial class DependencyContextJsonReader : IDependencyContextReader - { - public DependencyContext Read(Stream stream) - { - if (stream == null) - { - throw new ArgumentNullException(nameof(stream)); - } - - using (var streamReader = new StreamReader(stream)) - { - using (var reader = new JsonTextReader(streamReader)) - { - return Read(reader); - } - } - } - - private DependencyContext Read(JsonTextReader jsonReader) - { - var reader = new UnifiedJsonReader(jsonReader); - return ReadCore(reader); - } - } -} diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextWriter.JsonTextWriter.cs b/src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextWriter.JsonTextWriter.cs deleted file mode 100644 index 857f9cbcb2308..0000000000000 --- a/src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextWriter.JsonTextWriter.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.IO; -using Newtonsoft.Json; - -namespace Microsoft.Extensions.DependencyModel -{ - public partial class DependencyContextWriter - { - public void Write(DependencyContext context, Stream stream) - { - if (context == null) - { - throw new ArgumentNullException(nameof(context)); - } - if (stream == null) - { - throw new ArgumentNullException(nameof(stream)); - } - using (var writer = new StreamWriter(stream)) - { - using (var jsonWriter = new JsonTextWriter(writer) { Formatting = Formatting.Indented }) - { - WriteCore(context, new UnifiedJsonWriter(jsonWriter)); - } - } - } - } -} diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/IDependencyContextReader.cs b/src/installer/managed/Microsoft.Extensions.DependencyModel/IDependencyContextReader.cs deleted file mode 100644 index 0603b5b662ff0..0000000000000 --- a/src/installer/managed/Microsoft.Extensions.DependencyModel/IDependencyContextReader.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using System.IO; - -namespace Microsoft.Extensions.DependencyModel -{ - public interface IDependencyContextReader: IDisposable - { - DependencyContext Read(Stream stream); - } -} \ No newline at end of file diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/Microsoft.Extensions.DependencyModel.csproj b/src/installer/managed/Microsoft.Extensions.DependencyModel/Microsoft.Extensions.DependencyModel.csproj deleted file mode 100644 index 7a48c05dd7225..0000000000000 --- a/src/installer/managed/Microsoft.Extensions.DependencyModel/Microsoft.Extensions.DependencyModel.csproj +++ /dev/null @@ -1,59 +0,0 @@ - - - - - Abstractions for reading `.deps` files. - net451;netstandard1.3;netstandard1.6;netstandard2.0 - netstandard1.3;netstandard1.6;netstandard2.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/Properties/Properties.cs b/src/installer/managed/Microsoft.Extensions.DependencyModel/Properties/Properties.cs deleted file mode 100644 index ffc81f49b41fe..0000000000000 --- a/src/installer/managed/Microsoft.Extensions.DependencyModel/Properties/Properties.cs +++ /dev/null @@ -1,4 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -[assembly: AssemblyMetadataAttribute("Serviceable", "True")] diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/UnifiedJsonReader.JsonTextReader.cs b/src/installer/managed/Microsoft.Extensions.DependencyModel/UnifiedJsonReader.JsonTextReader.cs deleted file mode 100644 index 4a2a4058489b4..0000000000000 --- a/src/installer/managed/Microsoft.Extensions.DependencyModel/UnifiedJsonReader.JsonTextReader.cs +++ /dev/null @@ -1,126 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using Newtonsoft.Json; - -namespace Microsoft.Extensions.DependencyModel -{ - internal ref struct UnifiedJsonReader - { - private JsonTextReader _reader; - - public UnifiedJsonReader(JsonTextReader reader) - { - _reader = reader; - } - - public bool Read() => _reader.Read(); - - public string GetStringValue() => (string)_reader.Value; - - public bool IsTokenTypeProperty() - => _reader.TokenType == JsonToken.PropertyName; - - public bool TryReadStringProperty(out string name, out string value) - { - name = null; - value = null; - if (_reader.Read() && IsTokenTypeProperty()) - { - name = GetStringValue(); - - if (_reader.Read()) - { - if (_reader.TokenType == JsonToken.String) - { - value = GetStringValue(); - } - else - { - Skip(); - } - } - - return true; - } - - return false; - } - - public void ReadStartObject() - { - _reader.Read(); - CheckStartObject(); - } - - public void CheckStartObject() - { - if (_reader.TokenType != JsonToken.StartObject) - { - throw CreateUnexpectedException(_reader, "{"); - } - } - - public void CheckEndObject() - { - if (_reader.TokenType != JsonToken.EndObject) - { - throw CreateUnexpectedException(_reader, "}"); - } - } - - public string[] ReadStringArray() - { - _reader.Read(); - if (_reader.TokenType != JsonToken.StartArray) - { - throw CreateUnexpectedException(_reader, "["); - } - - var items = new List(); - - while (_reader.Read() && _reader.TokenType == JsonToken.String) - { - items.Add(GetStringValue()); - } - - if (_reader.TokenType != JsonToken.EndArray) - { - throw CreateUnexpectedException(_reader, "]"); - } - - return items.ToArray(); - } - - public void Skip() => _reader.Skip(); - - public string ReadAsString() - { - Debug.Assert(IsTokenTypeProperty()); - return _reader.ReadAsString(); - } - - public bool? ReadAsNullableBoolean() - { - Debug.Assert(IsTokenTypeProperty()); - return _reader.ReadAsBoolean(); - } - - public bool ReadAsBoolean(bool defaultValue) - { - Debug.Assert(IsTokenTypeProperty()); - bool? nullableBool = _reader.ReadAsBoolean(); - return nullableBool ?? defaultValue; - } - - private static Exception CreateUnexpectedException(JsonTextReader reader, string expected) - { - return new FormatException($"Unexpected character encountered, excepted '{expected}' " + - $"at line {reader.LineNumber} position {reader.LinePosition} path {reader.Path}"); - } - } -} diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/UnifiedJsonWriter.JsonTextWriter.cs b/src/installer/managed/Microsoft.Extensions.DependencyModel/UnifiedJsonWriter.JsonTextWriter.cs deleted file mode 100644 index a5bb6b98d881f..0000000000000 --- a/src/installer/managed/Microsoft.Extensions.DependencyModel/UnifiedJsonWriter.JsonTextWriter.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Newtonsoft.Json; - -namespace Microsoft.Extensions.DependencyModel -{ - internal ref struct UnifiedJsonWriter - { - private readonly JsonTextWriter _writer; - - public UnifiedJsonWriter(JsonTextWriter writer) - { - _writer = writer; - } - - public void WriteStartObject() => _writer.WriteStartObject(); - public void WriteEndObject() => _writer.WriteEndObject(); - public void WriteStartArray() => _writer.WriteStartArray(); - public void WriteEndArray() => _writer.WriteEndArray(); - - public void Flush() => _writer.Flush(); - - public void WriteStartObject(string propertyName, bool escape = true) - { - _writer.WritePropertyName(propertyName, escape); - _writer.WriteStartObject(); - } - - public void WriteStartArray(string propertyName, bool escape = true) - { - _writer.WritePropertyName(propertyName, escape); - _writer.WriteStartArray(); - } - - public void WriteString(string propertyName, string value, bool escape = true) - { - _writer.WritePropertyName(propertyName, escape); - _writer.WriteValue(value); - } - - public void WriteBoolean(string propertyName, bool value, bool escape = true) - { - _writer.WritePropertyName(propertyName, escape); - _writer.WriteValue(value); - } - - public void WriteStringValue(string value, bool escape = true) - => _writer.WriteValue(value); - } -} diff --git a/src/installer/test/Microsoft.Extensions.DependencyModel.Tests/Microsoft.Extensions.DependencyModel.Tests.csproj b/src/installer/test/Microsoft.Extensions.DependencyModel.Tests/Microsoft.Extensions.DependencyModel.Tests.csproj deleted file mode 100644 index b19fbe7d05ff7..0000000000000 --- a/src/installer/test/Microsoft.Extensions.DependencyModel.Tests/Microsoft.Extensions.DependencyModel.Tests.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - $(TestInfraTargetFramework) - MicrosoftAspNetCore - true - true - true - - - - - - - - - - - diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/Microsoft.Extensions.DependencyModel.sln b/src/libraries/Microsoft.Extensions.DependencyModel/Microsoft.Extensions.DependencyModel.sln new file mode 100644 index 0000000000000..e1487044e6366 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.DependencyModel/Microsoft.Extensions.DependencyModel.sln @@ -0,0 +1,81 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29920.165 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.DependencyModel", "src\Microsoft.Extensions.DependencyModel.csproj", "{5E0AA1BE-28A2-4D25-A10A-E13EBDABE8A1}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.DependencyModel", "ref\Microsoft.Extensions.DependencyModel.csproj", "{9EACDD3F-3833-4E71-954A-847989D634AB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.DependencyModel.Tests", "tests\Microsoft.Extensions.DependencyModel.Tests.csproj", "{E0DEC773-1FE9-49B0-9562-1E245FE2DA5C}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{48E09E46-BD12-4B7E-9D10-3FEC7F9AE9B4}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{47B5CCF6-E349-42D1-B3C2-900EFF594C8A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{A05AC200-A15B-430E-A4BD-522C570DDCB3}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "pkg", "pkg", "{8C081484-2645-46B8-B33E-DC3D883B27F1}" + ProjectSection(SolutionItems) = preProject + pkg\Microsoft.Extensions.DependencyModel.pkgproj = pkg\Microsoft.Extensions.DependencyModel.pkgproj + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5E0AA1BE-28A2-4D25-A10A-E13EBDABE8A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5E0AA1BE-28A2-4D25-A10A-E13EBDABE8A1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5E0AA1BE-28A2-4D25-A10A-E13EBDABE8A1}.Debug|x64.ActiveCfg = Debug|Any CPU + {5E0AA1BE-28A2-4D25-A10A-E13EBDABE8A1}.Debug|x64.Build.0 = Debug|Any CPU + {5E0AA1BE-28A2-4D25-A10A-E13EBDABE8A1}.Debug|x86.ActiveCfg = Debug|Any CPU + {5E0AA1BE-28A2-4D25-A10A-E13EBDABE8A1}.Debug|x86.Build.0 = Debug|Any CPU + {5E0AA1BE-28A2-4D25-A10A-E13EBDABE8A1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5E0AA1BE-28A2-4D25-A10A-E13EBDABE8A1}.Release|Any CPU.Build.0 = Release|Any CPU + {5E0AA1BE-28A2-4D25-A10A-E13EBDABE8A1}.Release|x64.ActiveCfg = Release|Any CPU + {5E0AA1BE-28A2-4D25-A10A-E13EBDABE8A1}.Release|x64.Build.0 = Release|Any CPU + {5E0AA1BE-28A2-4D25-A10A-E13EBDABE8A1}.Release|x86.ActiveCfg = Release|Any CPU + {5E0AA1BE-28A2-4D25-A10A-E13EBDABE8A1}.Release|x86.Build.0 = Release|Any CPU + {9EACDD3F-3833-4E71-954A-847989D634AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9EACDD3F-3833-4E71-954A-847989D634AB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9EACDD3F-3833-4E71-954A-847989D634AB}.Debug|x64.ActiveCfg = Debug|Any CPU + {9EACDD3F-3833-4E71-954A-847989D634AB}.Debug|x64.Build.0 = Debug|Any CPU + {9EACDD3F-3833-4E71-954A-847989D634AB}.Debug|x86.ActiveCfg = Debug|Any CPU + {9EACDD3F-3833-4E71-954A-847989D634AB}.Debug|x86.Build.0 = Debug|Any CPU + {9EACDD3F-3833-4E71-954A-847989D634AB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9EACDD3F-3833-4E71-954A-847989D634AB}.Release|Any CPU.Build.0 = Release|Any CPU + {9EACDD3F-3833-4E71-954A-847989D634AB}.Release|x64.ActiveCfg = Release|Any CPU + {9EACDD3F-3833-4E71-954A-847989D634AB}.Release|x64.Build.0 = Release|Any CPU + {9EACDD3F-3833-4E71-954A-847989D634AB}.Release|x86.ActiveCfg = Release|Any CPU + {9EACDD3F-3833-4E71-954A-847989D634AB}.Release|x86.Build.0 = Release|Any CPU + {E0DEC773-1FE9-49B0-9562-1E245FE2DA5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E0DEC773-1FE9-49B0-9562-1E245FE2DA5C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E0DEC773-1FE9-49B0-9562-1E245FE2DA5C}.Debug|x64.ActiveCfg = Debug|Any CPU + {E0DEC773-1FE9-49B0-9562-1E245FE2DA5C}.Debug|x64.Build.0 = Debug|Any CPU + {E0DEC773-1FE9-49B0-9562-1E245FE2DA5C}.Debug|x86.ActiveCfg = Debug|Any CPU + {E0DEC773-1FE9-49B0-9562-1E245FE2DA5C}.Debug|x86.Build.0 = Debug|Any CPU + {E0DEC773-1FE9-49B0-9562-1E245FE2DA5C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E0DEC773-1FE9-49B0-9562-1E245FE2DA5C}.Release|Any CPU.Build.0 = Release|Any CPU + {E0DEC773-1FE9-49B0-9562-1E245FE2DA5C}.Release|x64.ActiveCfg = Release|Any CPU + {E0DEC773-1FE9-49B0-9562-1E245FE2DA5C}.Release|x64.Build.0 = Release|Any CPU + {E0DEC773-1FE9-49B0-9562-1E245FE2DA5C}.Release|x86.ActiveCfg = Release|Any CPU + {E0DEC773-1FE9-49B0-9562-1E245FE2DA5C}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {5E0AA1BE-28A2-4D25-A10A-E13EBDABE8A1} = {47B5CCF6-E349-42D1-B3C2-900EFF594C8A} + {9EACDD3F-3833-4E71-954A-847989D634AB} = {48E09E46-BD12-4B7E-9D10-3FEC7F9AE9B4} + {E0DEC773-1FE9-49B0-9562-1E245FE2DA5C} = {A05AC200-A15B-430E-A4BD-522C570DDCB3} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {56AA6766-64A9-4715-BC6B-4A24EF6AF7F9} + EndGlobalSection +EndGlobal diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/pkg/Microsoft.Extensions.DependencyModel.pkgproj b/src/libraries/Microsoft.Extensions.DependencyModel/pkg/Microsoft.Extensions.DependencyModel.pkgproj new file mode 100644 index 0000000000000..6d9d2b9a68797 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.DependencyModel/pkg/Microsoft.Extensions.DependencyModel.pkgproj @@ -0,0 +1,11 @@ + + + + + net461;netcoreapp2.0;uap10.0.16299;$(AllXamarinFrameworks) + + + + + + diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/ref/Microsoft.Extensions.DependencyModel.cs b/src/libraries/Microsoft.Extensions.DependencyModel/ref/Microsoft.Extensions.DependencyModel.cs new file mode 100644 index 0000000000000..e11309ff537a9 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.DependencyModel/ref/Microsoft.Extensions.DependencyModel.cs @@ -0,0 +1,226 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// ------------------------------------------------------------------------------ +// Changes to this file must follow the https://aka.ms/api-review process. +// ------------------------------------------------------------------------------ + +namespace Microsoft.DotNet.PlatformAbstractions +{ + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("This type is obsolete and will be removed in a future version. The recommended alternative is System.HashCode.")] + public partial struct HashCodeCombiner + { + private int _dummyPrimitive; + public int CombinedHash { get { throw null; } } + public void Add(int i) { } + public void Add(object o) { } + public void Add(string s) { } + public void Add(TValue value, System.Collections.Generic.IEqualityComparer comparer) { } + public static Microsoft.DotNet.PlatformAbstractions.HashCodeCombiner Start() { throw null; } + } +} +namespace Microsoft.Extensions.DependencyModel +{ + public partial class CompilationLibrary : Microsoft.Extensions.DependencyModel.Library + { + public CompilationLibrary(string type, string name, string version, string hash, System.Collections.Generic.IEnumerable assemblies, System.Collections.Generic.IEnumerable dependencies, bool serviceable) : base (default(string), default(string), default(string), default(string), default(System.Collections.Generic.IEnumerable), default(bool)) { } + public CompilationLibrary(string type, string name, string version, string hash, System.Collections.Generic.IEnumerable assemblies, System.Collections.Generic.IEnumerable dependencies, bool serviceable, string path, string hashPath) : base (default(string), default(string), default(string), default(string), default(System.Collections.Generic.IEnumerable), default(bool)) { } + public System.Collections.Generic.IReadOnlyList Assemblies { get { throw null; } } + public System.Collections.Generic.IEnumerable ResolveReferencePaths() { throw null; } + public System.Collections.Generic.IEnumerable ResolveReferencePaths(params Microsoft.Extensions.DependencyModel.Resolution.ICompilationAssemblyResolver[] customResolvers) { throw null; } + } + public partial class CompilationOptions + { + public CompilationOptions(System.Collections.Generic.IEnumerable defines, string languageVersion, string platform, bool? allowUnsafe, bool? warningsAsErrors, bool? optimize, string keyFile, bool? delaySign, bool? publicSign, string debugType, bool? emitEntryPoint, bool? generateXmlDocumentation) { } + public bool? AllowUnsafe { get { throw null; } } + public string DebugType { get { throw null; } } + public static Microsoft.Extensions.DependencyModel.CompilationOptions Default { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Defines { get { throw null; } } + public bool? DelaySign { get { throw null; } } + public bool? EmitEntryPoint { get { throw null; } } + public bool? GenerateXmlDocumentation { get { throw null; } } + public string KeyFile { get { throw null; } } + public string LanguageVersion { get { throw null; } } + public bool? Optimize { get { throw null; } } + public string Platform { get { throw null; } } + public bool? PublicSign { get { throw null; } } + public bool? WarningsAsErrors { get { throw null; } } + } + public partial struct Dependency + { + private object _dummy; + private int _dummyPrimitive; + public Dependency(string name, string version) { throw null; } + public readonly string Name { get { throw null; } } + public readonly string Version { get { throw null; } } + public bool Equals(Microsoft.Extensions.DependencyModel.Dependency other) { throw null; } + public override bool Equals(object obj) { throw null; } + public override int GetHashCode() { throw null; } + } + public partial class DependencyContext + { + public DependencyContext(Microsoft.Extensions.DependencyModel.TargetInfo target, Microsoft.Extensions.DependencyModel.CompilationOptions compilationOptions, System.Collections.Generic.IEnumerable compileLibraries, System.Collections.Generic.IEnumerable runtimeLibraries, System.Collections.Generic.IEnumerable runtimeGraph) { } + public Microsoft.Extensions.DependencyModel.CompilationOptions CompilationOptions { get { throw null; } } + public System.Collections.Generic.IReadOnlyList CompileLibraries { get { throw null; } } + public static Microsoft.Extensions.DependencyModel.DependencyContext Default { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RuntimeGraph { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RuntimeLibraries { get { throw null; } } + public Microsoft.Extensions.DependencyModel.TargetInfo Target { get { throw null; } } + public static Microsoft.Extensions.DependencyModel.DependencyContext Load(System.Reflection.Assembly assembly) { throw null; } + public Microsoft.Extensions.DependencyModel.DependencyContext Merge(Microsoft.Extensions.DependencyModel.DependencyContext other) { throw null; } + } + public static partial class DependencyContextExtensions + { + public static System.Collections.Generic.IEnumerable GetDefaultAssemblyNames(this Microsoft.Extensions.DependencyModel.DependencyContext self) { throw null; } + public static System.Collections.Generic.IEnumerable GetDefaultAssemblyNames(this Microsoft.Extensions.DependencyModel.RuntimeLibrary self, Microsoft.Extensions.DependencyModel.DependencyContext context) { throw null; } + public static System.Collections.Generic.IEnumerable GetDefaultNativeAssets(this Microsoft.Extensions.DependencyModel.DependencyContext self) { throw null; } + public static System.Collections.Generic.IEnumerable GetDefaultNativeAssets(this Microsoft.Extensions.DependencyModel.RuntimeLibrary self, Microsoft.Extensions.DependencyModel.DependencyContext context) { throw null; } + public static System.Collections.Generic.IEnumerable GetDefaultNativeRuntimeFileAssets(this Microsoft.Extensions.DependencyModel.DependencyContext self) { throw null; } + public static System.Collections.Generic.IEnumerable GetDefaultNativeRuntimeFileAssets(this Microsoft.Extensions.DependencyModel.RuntimeLibrary self, Microsoft.Extensions.DependencyModel.DependencyContext context) { throw null; } + public static System.Collections.Generic.IEnumerable GetRuntimeAssemblyNames(this Microsoft.Extensions.DependencyModel.DependencyContext self, string runtimeIdentifier) { throw null; } + public static System.Collections.Generic.IEnumerable GetRuntimeAssemblyNames(this Microsoft.Extensions.DependencyModel.RuntimeLibrary self, Microsoft.Extensions.DependencyModel.DependencyContext context, string runtimeIdentifier) { throw null; } + public static System.Collections.Generic.IEnumerable GetRuntimeNativeAssets(this Microsoft.Extensions.DependencyModel.DependencyContext self, string runtimeIdentifier) { throw null; } + public static System.Collections.Generic.IEnumerable GetRuntimeNativeAssets(this Microsoft.Extensions.DependencyModel.RuntimeLibrary self, Microsoft.Extensions.DependencyModel.DependencyContext context, string runtimeIdentifier) { throw null; } + public static System.Collections.Generic.IEnumerable GetRuntimeNativeRuntimeFileAssets(this Microsoft.Extensions.DependencyModel.DependencyContext self, string runtimeIdentifier) { throw null; } + public static System.Collections.Generic.IEnumerable GetRuntimeNativeRuntimeFileAssets(this Microsoft.Extensions.DependencyModel.RuntimeLibrary self, Microsoft.Extensions.DependencyModel.DependencyContext context, string runtimeIdentifier) { throw null; } + } + public partial class DependencyContextJsonReader : Microsoft.Extensions.DependencyModel.IDependencyContextReader, System.IDisposable + { + public DependencyContextJsonReader() { } + public void Dispose() { } + protected virtual void Dispose(bool disposing) { } + public Microsoft.Extensions.DependencyModel.DependencyContext Read(System.IO.Stream stream) { throw null; } + } + public partial class DependencyContextLoader + { + public DependencyContextLoader() { } + public static Microsoft.Extensions.DependencyModel.DependencyContextLoader Default { get { throw null; } } + public Microsoft.Extensions.DependencyModel.DependencyContext Load(System.Reflection.Assembly assembly) { throw null; } + } + public partial class DependencyContextWriter + { + public DependencyContextWriter() { } + public void Write(Microsoft.Extensions.DependencyModel.DependencyContext context, System.IO.Stream stream) { } + } + public partial interface IDependencyContextReader : System.IDisposable + { + Microsoft.Extensions.DependencyModel.DependencyContext Read(System.IO.Stream stream); + } + public partial class Library + { + public Library(string type, string name, string version, string hash, System.Collections.Generic.IEnumerable dependencies, bool serviceable) { } + public Library(string type, string name, string version, string hash, System.Collections.Generic.IEnumerable dependencies, bool serviceable, string path, string hashPath) { } + public Library(string type, string name, string version, string hash, System.Collections.Generic.IEnumerable dependencies, bool serviceable, string path, string hashPath, string runtimeStoreManifestName = null) { } + public System.Collections.Generic.IReadOnlyList Dependencies { get { throw null; } } + public string Hash { get { throw null; } } + public string HashPath { get { throw null; } } + public string Name { get { throw null; } } + public string Path { get { throw null; } } + public string RuntimeStoreManifestName { get { throw null; } } + public bool Serviceable { get { throw null; } } + public string Type { get { throw null; } } + public string Version { get { throw null; } } + } + public partial class ResourceAssembly + { + public ResourceAssembly(string path, string locale) { } + public string Locale { get { throw null; } set { } } + public string Path { get { throw null; } set { } } + } + public partial class RuntimeAssembly + { + public RuntimeAssembly(string assemblyName, string path) { } + public System.Reflection.AssemblyName Name { get { throw null; } } + public string Path { get { throw null; } } + public static Microsoft.Extensions.DependencyModel.RuntimeAssembly Create(string path) { throw null; } + } + public partial class RuntimeAssetGroup + { + public RuntimeAssetGroup(string runtime, System.Collections.Generic.IEnumerable runtimeFiles) { } + public RuntimeAssetGroup(string runtime, System.Collections.Generic.IEnumerable assetPaths) { } + public RuntimeAssetGroup(string runtime, params string[] assetPaths) { } + public System.Collections.Generic.IReadOnlyList AssetPaths { get { throw null; } } + public string Runtime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RuntimeFiles { get { throw null; } } + } + public partial class RuntimeFallbacks + { + public RuntimeFallbacks(string runtime, System.Collections.Generic.IEnumerable fallbacks) { } + public RuntimeFallbacks(string runtime, params string[] fallbacks) { } + public System.Collections.Generic.IReadOnlyList Fallbacks { get { throw null; } set { } } + public string Runtime { get { throw null; } set { } } + } + public partial class RuntimeFile + { + public RuntimeFile(string path, string assemblyVersion, string fileVersion) { } + public string AssemblyVersion { get { throw null; } } + public string FileVersion { get { throw null; } } + public string Path { get { throw null; } } + } + public partial class RuntimeLibrary : Microsoft.Extensions.DependencyModel.Library + { + public RuntimeLibrary(string type, string name, string version, string hash, System.Collections.Generic.IReadOnlyList runtimeAssemblyGroups, System.Collections.Generic.IReadOnlyList nativeLibraryGroups, System.Collections.Generic.IEnumerable resourceAssemblies, System.Collections.Generic.IEnumerable dependencies, bool serviceable) : base (default(string), default(string), default(string), default(string), default(System.Collections.Generic.IEnumerable), default(bool)) { } + public RuntimeLibrary(string type, string name, string version, string hash, System.Collections.Generic.IReadOnlyList runtimeAssemblyGroups, System.Collections.Generic.IReadOnlyList nativeLibraryGroups, System.Collections.Generic.IEnumerable resourceAssemblies, System.Collections.Generic.IEnumerable dependencies, bool serviceable, string path, string hashPath) : base (default(string), default(string), default(string), default(string), default(System.Collections.Generic.IEnumerable), default(bool)) { } + public RuntimeLibrary(string type, string name, string version, string hash, System.Collections.Generic.IReadOnlyList runtimeAssemblyGroups, System.Collections.Generic.IReadOnlyList nativeLibraryGroups, System.Collections.Generic.IEnumerable resourceAssemblies, System.Collections.Generic.IEnumerable dependencies, bool serviceable, string path, string hashPath, string runtimeStoreManifestName) : base (default(string), default(string), default(string), default(string), default(System.Collections.Generic.IEnumerable), default(bool)) { } + public System.Collections.Generic.IReadOnlyList NativeLibraryGroups { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ResourceAssemblies { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RuntimeAssemblyGroups { get { throw null; } } + } + public partial class TargetInfo + { + public TargetInfo(string framework, string runtime, string runtimeSignature, bool isPortable) { } + public string Framework { get { throw null; } } + public bool IsPortable { get { throw null; } } + public string Runtime { get { throw null; } } + public string RuntimeSignature { get { throw null; } } + } +} +namespace Microsoft.Extensions.DependencyModel.Resolution +{ + public partial class AppBaseCompilationAssemblyResolver : Microsoft.Extensions.DependencyModel.Resolution.ICompilationAssemblyResolver + { + public AppBaseCompilationAssemblyResolver() { } + public AppBaseCompilationAssemblyResolver(string basePath) { } + public bool TryResolveAssemblyPaths(Microsoft.Extensions.DependencyModel.CompilationLibrary library, System.Collections.Generic.List assemblies) { throw null; } + } + public partial class CompositeCompilationAssemblyResolver : Microsoft.Extensions.DependencyModel.Resolution.ICompilationAssemblyResolver + { + public CompositeCompilationAssemblyResolver(Microsoft.Extensions.DependencyModel.Resolution.ICompilationAssemblyResolver[] resolvers) { } + public bool TryResolveAssemblyPaths(Microsoft.Extensions.DependencyModel.CompilationLibrary library, System.Collections.Generic.List assemblies) { throw null; } + } + public partial class DotNetReferenceAssembliesPathResolver + { + public static readonly string DotNetReferenceAssembliesPathEnv; + public DotNetReferenceAssembliesPathResolver() { } + public static string Resolve() { throw null; } + } + public partial interface ICompilationAssemblyResolver + { + bool TryResolveAssemblyPaths(Microsoft.Extensions.DependencyModel.CompilationLibrary library, System.Collections.Generic.List assemblies); + } + public partial class PackageCompilationAssemblyResolver : Microsoft.Extensions.DependencyModel.Resolution.ICompilationAssemblyResolver + { + public PackageCompilationAssemblyResolver() { } + public PackageCompilationAssemblyResolver(string nugetPackageDirectory) { } + public bool TryResolveAssemblyPaths(Microsoft.Extensions.DependencyModel.CompilationLibrary library, System.Collections.Generic.List assemblies) { throw null; } + } + public partial class ReferenceAssemblyPathResolver : Microsoft.Extensions.DependencyModel.Resolution.ICompilationAssemblyResolver + { + public ReferenceAssemblyPathResolver() { } + public ReferenceAssemblyPathResolver(string defaultReferenceAssembliesPath, string[] fallbackSearchPaths) { } + public bool TryResolveAssemblyPaths(Microsoft.Extensions.DependencyModel.CompilationLibrary library, System.Collections.Generic.List assemblies) { throw null; } + } +} +namespace System.Collections.Generic +{ + public static partial class CollectionExtensions + { + public static System.Collections.Generic.IEnumerable GetDefaultAssets(this System.Collections.Generic.IEnumerable self) { throw null; } + public static Microsoft.Extensions.DependencyModel.RuntimeAssetGroup GetDefaultGroup(this System.Collections.Generic.IEnumerable self) { throw null; } + public static System.Collections.Generic.IEnumerable GetDefaultRuntimeFileAssets(this System.Collections.Generic.IEnumerable self) { throw null; } + public static System.Collections.Generic.IEnumerable GetRuntimeAssets(this System.Collections.Generic.IEnumerable self, string runtime) { throw null; } + public static System.Collections.Generic.IEnumerable GetRuntimeFileAssets(this System.Collections.Generic.IEnumerable self, string runtime) { throw null; } + public static Microsoft.Extensions.DependencyModel.RuntimeAssetGroup GetRuntimeGroup(this System.Collections.Generic.IEnumerable self, string runtime) { throw null; } + } +} diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/ref/Microsoft.Extensions.DependencyModel.csproj b/src/libraries/Microsoft.Extensions.DependencyModel/ref/Microsoft.Extensions.DependencyModel.csproj new file mode 100644 index 0000000000000..48d24ea138428 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.DependencyModel/ref/Microsoft.Extensions.DependencyModel.csproj @@ -0,0 +1,12 @@ + + + netstandard2.0;net461;$(NetFrameworkCurrent) + + + + + + + + + diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/ApplicationEnvironment.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/ApplicationEnvironment.cs similarity index 70% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/ApplicationEnvironment.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/ApplicationEnvironment.cs index 976ac78f5e39f..cc518a11a6121 100644 --- a/src/installer/managed/Microsoft.Extensions.DependencyModel/ApplicationEnvironment.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/src/ApplicationEnvironment.cs @@ -13,13 +13,7 @@ internal static class ApplicationEnvironment private static string GetApplicationBasePath() { - string basePath = -#if NET451 - (string)AppDomain.CurrentDomain.GetData("APP_CONTEXT_BASE_DIRECTORY") ?? - AppDomain.CurrentDomain.BaseDirectory; -#else - AppContext.BaseDirectory; -#endif + string basePath = AppContext.BaseDirectory; return Path.GetFullPath(basePath); } } diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/ArrayBufferWriter.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/ArrayBufferWriter.cs similarity index 100% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/ArrayBufferWriter.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/ArrayBufferWriter.cs diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/CollectionExtensions.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/CollectionExtensions.cs similarity index 90% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/CollectionExtensions.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/CollectionExtensions.cs index 0eb8620afa0e9..38b961a78ca44 100644 --- a/src/installer/managed/Microsoft.Extensions.DependencyModel/CollectionExtensions.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/src/CollectionExtensions.cs @@ -1,4 +1,8 @@ -using Microsoft.Extensions.DependencyModel; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using Microsoft.Extensions.DependencyModel; using System.Linq; namespace System.Collections.Generic diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/CompilationLibrary.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/CompilationLibrary.cs similarity index 99% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/CompilationLibrary.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/CompilationLibrary.cs index 277daf382a06c..0bd49fb971306 100644 --- a/src/installer/managed/Microsoft.Extensions.DependencyModel/CompilationLibrary.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/src/CompilationLibrary.cs @@ -42,7 +42,6 @@ public CompilationLibrary(string type, public IReadOnlyList Assemblies { get; } -#if !NETSTANDARD1_3 internal static ICompilationAssemblyResolver DefaultResolver { get; } = new CompositeCompilationAssemblyResolver(new ICompilationAssemblyResolver[] { new AppBaseCompilationAssemblyResolver(), @@ -83,7 +82,5 @@ private IEnumerable ResolveReferencePaths(ICompilationAssemblyResolver r } return assemblies; } -#endif - } } diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/CompilationOptions.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/CompilationOptions.cs similarity index 100% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/CompilationOptions.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/CompilationOptions.cs diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/Dependency.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/Dependency.cs similarity index 80% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/Dependency.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/Dependency.cs index 75048bd105f3f..e60989f77a5c8 100644 --- a/src/installer/managed/Microsoft.Extensions.DependencyModel/Dependency.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/src/Dependency.cs @@ -3,7 +3,7 @@ // See the LICENSE file in the project root for more information. using System; -using Microsoft.DotNet.PlatformAbstractions; +using System.Numerics.Hashing; namespace Microsoft.Extensions.DependencyModel { @@ -37,12 +37,7 @@ public override bool Equals(object obj) return obj is Dependency && Equals((Dependency) obj); } - public override int GetHashCode() - { - var combiner = HashCodeCombiner.Start(); - combiner.Add(Name); - combiner.Add(Version); - return combiner.CombinedHash; - } + public override int GetHashCode() => + HashHelpers.Combine(Name.GetHashCode(), Version.GetHashCode()); } -} \ No newline at end of file +} diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContext.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContext.cs similarity index 97% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContext.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContext.cs index effbb4afb1220..979dc8ad03bef 100644 --- a/src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContext.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContext.cs @@ -11,9 +11,7 @@ namespace Microsoft.Extensions.DependencyModel { public class DependencyContext { -#if !NETSTANDARD1_3 private static readonly Lazy _defaultContext = new Lazy(LoadDefault); -#endif public DependencyContext(TargetInfo target, CompilationOptions compilationOptions, @@ -49,9 +47,7 @@ public DependencyContext(TargetInfo target, RuntimeGraph = runtimeGraph.ToArray(); } -#if !NETSTANDARD1_3 public static DependencyContext Default => _defaultContext.Value; -#endif public TargetInfo Target { get; } @@ -79,7 +75,6 @@ public DependencyContext Merge(DependencyContext other) ); } -#if !NETSTANDARD1_3 private static DependencyContext LoadDefault() { var entryAssembly = Assembly.GetEntryAssembly(); @@ -95,7 +90,6 @@ public static DependencyContext Load(Assembly assembly) { return DependencyContextLoader.Default.Load(assembly); } -#endif private class LibraryMergeEqualityComparer : IEqualityComparer where T : Library { diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextExtensions.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContextExtensions.cs similarity index 97% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextExtensions.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContextExtensions.cs index 78922928f2b31..c87702a743171 100644 --- a/src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextExtensions.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContextExtensions.cs @@ -1,4 +1,8 @@ -using System; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; using System.Collections.Generic; using System.IO; using System.Linq; diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextJsonReader.Utf8JsonReader.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContextJsonReader.Utf8JsonReader.cs similarity index 100% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextJsonReader.Utf8JsonReader.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContextJsonReader.Utf8JsonReader.cs diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextJsonReader.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContextJsonReader.cs similarity index 100% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextJsonReader.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContextJsonReader.cs diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextLoader.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContextLoader.cs similarity index 99% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextLoader.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContextLoader.cs index 7061d81337836..cf6abd4ab3831 100644 --- a/src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextLoader.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContextLoader.cs @@ -8,8 +8,6 @@ using System.IO; using System.Reflection; -#if !NETSTANDARD1_3 - namespace Microsoft.Extensions.DependencyModel { public class DependencyContextLoader @@ -165,5 +163,3 @@ private static string GetNormalizedCodeBasePath(Assembly assembly) } } } - -#endif diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextPaths.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContextPaths.cs similarity index 91% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextPaths.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContextPaths.cs index b28a46bbc81bc..70f9b16d0d660 100644 --- a/src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextPaths.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContextPaths.cs @@ -6,8 +6,6 @@ using System.Collections.Generic; using System.Linq; -#if !NETSTANDARD1_3 - namespace Microsoft.Extensions.DependencyModel { internal class DependencyContextPaths @@ -35,13 +33,9 @@ public DependencyContextPaths( private static DependencyContextPaths GetCurrent() { -#if NETSTANDARD1_6 - var deps = AppContext.GetData(DepsFilesProperty); - var fxDeps = AppContext.GetData(FxDepsFileProperty); -#else var deps = AppDomain.CurrentDomain.GetData(DepsFilesProperty); var fxDeps = AppDomain.CurrentDomain.GetData(FxDepsFileProperty); -#endif + return Create(deps as string, fxDeps as string); } @@ -61,4 +55,3 @@ internal static DependencyContextPaths Create(string depsFiles, string sharedRun } } } -#endif diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextStrings.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContextStrings.cs similarity index 100% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextStrings.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContextStrings.cs diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextWriter.Utf8JsonWriter.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContextWriter.Utf8JsonWriter.cs similarity index 100% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextWriter.Utf8JsonWriter.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContextWriter.Utf8JsonWriter.cs diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextWriter.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContextWriter.cs similarity index 99% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextWriter.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContextWriter.cs index dbf0a4f4bb884..cd65e67880afb 100644 --- a/src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextWriter.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContextWriter.cs @@ -292,7 +292,7 @@ private void WritePortableTargetLibrary(string key, RuntimeLibrary runtimeLibrar private bool AddRuntimeSpecificAssetGroups(string assetType, IEnumerable assetGroups, bool wroteObjectStart, ref UnifiedJsonWriter jsonWriter) { IEnumerable groups = assetGroups.Where(g => !string.IsNullOrEmpty(g.Runtime)); - if (!wroteObjectStart && (groups.Count() > 0)) + if (!wroteObjectStart && groups.Any()) { jsonWriter.WriteStartObject(DependencyContextStrings.RuntimeTargetsPropertyName, escape: false); wroteObjectStart = true; diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/DirectoryWrapper.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/DirectoryWrapper.cs similarity index 100% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/DirectoryWrapper.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/DirectoryWrapper.cs diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/EnvironmentWrapper.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/EnvironmentWrapper.cs similarity index 60% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/EnvironmentWrapper.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/EnvironmentWrapper.cs index b65099d109333..a4501a2cfa442 100644 --- a/src/installer/managed/Microsoft.Extensions.DependencyModel/EnvironmentWrapper.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/src/EnvironmentWrapper.cs @@ -11,14 +11,10 @@ internal class EnvironmentWrapper : IEnvironment { public static IEnvironment Default = new EnvironmentWrapper(); - public string GetEnvironmentVariable(string name) - { - return Environment.GetEnvironmentVariable(name); - } + public string GetEnvironmentVariable(string name) => Environment.GetEnvironmentVariable(name); - public bool IsWindows() - { - return RuntimeInformation.IsOSPlatform(OSPlatform.Windows); - } + public object GetAppContextData(string name) => AppDomain.CurrentDomain.GetData(name); + + public bool IsWindows() => RuntimeInformation.IsOSPlatform(OSPlatform.Windows); } -} \ No newline at end of file +} diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/FileSystemWrapper.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/FileSystemWrapper.cs similarity index 100% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/FileSystemWrapper.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/FileSystemWrapper.cs diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/FileWrapper.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/FileWrapper.cs similarity index 100% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/FileWrapper.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/FileWrapper.cs diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/src/HashCodeCombiner.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/HashCodeCombiner.cs new file mode 100644 index 0000000000000..ae840bcb6370a --- /dev/null +++ b/src/libraries/Microsoft.Extensions.DependencyModel/src/HashCodeCombiner.cs @@ -0,0 +1,63 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Runtime.CompilerServices; + +namespace Microsoft.DotNet.PlatformAbstractions +{ + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This type is obsolete and will be removed in a future version. The recommended alternative is System.HashCode.")] + public struct HashCodeCombiner + { + private long _combinedHash64; + + public int CombinedHash + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return _combinedHash64.GetHashCode(); } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private HashCodeCombiner(long seed) + { + _combinedHash64 = seed; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Add(int i) + { + _combinedHash64 = ((_combinedHash64 << 5) + _combinedHash64) ^ i; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Add(string s) + { + var hashCode = (s != null) ? s.GetHashCode() : 0; + Add(hashCode); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Add(object o) + { + var hashCode = (o != null) ? o.GetHashCode() : 0; + Add(hashCode); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Add(TValue value, IEqualityComparer comparer) + { + var hashCode = value != null ? comparer.GetHashCode(value) : 0; + Add(hashCode); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static HashCodeCombiner Start() + { + return new HashCodeCombiner(0x1505L); + } + } +} diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/src/IDependencyContextReader.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/IDependencyContextReader.cs new file mode 100644 index 0000000000000..e9c6430309310 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.DependencyModel/src/IDependencyContextReader.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.IO; + +namespace Microsoft.Extensions.DependencyModel +{ + public interface IDependencyContextReader: IDisposable + { + DependencyContext Read(Stream stream); + } +} diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/IDirectory.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/IDirectory.cs similarity index 100% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/IDirectory.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/IDirectory.cs diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/IEnvironment.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/IEnvironment.cs similarity index 88% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/IEnvironment.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/IEnvironment.cs index a83c3ea00e31c..2dc54ed69596d 100644 --- a/src/installer/managed/Microsoft.Extensions.DependencyModel/IEnvironment.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/src/IEnvironment.cs @@ -7,6 +7,7 @@ namespace Microsoft.Extensions.DependencyModel internal interface IEnvironment { string GetEnvironmentVariable(string name); + object GetAppContextData(string name); bool IsWindows(); } -} \ No newline at end of file +} diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/IFile.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/IFile.cs similarity index 100% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/IFile.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/IFile.cs diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/IFileSystem.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/IFileSystem.cs similarity index 100% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/IFileSystem.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/IFileSystem.cs diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/Library.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/Library.cs similarity index 100% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/Library.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/Library.cs diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/src/Microsoft.Extensions.DependencyModel.csproj b/src/libraries/Microsoft.Extensions.DependencyModel/src/Microsoft.Extensions.DependencyModel.csproj new file mode 100644 index 0000000000000..dadbc7e0a0d02 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.DependencyModel/src/Microsoft.Extensions.DependencyModel.csproj @@ -0,0 +1,30 @@ + + + netstandard2.0;net461;$(NetFrameworkCurrent) + true + true + + + + + System\Numerics\Hashing\HashHelpers.cs + + + + + + + + + + + + + + + + + + + + diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/Resolution/AppBaseCompilationAssemblyResolver.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/Resolution/AppBaseCompilationAssemblyResolver.cs similarity index 99% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/Resolution/AppBaseCompilationAssemblyResolver.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/Resolution/AppBaseCompilationAssemblyResolver.cs index 2e382f1ceb8f4..41358bd214e79 100644 --- a/src/installer/managed/Microsoft.Extensions.DependencyModel/Resolution/AppBaseCompilationAssemblyResolver.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/src/Resolution/AppBaseCompilationAssemblyResolver.cs @@ -6,8 +6,6 @@ using System.Collections.Generic; using System.IO; -#if !NETSTANDARD1_3 - namespace Microsoft.Extensions.DependencyModel.Resolution { public class AppBaseCompilationAssemblyResolver : ICompilationAssemblyResolver @@ -115,5 +113,3 @@ public bool TryResolveAssemblyPaths(CompilationLibrary library, List ass } } } - -#endif diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/Resolution/CompositeCompilationAssemblyResolver.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/Resolution/CompositeCompilationAssemblyResolver.cs similarity index 100% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/Resolution/CompositeCompilationAssemblyResolver.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/Resolution/CompositeCompilationAssemblyResolver.cs diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/Resolution/DotNetReferenceAssembliesPathResolver.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/Resolution/DotNetReferenceAssembliesPathResolver.cs similarity index 100% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/Resolution/DotNetReferenceAssembliesPathResolver.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/Resolution/DotNetReferenceAssembliesPathResolver.cs diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/Resolution/ICompilationAssemblyResolver.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/Resolution/ICompilationAssemblyResolver.cs similarity index 100% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/Resolution/ICompilationAssemblyResolver.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/Resolution/ICompilationAssemblyResolver.cs diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/Resolution/PackageCompilationAssemblyResolver.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/Resolution/PackageCompilationAssemblyResolver.cs similarity index 94% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/Resolution/PackageCompilationAssemblyResolver.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/Resolution/PackageCompilationAssemblyResolver.cs index 295fdb29d92c3..892e7cddb0d54 100644 --- a/src/installer/managed/Microsoft.Extensions.DependencyModel/Resolution/PackageCompilationAssemblyResolver.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/src/Resolution/PackageCompilationAssemblyResolver.cs @@ -37,12 +37,7 @@ internal PackageCompilationAssemblyResolver(IFileSystem fileSystem, string[] nug internal static string[] GetDefaultProbeDirectories(IEnvironment environment) { -#if !NETSTANDARD1_3 -#if NETSTANDARD1_6 - var probeDirectories = AppContext.GetData("PROBING_DIRECTORIES"); -#else - var probeDirectories = AppDomain.CurrentDomain.GetData("PROBING_DIRECTORIES"); -#endif + var probeDirectories = environment.GetAppContextData("PROBING_DIRECTORIES"); var listOfDirectories = probeDirectories as string; @@ -50,7 +45,6 @@ internal static string[] GetDefaultProbeDirectories(IEnvironment environment) { return listOfDirectories.Split(new char[] { Path.PathSeparator }, StringSplitOptions.RemoveEmptyEntries); } -#endif var packageDirectory = environment.GetEnvironmentVariable("NUGET_PACKAGES"); diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/Resolution/ReferenceAssemblyPathResolver.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/Resolution/ReferenceAssemblyPathResolver.cs similarity index 100% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/Resolution/ReferenceAssemblyPathResolver.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/Resolution/ReferenceAssemblyPathResolver.cs diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/Resolution/ResolverUtils.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/Resolution/ResolverUtils.cs similarity index 100% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/Resolution/ResolverUtils.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/Resolution/ResolverUtils.cs diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/ResourceAssembly.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/ResourceAssembly.cs similarity index 100% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/ResourceAssembly.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/ResourceAssembly.cs diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/RuntimeAssembly.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/RuntimeAssembly.cs similarity index 100% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/RuntimeAssembly.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/RuntimeAssembly.cs diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/RuntimeAssetGroup.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/RuntimeAssetGroup.cs similarity index 100% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/RuntimeAssetGroup.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/RuntimeAssetGroup.cs diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/RuntimeFallbacks.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/RuntimeFallbacks.cs similarity index 100% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/RuntimeFallbacks.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/RuntimeFallbacks.cs diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/RuntimeFile.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/RuntimeFile.cs similarity index 100% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/RuntimeFile.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/RuntimeFile.cs diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/RuntimeLibrary.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/RuntimeLibrary.cs similarity index 100% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/RuntimeLibrary.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/RuntimeLibrary.cs diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/TargetInfo.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/TargetInfo.cs similarity index 100% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/TargetInfo.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/TargetInfo.cs diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/UnifiedJsonReader.Utf8JsonReader.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/UnifiedJsonReader.Utf8JsonReader.cs similarity index 100% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/UnifiedJsonReader.Utf8JsonReader.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/UnifiedJsonReader.Utf8JsonReader.cs diff --git a/src/installer/managed/Microsoft.Extensions.DependencyModel/UnifiedJsonWriter.Utf8JsonWriter.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/UnifiedJsonWriter.Utf8JsonWriter.cs similarity index 100% rename from src/installer/managed/Microsoft.Extensions.DependencyModel/UnifiedJsonWriter.Utf8JsonWriter.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/src/UnifiedJsonWriter.Utf8JsonWriter.cs diff --git a/src/installer/test/Microsoft.Extensions.DependencyModel.Tests/AppBaseResolverTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/AppBaseResolverTests.cs similarity index 100% rename from src/installer/test/Microsoft.Extensions.DependencyModel.Tests/AppBaseResolverTests.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/tests/AppBaseResolverTests.cs diff --git a/src/installer/test/Microsoft.Extensions.DependencyModel.Tests/CompilationLibraryTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/CompilationLibraryTests.cs similarity index 100% rename from src/installer/test/Microsoft.Extensions.DependencyModel.Tests/CompilationLibraryTests.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/tests/CompilationLibraryTests.cs diff --git a/src/installer/test/Microsoft.Extensions.DependencyModel.Tests/CompositeResolverTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/CompositeResolverTests.cs similarity index 100% rename from src/installer/test/Microsoft.Extensions.DependencyModel.Tests/CompositeResolverTests.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/tests/CompositeResolverTests.cs diff --git a/src/installer/test/Microsoft.Extensions.DependencyModel.Tests/DependencyContextBuilderTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextBuilderTests.cs similarity index 98% rename from src/installer/test/Microsoft.Extensions.DependencyModel.Tests/DependencyContextBuilderTests.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextBuilderTests.cs index fb4f7b06b61ff..d18e0949ba448 100644 --- a/src/installer/test/Microsoft.Extensions.DependencyModel.Tests/DependencyContextBuilderTests.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextBuilderTests.cs @@ -1,4 +1,8 @@ -using System; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; diff --git a/src/installer/test/Microsoft.Extensions.DependencyModel.Tests/DependencyContextJsonReaderTest.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonReaderTest.cs similarity index 99% rename from src/installer/test/Microsoft.Extensions.DependencyModel.Tests/DependencyContextJsonReaderTest.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonReaderTest.cs index 3bc0c8b8442b1..7962cf124bca1 100644 --- a/src/installer/test/Microsoft.Extensions.DependencyModel.Tests/DependencyContextJsonReaderTest.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonReaderTest.cs @@ -1,4 +1,8 @@ -using System; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; using System.Collections.Generic; using System.IO; using System.Linq; diff --git a/src/installer/test/Microsoft.Extensions.DependencyModel.Tests/DependencyContextJsonWriterTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonWriterTests.cs similarity index 99% rename from src/installer/test/Microsoft.Extensions.DependencyModel.Tests/DependencyContextJsonWriterTests.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonWriterTests.cs index 178c7de0a603f..8a45b4337e5fe 100644 --- a/src/installer/test/Microsoft.Extensions.DependencyModel.Tests/DependencyContextJsonWriterTests.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonWriterTests.cs @@ -1,4 +1,8 @@ -using System.Collections.Generic; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Collections.Generic; using System.IO; using System.Text; using System.Text.Json; @@ -644,4 +648,4 @@ public void WritesCompilationOptions() .Subject.Values().Should().BeEquivalentTo(new[] { "MY", "DEFINES" }); } } -} \ No newline at end of file +} diff --git a/src/installer/test/Microsoft.Extensions.DependencyModel.Tests/DependencyContextLoaderTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextLoaderTests.cs similarity index 94% rename from src/installer/test/Microsoft.Extensions.DependencyModel.Tests/DependencyContextLoaderTests.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextLoaderTests.cs index be95a8a856dd3..85724f08d326d 100644 --- a/src/installer/test/Microsoft.Extensions.DependencyModel.Tests/DependencyContextLoaderTests.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextLoaderTests.cs @@ -11,6 +11,7 @@ namespace Microsoft.Extensions.DependencyModel.Tests public class DependencyContextLoaderTests { [Fact] + [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "GetEntryAssembly() returns null")] public void LoadLoadsExtraPaths() { string appDepsPath = "appPath.deps.json"; @@ -88,7 +89,7 @@ public void LoadCanLoadANonEntryAssembly() public void LoadReturnsNullWhenNotFound() { var loader = new DependencyContextLoader(); - Assert.Null(loader.Load(typeof(string).Assembly)); + Assert.Null(loader.Load(typeof(Moq.Mock).Assembly)); } } } diff --git a/src/installer/test/Microsoft.Extensions.DependencyModel.Tests/DependencyContextPathsTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextPathsTests.cs similarity index 100% rename from src/installer/test/Microsoft.Extensions.DependencyModel.Tests/DependencyContextPathsTests.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextPathsTests.cs diff --git a/src/installer/test/Microsoft.Extensions.DependencyModel.Tests/DependencyContextTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextTests.cs similarity index 100% rename from src/installer/test/Microsoft.Extensions.DependencyModel.Tests/DependencyContextTests.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextTests.cs diff --git a/src/installer/test/Microsoft.Extensions.DependencyModel.Tests/EnvironmentMockBuilder.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/EnvironmentMockBuilder.cs similarity index 67% rename from src/installer/test/Microsoft.Extensions.DependencyModel.Tests/EnvironmentMockBuilder.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/tests/EnvironmentMockBuilder.cs index 6c6df4a40d890..c03434620474d 100644 --- a/src/installer/test/Microsoft.Extensions.DependencyModel.Tests/EnvironmentMockBuilder.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/EnvironmentMockBuilder.cs @@ -9,6 +9,7 @@ namespace Microsoft.Extensions.DependencyModel.Tests public class EnvironmentMockBuilder { private Dictionary _variables = new Dictionary(); + private Dictionary _appContextData = new Dictionary(); private bool _isWindows; internal static IEnvironment Empty { get; } = Create().Build(); @@ -24,6 +25,12 @@ public EnvironmentMockBuilder AddVariable(string name, string value) return this; } + public EnvironmentMockBuilder AddAppContextData(string name, object value) + { + _appContextData.Add(name, value); + return this; + } + public EnvironmentMockBuilder SetIsWindows(bool value) { _isWindows = value; @@ -32,24 +39,31 @@ public EnvironmentMockBuilder SetIsWindows(bool value) internal IEnvironment Build() { - return new EnvironmentMock(_variables, _isWindows); + return new EnvironmentMock(_variables, _appContextData, _isWindows); } private class EnvironmentMock : IEnvironment { private Dictionary _variables; + private Dictionary _appContextData; private bool _isWindows; - public EnvironmentMock(Dictionary variables, bool isWindows) + public EnvironmentMock(Dictionary variables, Dictionary appContextData, bool isWindows) { _variables = variables; + _appContextData = appContextData; _isWindows = isWindows; } public string GetEnvironmentVariable(string name) { - string value = null; - _variables.TryGetValue(name, out value); + _variables.TryGetValue(name, out string value); + return value; + } + + public object GetAppContextData(string name) + { + _appContextData.TryGetValue(name, out object value); return value; } diff --git a/src/installer/test/Microsoft.Extensions.DependencyModel.Tests/JsonAssetions.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/JsonAssetions.cs similarity index 89% rename from src/installer/test/Microsoft.Extensions.DependencyModel.Tests/JsonAssetions.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/tests/JsonAssetions.cs index ccc49e394a1c6..8ce460063df5c 100644 --- a/src/installer/test/Microsoft.Extensions.DependencyModel.Tests/JsonAssetions.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/JsonAssetions.cs @@ -1,4 +1,8 @@ -using System; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/Microsoft.Extensions.DependencyModel.Tests.csproj b/src/libraries/Microsoft.Extensions.DependencyModel/tests/Microsoft.Extensions.DependencyModel.Tests.csproj new file mode 100644 index 0000000000000..e7463ccec23c4 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/Microsoft.Extensions.DependencyModel.Tests.csproj @@ -0,0 +1,18 @@ + + + + $(NetCoreAppCurrent);$(NetFrameworkCurrent) + true + true + + + + + + + + + + + + diff --git a/src/installer/test/Microsoft.Extensions.DependencyModel.Tests/PackageResolverTest.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/PackageResolverTest.cs similarity index 83% rename from src/installer/test/Microsoft.Extensions.DependencyModel.Tests/PackageResolverTest.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/tests/PackageResolverTest.cs index 6fd0a2671010e..f031344ee0d92 100644 --- a/src/installer/test/Microsoft.Extensions.DependencyModel.Tests/PackageResolverTest.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/PackageResolverTest.cs @@ -20,12 +20,11 @@ public void ShouldUseEnvironmentVariableToGetDefaultLocation() { var environment = EnvironmentMockBuilder.Create() .AddVariable("NUGET_PACKAGES", PackagesPath) + .AddAppContextData("PROBING_DIRECTORIES", string.Empty) .Build(); var result = PackageCompilationAssemblyResolver.GetDefaultProbeDirectories(environment); - // The host for .NET Core 2.0 always sets the PROBING_DIRECTORIES property on the AppContext. Because of that, - // no additional package directories should be returned from this, even if they are set as environment variables. - result.Should().NotContain(PackagesPath); + result.Should().Contain(PackagesPath); } @@ -35,12 +34,11 @@ public void ShouldUseNugetUnderUserProfileOnWindows() var environment = EnvironmentMockBuilder.Create() .SetIsWindows(true) .AddVariable("USERPROFILE", "User Profile") + .AddAppContextData("PROBING_DIRECTORIES", string.Empty) .Build(); var result = PackageCompilationAssemblyResolver.GetDefaultProbeDirectories(environment); - // The host for .NET Core 2.0 always sets the PROBING_DIRECTORIES property on the AppContext. Because of that, - // no additional package directories should be returned from this, even if they are set as environment variables. - result.Should().NotContain(Path.Combine("User Profile", ".nuget", "packages")); + result.Should().Contain(Path.Combine("User Profile", ".nuget", "packages")); } [Fact] @@ -49,12 +47,11 @@ public void ShouldUseNugetUnderHomeOnNonWindows() var environment = EnvironmentMockBuilder.Create() .SetIsWindows(false) .AddVariable("HOME", "User Home") + .AddAppContextData("PROBING_DIRECTORIES", string.Empty) .Build(); var result = PackageCompilationAssemblyResolver.GetDefaultProbeDirectories(environment); - // The host for .NET Core 2.0 always sets the PROBING_DIRECTORIES property on the AppContext. Because of that, - // no additional package directories should be returned from this, even if they are set as environment variables. - result.Should().NotContain(Path.Combine("User Home", ".nuget", "packages")); + result.Should().Contain(Path.Combine("User Home", ".nuget", "packages")); } [Fact] diff --git a/src/installer/test/Microsoft.Extensions.DependencyModel.Tests/ReferenceAssemblyResolverTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/ReferenceAssemblyResolverTests.cs similarity index 100% rename from src/installer/test/Microsoft.Extensions.DependencyModel.Tests/ReferenceAssemblyResolverTests.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/tests/ReferenceAssemblyResolverTests.cs diff --git a/src/installer/test/Microsoft.Extensions.DependencyModel.Tests/TestLibraryFactory.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/TestLibraryFactory.cs similarity index 100% rename from src/installer/test/Microsoft.Extensions.DependencyModel.Tests/TestLibraryFactory.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/tests/TestLibraryFactory.cs diff --git a/src/installer/test/Microsoft.Extensions.DependencyModel.Tests/mocks/FileSystemMockBuilder.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/mocks/FileSystemMockBuilder.cs similarity index 100% rename from src/installer/test/Microsoft.Extensions.DependencyModel.Tests/mocks/FileSystemMockBuilder.cs rename to src/libraries/Microsoft.Extensions.DependencyModel/tests/mocks/FileSystemMockBuilder.cs diff --git a/src/libraries/pkg/baseline/packageIndex.json b/src/libraries/pkg/baseline/packageIndex.json index e143135a6884c..2af1fe97b0bc7 100644 --- a/src/libraries/pkg/baseline/packageIndex.json +++ b/src/libraries/pkg/baseline/packageIndex.json @@ -522,6 +522,36 @@ "5.0.0.0": "5.0.0" } }, + "Microsoft.Extensions.DependencyModel": { + "StableVersions": [ + "1.0.0", + "1.0.2", + "1.0.3", + "1.1.0", + "1.1.1", + "1.1.2", + "1.1.9", + "2.0.0", + "2.0.1", + "2.0.3", + "2.0.4", + "2.1.0", + "3.0.0", + "3.0.1", + "3.0.2", + "3.0.3", + "3.1.0", + "3.1.1", + "3.1.2", + "3.1.3" + ], + "BaselineVersion": "5.0.0", + "InboxOn": {}, + "AssemblyVersionInPackageVersion": { + "3.1.3.0": "5.0.0", + "5.0.0.0": "5.0.0" + } + }, "Microsoft.Extensions.FileProviders.Abstractions": { "StableVersions": [ "1.0.0", @@ -1346,6 +1376,15 @@ "BaselineVersion": "1.6.1", "InboxOn": {} }, + "Newtonsoft.Json": { + "StableVersions": [ + "9.0.1" + ], + "InboxOn": {}, + "AssemblyVersionInPackageVersion": { + "9.0.0.0": "9.0.1" + } + }, "PresentationBuildTasks": { "InboxOn": { "net45": "4.0.0.0" @@ -2258,7 +2297,7 @@ "4.6.1", "4.7.0", "4.8.0", - "4.8.1", + "4.8.1" ], "BaselineVersion": "4.8.0", "InboxOn": { diff --git a/src/libraries/pkg/descriptions.json b/src/libraries/pkg/descriptions.json index 449c46baefabb..87b23a37dad8c 100644 --- a/src/libraries/pkg/descriptions.json +++ b/src/libraries/pkg/descriptions.json @@ -88,6 +88,13 @@ "Description": "Default implementation of dependency injection for Microsoft.Extensions.DependencyInjection.", "CommonTypes": [] }, + { + "Name": "Microsoft.Extensions.DependencyModel", + "Description": "Abstractions for reading `.deps` files.", + "CommonTypes": [ + "Microsoft.Extensions.DependencyModel.DependencyContext" + ] + }, { "Name": "Microsoft.Extensions.DependencyInjection.Abstractions", "Description": "Abstractions for dependency injection.", diff --git a/src/libraries/pkg/test/frameworkSettings/netcoreapp1.0/settings.targets b/src/libraries/pkg/test/frameworkSettings/netcoreapp1.0/settings.targets index ac52538bb26a8..f319b95868991 100644 --- a/src/libraries/pkg/test/frameworkSettings/netcoreapp1.0/settings.targets +++ b/src/libraries/pkg/test/frameworkSettings/netcoreapp1.0/settings.targets @@ -22,5 +22,11 @@ + + + + + + \ No newline at end of file diff --git a/src/libraries/pkg/test/frameworkSettings/netcoreapp1.1/settings.targets b/src/libraries/pkg/test/frameworkSettings/netcoreapp1.1/settings.targets index f1a20b8a51435..846df54fdc37b 100644 --- a/src/libraries/pkg/test/frameworkSettings/netcoreapp1.1/settings.targets +++ b/src/libraries/pkg/test/frameworkSettings/netcoreapp1.1/settings.targets @@ -24,5 +24,11 @@ + + + + + + \ No newline at end of file diff --git a/src/libraries/pkg/test/packageTest.targets b/src/libraries/pkg/test/packageTest.targets index 2d1c98b2ca5bb..2196f4a0d4964 100644 --- a/src/libraries/pkg/test/packageTest.targets +++ b/src/libraries/pkg/test/packageTest.targets @@ -23,6 +23,8 @@ + + diff --git a/src/libraries/shims/generated/Directory.Build.props b/src/libraries/shims/generated/Directory.Build.props index f936b3f2c9d7b..2768718a10e52 100644 --- a/src/libraries/shims/generated/Directory.Build.props +++ b/src/libraries/shims/generated/Directory.Build.props @@ -12,9 +12,10 @@ + + Exclude="$(RefPath)$(MSBuildProjectName).dll;$(RefPath)netstandard.dll;$(RefPath)Microsoft.Extensions.DependencyModel.dll" />