From d2e263a4876b3b1f99fa57e9d739c4f8eae5fc04 Mon Sep 17 00:00:00 2001 From: Mike Richmond Date: Fri, 4 Aug 2017 12:31:26 -0700 Subject: [PATCH 1/3] Fix VS 2017 compilation --- .../nativemsh/pwrshcommon/CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/powershell-native/nativemsh/pwrshcommon/CMakeLists.txt b/src/powershell-native/nativemsh/pwrshcommon/CMakeLists.txt index 29b0b6c921e..cbcd67c68fc 100644 --- a/src/powershell-native/nativemsh/pwrshcommon/CMakeLists.txt +++ b/src/powershell-native/nativemsh/pwrshcommon/CMakeLists.txt @@ -10,6 +10,18 @@ add_library(pwrshcommon target_include_directories(pwrshcommon PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +# +# VS 2017 corrupts the INCLUDE environment variable when processing the csproj +# file generated for this template. The netfxsdk path is shortened from +# C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\Include\um +# to +# Include\um +# This prevents msbuild from locating corerror.h and throws a resolution error +# during compilation. We work around the problem by force-including the +# contents of the environment variable before it gets corrupted. +# +target_include_directories(pwrshcommon PUBLIC $ENV{INCLUDE}) + if (BUILD_ONECORE) # Libraries to use when creating this binary for Windows on OneCore-based SKUs set(PWRSHCOMMON_WINDOWS_LIBS From 29f72c4937033c460237ef85901bc9e06cd8cb59 Mon Sep 17 00:00:00 2001 From: Mike Richmond Date: Fri, 4 Aug 2017 12:31:41 -0700 Subject: [PATCH 2/3] Add missing assemblies to TPA list --- src/powershell-native/nativemsh/pwrshcommon/pwrshcommon.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/powershell-native/nativemsh/pwrshcommon/pwrshcommon.cpp b/src/powershell-native/nativemsh/pwrshcommon/pwrshcommon.cpp index 198d9e7482d..481e439e40c 100644 --- a/src/powershell-native/nativemsh/pwrshcommon/pwrshcommon.cpp +++ b/src/powershell-native/nativemsh/pwrshcommon/pwrshcommon.cpp @@ -703,6 +703,7 @@ namespace NativeMsh "System.Collections.Immutable", "System.Collections.NonGeneric", "System.Collections.Specialized", + "System.Configuration", "System.ComponentModel", "System.ComponentModel.Annotations", "System.ComponentModel.Composition", @@ -803,6 +804,7 @@ namespace NativeMsh "System.Runtime.Serialization.Json", "System.Runtime.Serialization.Primitives", "System.Runtime.Serialization.Xml", + "System.Security", "System.Security.AccessControl", "System.Security.Claims", "System.Security.Cryptography.Algorithms", @@ -813,6 +815,7 @@ namespace NativeMsh "System.Security.Cryptography.Pkcs", "System.Security.Cryptography.Primitives", "System.Security.Cryptography.X509Certificates", + "System.Security.Permissions", "System.Security.Principal", "System.Security.Principal.Windows", "System.Security.SecureString", @@ -822,6 +825,7 @@ namespace NativeMsh "System.ServiceModel.Primitives", "System.ServiceModel.Security", "System.ServiceModel.Web", + "System.ServiceProcess", "System.ServiceProcess.ServiceController", "System.Text.Encoding", "System.Text.Encoding.CodePages", From d823c1d6f18cf4be7feecf14d856c2bd2c123f9f Mon Sep 17 00:00:00 2001 From: Mike Richmond Date: Fri, 4 Aug 2017 17:12:09 -0700 Subject: [PATCH 3/3] Bump up the version of psrp.windows --- src/powershell-win-core/powershell-win-core.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/powershell-win-core/powershell-win-core.csproj b/src/powershell-win-core/powershell-win-core.csproj index c5b0de24fc0..c0fe6a9ca48 100644 --- a/src/powershell-win-core/powershell-win-core.csproj +++ b/src/powershell-win-core/powershell-win-core.csproj @@ -37,7 +37,7 @@ - +