From 5e3eec9a47aea9c16767a04bddc0280d750a1c30 Mon Sep 17 00:00:00 2001 From: Andy Gocke Date: Thu, 25 Jan 2018 15:30:06 -0800 Subject: [PATCH] Add references to System.IO.Pipes.AccessControl (#24457) When adding the reference to System.IO.Pipes.AccessControl for the compiler server to use on CoreCLR, I unified the pathway for the desktop and CoreCLR server access control code. This means that System.IO.Pipes.AccessControl needed to be added as a dependent DLL for desktop too, but I forgot to do that. This change adds System.IO.Pipes.AccessControl as a dependent DLL in all the places where the build task is deployed. --- .../Core/MSBuildTask/AssemblyResolution.cs | 16 ++++++++++++---- src/Compilers/Extension/AssemblyRedirects.cs | 1 + src/Compilers/Extension/CompilerExtension.csproj | 1 + src/NuGet/Microsoft.Net.Compilers.nuspec | 1 + .../BuildDevDivInsertionFiles.vb | 3 ++- .../Roslyn/DevDivPackagesRoslyn.csproj | 1 + .../Microsoft.CodeAnalysis.Compilers.swr | 1 + .../PortableFacades/PortableFacades.swr | 3 ++- 8 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/Compilers/Core/MSBuildTask/AssemblyResolution.cs b/src/Compilers/Core/MSBuildTask/AssemblyResolution.cs index b9f35ae0815..3ba10248e19 100644 --- a/src/Compilers/Core/MSBuildTask/AssemblyResolution.cs +++ b/src/Compilers/Core/MSBuildTask/AssemblyResolution.cs @@ -92,7 +92,12 @@ private static Assembly LoadAssemblyWithRedirects(AssemblyName name) switch (name.Name) { case "System.IO.Pipes.AccessControl": - return TryRedirectToRuntimesDir(name); + var assembly = TryRedirectToRuntimesDir(name); + if (assembly != null) + { + return assembly; + } + break; } return Assembly.Load(name); @@ -128,14 +133,17 @@ private static Assembly TryRedirectToRuntimesDir(AssemblyName name) if (File.Exists(assemblyPath)) { CompilerServerLogger.Log($"Loading from: {assemblyPath}"); - return (Assembly)typeof(Assembly).GetTypeInfo() - .GetDeclaredMethod("LoadFile") - ?.Invoke(null, parameters: new object[] { assemblyPath }); + return LoadAssemblyFromPath(assemblyPath); } CompilerServerLogger.Log($"File not found: {assemblyPath}"); return null; + + Assembly LoadAssemblyFromPath(string path) + => (Assembly)typeof(Assembly).GetTypeInfo() + .GetDeclaredMethod("LoadFile") + ?.Invoke(null, parameters: new object[] { assemblyPath }); } private static bool KeysEqual(byte[] left, byte[] right) diff --git a/src/Compilers/Extension/AssemblyRedirects.cs b/src/Compilers/Extension/AssemblyRedirects.cs index a8d85ca68ad..12cc670fc27 100644 --- a/src/Compilers/Extension/AssemblyRedirects.cs +++ b/src/Compilers/Extension/AssemblyRedirects.cs @@ -15,6 +15,7 @@ [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\System.IO.FileSystem.DriveInfo.dll")] [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\System.IO.FileSystem.Primitives.dll")] [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\System.IO.Pipes.dll")] +[assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\System.IO.Pipes.AccessControl.dll")] [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\System.Security.AccessControl.dll")] [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\System.Security.Claims.dll")] [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\System.Security.Cryptography.Algorithms.dll")] diff --git a/src/Compilers/Extension/CompilerExtension.csproj b/src/Compilers/Extension/CompilerExtension.csproj index cd74e4f0c48..81c08b04497 100644 --- a/src/Compilers/Extension/CompilerExtension.csproj +++ b/src/Compilers/Extension/CompilerExtension.csproj @@ -57,6 +57,7 @@ + diff --git a/src/NuGet/Microsoft.Net.Compilers.nuspec b/src/NuGet/Microsoft.Net.Compilers.nuspec index 4b2fa4cb8b4..99d3169b3e7 100644 --- a/src/NuGet/Microsoft.Net.Compilers.nuspec +++ b/src/NuGet/Microsoft.Net.Compilers.nuspec @@ -73,6 +73,7 @@ + diff --git a/src/Setup/DevDivInsertionFiles/BuildDevDivInsertionFiles.vb b/src/Setup/DevDivInsertionFiles/BuildDevDivInsertionFiles.vb index 37985f27f54..baf45620ed1 100644 --- a/src/Setup/DevDivInsertionFiles/BuildDevDivInsertionFiles.vb +++ b/src/Setup/DevDivInsertionFiles/BuildDevDivInsertionFiles.vb @@ -550,7 +550,7 @@ Public Class BuildDevDivInsertionFiles packageName, packageVersion, isNative:=native IsNot Nothing, - isFacade:=frameworkAssemblies IsNot Nothing)) + isFacade:=frameworkAssemblies IsNot Nothing OrElse packageName = "System.IO.Pipes.AccessControl")) End If Next Next @@ -852,6 +852,7 @@ Public Class BuildDevDivInsertionFiles add("Exes\Toolset\System.IO.FileSystem.DriveInfo.dll") add("Exes\Toolset\System.IO.FileSystem.Primitives.dll") add("Exes\Toolset\System.IO.Pipes.dll") + add("Exes\Toolset\System.IO.Pipes.AccessControl.dll") add("Exes\Toolset\System.Reflection.Metadata.dll") add("Exes\Toolset\System.Security.AccessControl.dll") add("Exes\Toolset\System.Security.Claims.dll") diff --git a/src/Setup/DevDivPackages/Roslyn/DevDivPackagesRoslyn.csproj b/src/Setup/DevDivPackages/Roslyn/DevDivPackagesRoslyn.csproj index 64aa0298b16..69f247f40e0 100644 --- a/src/Setup/DevDivPackages/Roslyn/DevDivPackagesRoslyn.csproj +++ b/src/Setup/DevDivPackages/Roslyn/DevDivPackagesRoslyn.csproj @@ -39,6 +39,7 @@ + diff --git a/src/Setup/DevDivVsix/CompilersPackage/Microsoft.CodeAnalysis.Compilers.swr b/src/Setup/DevDivVsix/CompilersPackage/Microsoft.CodeAnalysis.Compilers.swr index f95469d4f64..9a5cc966118 100644 --- a/src/Setup/DevDivVsix/CompilersPackage/Microsoft.CodeAnalysis.Compilers.swr +++ b/src/Setup/DevDivVsix/CompilersPackage/Microsoft.CodeAnalysis.Compilers.swr @@ -44,6 +44,7 @@ folder InstallDir:\MSBuild\15.0\Bin\Roslyn file source=$(OutputPath)\Vsix\CompilerExtension\System.IO.FileSystem.DriveInfo.dll vs.file.ngenArchitecture=all file source=$(OutputPath)\Vsix\CompilerExtension\System.IO.FileSystem.Primitives.dll vs.file.ngenArchitecture=all file source=$(OutputPath)\Vsix\CompilerExtension\System.IO.Pipes.dll vs.file.ngenArchitecture=all + file source=$(OutputPath)\Vsix\CompilerExtension\System.IO.Pipes.AccessControl.dll vs.file.ngenArchitecture=all file source=$(OutputPath)\Vsix\CompilerExtension\System.Security.AccessControl.dll vs.file.ngenArchitecture=all file source=$(OutputPath)\Vsix\CompilerExtension\System.Security.Claims.dll vs.file.ngenArchitecture=all file source=$(OutputPath)\Vsix\CompilerExtension\System.Security.Cryptography.Algorithms.dll vs.file.ngenArchitecture=all diff --git a/src/Setup/DevDivVsix/PortableFacades/PortableFacades.swr b/src/Setup/DevDivVsix/PortableFacades/PortableFacades.swr index 3f28efbc6ab..b242a61d9fc 100644 --- a/src/Setup/DevDivVsix/PortableFacades/PortableFacades.swr +++ b/src/Setup/DevDivVsix/PortableFacades/PortableFacades.swr @@ -1,7 +1,7 @@ use vs package name=PortableFacades - version=1.5.0.0 + version=1.6.0.0 folder InstallDir:\Common7\IDE\PrivateAssemblies file source="$(NuGetPackageRoot)\System.AppContext\4.3.0\lib\net46\System.AppContext.dll" vs.file.ngen=yes @@ -12,6 +12,7 @@ folder InstallDir:\Common7\IDE\PrivateAssemblies file source="$(NuGetPackageRoot)\System.IO.Compression\4.3.0\runtimes\win\lib\net46\System.IO.Compression.dll" vs.file.ngen=yes file source="$(NuGetPackageRoot)\System.IO.FileSystem\4.3.0\lib\net46\System.IO.FileSystem.dll" vs.file.ngen=yes file source="$(NuGetPackageRoot)\System.IO.FileSystem.Primitives\4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll" vs.file.ngen=yes + file source="$(NuGetPackageRoot)\System.IO.Pipes.AccessControl\4.3.0\runtimes\win\lib\net46\System.IO.Pipes.AccessControl.dll" vs.file.ngen=yes file source="$(NuGetPackageRoot)\System.IO.Pipes\4.3.0\runtimes\win\lib\net46\System.IO.Pipes.dll" vs.file.ngen=yes file source="$(NuGetPackageRoot)\System.Net.Security\4.3.0\runtimes\win\lib\net46\System.Net.Security.dll" vs.file.ngen=yes file source="$(NuGetPackageRoot)\System.Net.Sockets\4.3.0\lib\net46\System.Net.Sockets.dll" vs.file.ngen=yes -- GitLab