Skip to content

Commit 4b39d01

Browse files
bergmeisterTylerLeonhardt
authored andcommitted
Compile against net452 because net451 is not supported any more (#828)
* upgrade to net452 since net451 is not supported any more * update docs and docker image
1 parent b606504 commit 4b39d01

File tree

10 files changed

+38
-39
lines changed

10 files changed

+38
-39
lines changed

PowerShellEditorServices.build.ps1

+13-13
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ param(
2020

2121
$script:IsCIBuild = $env:APPVEYOR -ne $null
2222
$script:IsUnix = $PSVersionTable.PSEdition -and $PSVersionTable.PSEdition -eq "Core" -and !$IsWindows
23-
$script:TargetFrameworksParam = "/p:TargetFrameworks=\`"$(if (!$script:IsUnix) { "net451;" })netstandard1.6\`""
23+
$script:TargetFrameworksParam = "/p:TargetFrameworks=\`"$(if (!$script:IsUnix) { "net452;" })netstandard1.6\`""
2424
$script:SaveModuleSupportsAllowPrerelease = (Get-Command Save-Module).Parameters.ContainsKey("AllowPrerelease")
2525
$script:BuildInfoPath = [System.IO.Path]::Combine($PSScriptRoot, "src", "PowerShellEditorServices.Host", "BuildInfo", "BuildInfo.cs")
2626

@@ -138,7 +138,7 @@ task GetProductVersion -Before PackageNuGet, PackageModule, UploadArtifacts {
138138

139139
function BuildForPowerShellVersion($version) {
140140
Write-Host -ForegroundColor Green "`n### Testing API usage for PowerShell $version...`n"
141-
exec { & $script:dotnetExe build -f net451 .\src\PowerShellEditorServices\PowerShellEditorServices.csproj /p:PowerShellVersion=$version }
141+
exec { & $script:dotnetExe build -f net452 .\src\PowerShellEditorServices\PowerShellEditorServices.csproj /p:PowerShellVersion=$version }
142142
}
143143

144144
task TestPowerShellApi -If { !$script:IsUnix } {
@@ -198,7 +198,7 @@ namespace Microsoft.PowerShell.EditorServices.Host
198198
task Build {
199199
exec { & $script:dotnetExe publish -c $Configuration .\src\PowerShellEditorServices.Host\PowerShellEditorServices.Host.csproj -f netstandard1.6 }
200200
if (!$script:IsUnix) {
201-
exec { & $script:dotnetExe publish -c $Configuration .\src\PowerShellEditorServices.Host\PowerShellEditorServices.Host.csproj -f net451 }
201+
exec { & $script:dotnetExe publish -c $Configuration .\src\PowerShellEditorServices.Host\PowerShellEditorServices.Host.csproj -f net452 }
202202
}
203203
exec { & $script:dotnetExe build -c $Configuration .\src\PowerShellEditorServices.VSCode\PowerShellEditorServices.VSCode.csproj $script:TargetFrameworksParam }
204204
exec { & $script:dotnetExe publish -c $Configuration .\src\PowerShellEditorServices\PowerShellEditorServices.csproj -f netstandard1.6 }
@@ -274,12 +274,12 @@ task LayoutModule -After Build {
274274
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\netstandard1.6\publish\runtimes\win\lib\netstandard1.3\* -Filter System.IO.Pipes*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Core\
275275

276276
if (!$script:IsUnix) {
277-
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices\bin\$Configuration\net451\Serilog*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop
278-
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices\bin\$Configuration\net451\System.Runtime.InteropServices.RuntimeInformation.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
277+
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices\bin\$Configuration\net452\Serilog*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop
278+
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices\bin\$Configuration\net452\System.Runtime.InteropServices.RuntimeInformation.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
279279

280-
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\net451\* -Filter Microsoft.PowerShell.EditorServices*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
281-
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\net451\Newtonsoft.Json.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
282-
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\net451\UnixConsoleEcho.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
280+
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\net452\* -Filter Microsoft.PowerShell.EditorServices*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
281+
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\net452\Newtonsoft.Json.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
282+
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\net452\UnixConsoleEcho.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
283283
}
284284

285285
# Copy Third Party Notices.txt to module folder
@@ -292,7 +292,7 @@ task LayoutModule -After Build {
292292

293293
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.VSCode\bin\$Configuration\netstandard1.6\* -Filter Microsoft.PowerShell.EditorServices.VSCode*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices.VSCode\bin\Core\
294294
if (!$script:IsUnix) {
295-
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.VSCode\bin\$Configuration\net451\* -Filter Microsoft.PowerShell.EditorServices.VSCode*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices.VSCode\bin\Desktop\
295+
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.VSCode\bin\$Configuration\net452\* -Filter Microsoft.PowerShell.EditorServices.VSCode*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices.VSCode\bin\Desktop\
296296
}
297297

298298
if ($Configuration -eq "Debug") {
@@ -302,10 +302,10 @@ task LayoutModule -After Build {
302302
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Protocol\bin\$Configuration\netstandard1.6\Microsoft.PowerShell.EditorServices.Protocol.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Core\
303303

304304
if (!$script:IsUnix) {
305-
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.VSCode\bin\$Configuration\net451\Microsoft.PowerShell.EditorServices.VSCode.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices.VSCode\bin\Desktop\
306-
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices\bin\$Configuration\net451\Microsoft.PowerShell.EditorServices.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
307-
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\net451\Microsoft.PowerShell.EditorServices.Host.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
308-
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Protocol\bin\$Configuration\net451\Microsoft.PowerShell.EditorServices.Protocol.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
305+
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.VSCode\bin\$Configuration\net452\Microsoft.PowerShell.EditorServices.VSCode.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices.VSCode\bin\Desktop\
306+
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices\bin\$Configuration\net452\Microsoft.PowerShell.EditorServices.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
307+
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\net452\Microsoft.PowerShell.EditorServices.Host.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
308+
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Protocol\bin\$Configuration\net452\Microsoft.PowerShell.EditorServices.Protocol.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
309309
}
310310
}
311311
}

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ If you are using macOS you will need to download the latest version of OpenSSL.
6767
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
6868
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
6969
```
70-
### 2. On Windows, install the .NET 4.5.1 Targeting Pack
70+
### 2. On Windows, install the .NET 4.5.2 Targeting Pack
7171

7272
**NOTE: This is only necessary if you don't have Visual Studio installed**
7373

74-
If you try to build the code and receive an error about a missing .NET 4.5.1
74+
If you try to build the code and receive an error about a missing .NET 4.5.2
7575
Targeting Pack, you should download and install the [.NET Framework 4.5.2 Developer Pack](https://www.microsoft.com/en-us/download/details.aspx?id=42637).
7676

7777
### 3. Clone the GitHub repository:

module/PowerShellEditorServices/Start-EditorServices.ps1

+4-4
Original file line numberDiff line numberDiff line change
@@ -161,18 +161,18 @@ if ($host.Runspace.LanguageMode -eq 'ConstrainedLanguage') {
161161
ExitWithError "PowerShell is configured with an unsupported LanguageMode (ConstrainedLanguage), language features are disabled."
162162
}
163163

164-
# net45 is not supported, only net451 and up
164+
# net451 and lower are not supported, only net452 and up
165165
if ($PSVersionTable.PSVersion.Major -le 5) {
166-
$net451Version = 378675
166+
$net452Version = 379893
167167
$dotnetVersion = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\").Release
168-
if ($dotnetVersion -lt $net451Version) {
168+
if ($dotnetVersion -lt $net452Version) {
169169
Write-SessionFile @{
170170
status = failed
171171
reason = "netversion"
172172
detail = "$netVersion"
173173
}
174174

175-
ExitWithError "Your .NET version is too low. Upgrade to net451 or higher to run the PowerShell extension."
175+
ExitWithError "Your .NET version is too low. Upgrade to net452 or higher to run the PowerShell extension."
176176
}
177177
}
178178

src/PowerShellEditorServices.Channel.WebSocket/PowerShellEditorServices.Channel.WebSocket.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
<PropertyGroup>
55
<AssemblyTitle>PowerShell Editor Services WebSocket Protocol Channel</AssemblyTitle>
6-
<TargetFramework>net451</TargetFramework>
6+
<TargetFramework>net452</TargetFramework>
77
<AssemblyName>Microsoft.PowerShell.EditorServices.Channel.WebSocket</AssemblyName>
88
</PropertyGroup>
99

10-
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
10+
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
1111
<ProjectReference Include="..\PowerShellEditorServices\PowerShellEditorServices.csproj" />
1212
<ProjectReference Include="..\PowerShellEditorServices.Protocol\PowerShellEditorServices.Protocol.csproj" />
1313
</ItemGroup>
@@ -18,7 +18,7 @@
1818
</PackageReference>
1919
</ItemGroup>
2020

21-
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
21+
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
2222
<PackageReference Include="CommonServiceLocator" Version="1.3" />
2323
<PackageReference Include="Microsoft.Owin" Version="3.0.0" />
2424
<PackageReference Include="Owin" Version="1.0" />
@@ -29,7 +29,7 @@
2929
<DefineConstants>$(DefineConstants);CoreCLR</DefineConstants>
3030
</PropertyGroup>
3131

32-
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
32+
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
3333
<Reference Include="System" />
3434
<Reference Include="Microsoft.CSharp" />
3535
</ItemGroup>
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
3-
<startup>
4-
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
55
</startup>
66
</configuration>

src/PowerShellEditorServices.Host/PowerShellEditorServices.Host.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<PropertyGroup>
55
<AssemblyTitle>PowerShell Editor Services Host Process</AssemblyTitle>
66
<Description>Provides a process for hosting the PowerShell Editor Services library exposed by a JSON message protocol.</Description>
7-
<TargetFrameworks>netstandard1.6;net451</TargetFrameworks>
7+
<TargetFrameworks>netstandard1.6;net452</TargetFrameworks>
88
<AssemblyName>Microsoft.PowerShell.EditorServices.Host</AssemblyName>
99
</PropertyGroup>
1010

@@ -26,7 +26,7 @@
2626
<DefineConstants>$(DefineConstants);CoreCLR</DefineConstants>
2727
</PropertyGroup>
2828

29-
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
29+
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
3030
<Reference Include="System" />
3131
<Reference Include="Microsoft.CSharp" />
3232
</ItemGroup>

src/PowerShellEditorServices.Protocol/PowerShellEditorServices.Protocol.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<AssemblyTitle>PowerShell Editor Services Host Protocol Library</AssemblyTitle>
55
<Description>Provides message types and client/server APIs for the PowerShell Editor Services JSON protocol.</Description>
6-
<TargetFrameworks>netstandard1.6;net451;</TargetFrameworks>
6+
<TargetFrameworks>netstandard1.6;net452;</TargetFrameworks>
77
<AssemblyName>Microsoft.PowerShell.EditorServices.Protocol</AssemblyName>
88
</PropertyGroup>
99
<ItemGroup>
@@ -20,7 +20,7 @@
2020
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.6' ">
2121
<DefineConstants>$(DefineConstants);CoreCLR</DefineConstants>
2222
</PropertyGroup>
23-
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
23+
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
2424
<Reference Include="System" />
2525
<Reference Include="Microsoft.CSharp" />
2626
</ItemGroup>

src/PowerShellEditorServices.VSCode/PowerShellEditorServices.VSCode.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<PropertyGroup>
55
<AssemblyTitle>PowerShell Editor Services, Visual Studio Code Extensions</AssemblyTitle>
66
<Description>Provides added functionality to PowerShell Editor Services for the Visual Studio Code editor.</Description>
7-
<TargetFrameworks>netstandard1.6;net451</TargetFrameworks>
7+
<TargetFrameworks>netstandard1.6;net452</TargetFrameworks>
88
<AssemblyName>Microsoft.PowerShell.EditorServices.VSCode</AssemblyName>
99
</PropertyGroup>
1010

@@ -24,7 +24,7 @@
2424
<DefineConstants>$(DefineConstants);CoreCLR</DefineConstants>
2525
</PropertyGroup>
2626

27-
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
27+
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
2828
<Reference Include="System" />
2929
<Reference Include="Microsoft.CSharp" />
3030
</ItemGroup>

src/PowerShellEditorServices/PowerShellEditorServices.csproj

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<AssemblyTitle>PowerShell Editor Services</AssemblyTitle>
55
<Description>Provides common PowerShell editor capabilities as a .NET library.</Description>
6-
<TargetFrameworks>netstandard1.6;net451</TargetFrameworks>
6+
<TargetFrameworks>netstandard1.6;net452</TargetFrameworks>
77
<AssemblyName>Microsoft.PowerShell.EditorServices</AssemblyName>
88
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.6' ">$(PackageTargetFallback);dnxcore50;portable-net45+win8</PackageTargetFallback>
99
</PropertyGroup>
@@ -28,18 +28,18 @@
2828
</PropertyGroup>
2929

3030
<Target Name="PowerShellVersionOutput" BeforeTargets="Compile">
31-
<Message Condition=" '$(TargetFramework)' == 'net451' And '$(PowerShellVersion)' != '' " Text="Target PowerShell Version: $(PowerShellVersion) -- Constants: $(DefineConstants)" Importance="High" />
31+
<Message Condition=" '$(TargetFramework)' == 'net452' And '$(PowerShellVersion)' != '' " Text="Target PowerShell Version: $(PowerShellVersion) -- Constants: $(DefineConstants)" Importance="High" />
3232
</Target>
3333

34-
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' And '$(PowerShellVersion)' == 'v3' ">
34+
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' And '$(PowerShellVersion)' == 'v3' ">
3535
<PackageReference Include="Microsoft.PowerShell.3.ReferenceAssemblies" Version="1.0.0" />
3636
</ItemGroup>
3737

38-
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' And '$(PowerShellVersion)' == 'v4' ">
38+
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' And '$(PowerShellVersion)' == 'v4' ">
3939
<PackageReference Include="Microsoft.PowerShell.4.ReferenceAssemblies" Version="1.0.0" />
4040
</ItemGroup>
4141

42-
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' And ('$(PowerShellVersion)' == 'v5r2' Or '$(PowerShellVersion)' == 'v5r1')">
42+
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' And ('$(PowerShellVersion)' == 'v5r2' Or '$(PowerShellVersion)' == 'v5r1')">
4343
<PackageReference Include="Microsoft.PowerShell.5.ReferenceAssemblies" Version="1.0.0" />
4444
</ItemGroup>
4545

@@ -49,7 +49,7 @@
4949
</PackageReference>
5050
</ItemGroup>
5151

52-
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
52+
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
5353
<Reference Include="System" />
5454
<Reference Include="Microsoft.CSharp" />
5555
<Reference Include="System.Core" />

tools/releaseBuild/Image/DockerFile

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ RUN Import-Module PackageManagement; `
1717
Install-Module InvokeBuild -MaximumVersion 5.1.0 -Scope CurrentUser -Force; `
1818
Install-Module platyPS -RequiredVersion 0.9.0 -Scope CurrentUser -Force;
1919

20-
# Install .NET Framework 4.5.1 & 4.5.2 Developer Packs
20+
# Install .NET Framework 4.5.2 Developer Packs
2121
RUN Import-Module ./containerFiles/dockerInstall.psm1; `
22-
Install-ChocolateyPackage -PackageName netfx-4.5.1-devpack; `
2322
Install-ChocolateyPackage -PackageName netfx-4.5.2-devpack;
2423

2524
# Copy build script over

0 commit comments

Comments
 (0)