Skip to content

Commit 3aa4efc

Browse files
committed
Use corflags.exe to generate x86 host process
This change removes the existing PowerShellEditorServices.Host.x86 project in favor of using the corflags.exe tool to set the 32-bit flag on the AnyCPU build of the host process to generate the x86 variant. This will save some configuration duplication and make x86 host development builds easier to test from editors like Visual Studio Code. Resolves #185.
1 parent 23b3d47 commit 3aa4efc

File tree

5 files changed

+10
-147
lines changed

5 files changed

+10
-147
lines changed

PowerShellEditorServices.sln

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 14
4-
VisualStudioVersion = 14.0.23107.0
4+
VisualStudioVersion = 14.0.24720.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F594E7FD-1E72-4E51-A496-B019C2BA3180}"
77
EndProject
@@ -39,8 +39,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerShellEditorServices.Pr
3939
EndProject
4040
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerShellEditorServices.Test.Protocol", "test\PowerShellEditorServices.Test.Protocol\PowerShellEditorServices.Test.Protocol.csproj", "{E3A5CF5D-6E41-44AC-AE0A-4C227E4BACD4}"
4141
EndProject
42-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerShellEditorServices.Host.x86", "src\PowerShellEditorServices.Host.x86\PowerShellEditorServices.Host.x86.csproj", "{0E720BF8-84E3-4C56-BCEA-7D6FD34D8948}"
43-
EndProject
4442
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerShellEditorServices.Channel.WebSocket", "src\PowerShellEditorServices.Channel.WebSocket\PowerShellEditorServices.Channel.WebSocket.csproj", "{A6663F64-3C3D-461F-8A05-0CC4CA7A9945}"
4543
EndProject
4644
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerShellEditorServices.Test.Channel.WebSocket", "test\PowerShellEditorServices.Test.Channel.WebSocket\PowerShellEditorServices.Test.Channel.WebSocket.csproj", "{9D98120C-9601-4678-AD50-EF2808DABAC9}"
@@ -87,10 +85,6 @@ Global
8785
{E3A5CF5D-6E41-44AC-AE0A-4C227E4BACD4}.Debug|Any CPU.Build.0 = Debug|Any CPU
8886
{E3A5CF5D-6E41-44AC-AE0A-4C227E4BACD4}.Release|Any CPU.ActiveCfg = Release|Any CPU
8987
{E3A5CF5D-6E41-44AC-AE0A-4C227E4BACD4}.Release|Any CPU.Build.0 = Release|Any CPU
90-
{0E720BF8-84E3-4C56-BCEA-7D6FD34D8948}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
91-
{0E720BF8-84E3-4C56-BCEA-7D6FD34D8948}.Debug|Any CPU.Build.0 = Debug|Any CPU
92-
{0E720BF8-84E3-4C56-BCEA-7D6FD34D8948}.Release|Any CPU.ActiveCfg = Release|Any CPU
93-
{0E720BF8-84E3-4C56-BCEA-7D6FD34D8948}.Release|Any CPU.Build.0 = Release|Any CPU
9488
{A6663F64-3C3D-461F-8A05-0CC4CA7A9945}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
9589
{A6663F64-3C3D-461F-8A05-0CC4CA7A9945}.Debug|Any CPU.Build.0 = Debug|Any CPU
9690
{A6663F64-3C3D-461F-8A05-0CC4CA7A9945}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -113,7 +107,6 @@ Global
113107
{6A20B9E9-DE66-456E-B4F5-ACFD1A95C3CA} = {422E561A-8118-4BE7-A54F-9309E4F03AAE}
114108
{F8A0946A-5D25-4651-8079-B8D5776916FB} = {F594E7FD-1E72-4E51-A496-B019C2BA3180}
115109
{E3A5CF5D-6E41-44AC-AE0A-4C227E4BACD4} = {422E561A-8118-4BE7-A54F-9309E4F03AAE}
116-
{0E720BF8-84E3-4C56-BCEA-7D6FD34D8948} = {F594E7FD-1E72-4E51-A496-B019C2BA3180}
117110
{A6663F64-3C3D-461F-8A05-0CC4CA7A9945} = {F594E7FD-1E72-4E51-A496-B019C2BA3180}
118111
{9D98120C-9601-4678-AD50-EF2808DABAC9} = {422E561A-8118-4BE7-A54F-9309E4F03AAE}
119112
EndGlobalSection

src/PowerShellEditorServices.Host.x86/PowerShellEditorServices.Host.x86.csproj

Lines changed: 0 additions & 94 deletions
This file was deleted.

src/PowerShellEditorServices.Host.x86/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/PowerShellEditorServices.Host/PowerShellEditorServices.Host.csproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,13 @@
8282
</PropertyGroup>
8383
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
8484
</Target>
85+
<PropertyGroup>
86+
<PostBuildEvent>
87+
copy /y "$(ProjectDir)bin\$(Configuration)\Microsoft.PowerShell.EditorServices.Host.exe" "$(ProjectDir)bin\$(Configuration)\Microsoft.PowerShell.EditorServices.Host.x86.exe"
88+
copy /y "$(ProjectDir)bin\$(Configuration)\Microsoft.PowerShell.EditorServices.Host.exe.config" "$(ProjectDir)bin\$(Configuration)\Microsoft.PowerShell.EditorServices.Host.x86.exe.config"
89+
"$(TargetFrameworkSDKToolsDirectory)\corflags.exe" "$(ProjectDir)bin\$(Configuration)\Microsoft.PowerShell.EditorServices.Host.x86.exe" /32BIT+ /Force
90+
</PostBuildEvent>
91+
</PropertyGroup>
8592
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
8693
Other similar extension points exist, see Microsoft.Common.targets.
8794
<Target Name="BeforeBuild">

src/PowerShellEditorServices.Host/PowerShellEditorServices.Host.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0"?>
1+
<?xml version="1.0"?>
22
<package>
33
<metadata>
44
<id>$id$</id>
@@ -21,6 +21,6 @@
2121
</metadata>
2222
<files>
2323
<file src="bin\$configuration$\$id$.exe" target="lib\net45\" />
24-
<file src="..\PowerShellEditorServices.Host.x86\bin\$configuration$\$id$.x86.exe" target="lib\net45\" />
24+
<file src="bin\$configuration$\$id$.x86.exe" target="lib\net45\" />
2525
</files>
2626
</package>

0 commit comments

Comments
 (0)