Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/powershell-native/nativemsh/pwrshcommon/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume adding this would still work on a machine with VS15 installed only, right?

Copy link
Member Author

@mirichmo mirichmo Aug 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is the scenario where I ran it. My system has VS 2015 and VS 2017 installed side-by-side. I have not verified it on a system that only has VS 2017. As long as vcvarsall.bat generates the correct INCLUDE environment variable, it should work though.

Additional search paths will not cause a working instance to fail, so it is a lower risk change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not verified it on a system that only has VS 2017.

I'm not worried about a system that only has VS 2017, but a system that only has VS 2015. Our current release build pipeline in VSTS only installs VS 2015. I want to make sure we don't break there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I checked out this PR and verified that it builds fine with VS 2015 installed only and the generated plugin binary works.


if (BUILD_ONECORE)
# Libraries to use when creating this binary for Windows on OneCore-based SKUs
set(PWRSHCOMMON_WINDOWS_LIBS
Expand Down
4 changes: 4 additions & 0 deletions src/powershell-native/nativemsh/pwrshcommon/pwrshcommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/powershell-win-core/powershell-win-core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<ItemGroup>
<PackageReference Include="PSDesiredStateConfiguration" Version="1.0.0-alpha01" />
<PackageReference Include="PowerShellHelpFiles" Version="1.0.0-alpha01" />
<PackageReference Include="psrp.windows" Version="6.0.0-beta.1" />
<PackageReference Include="psrp.windows" Version="6.0.0-beta.2" />
</ItemGroup>

<PropertyGroup>
Expand Down