Skip to content

Commit fa2934e

Browse files
committed
[pack] .net core 2.2. Fixes #3611, #3862
1 parent 203863e commit fa2934e

File tree

12 files changed

+20
-83
lines changed

12 files changed

+20
-83
lines changed

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ for:
2222
- sh: >-
2323
mkdir .dotnet &&
2424
chmod +x dotnet-install.sh &&
25-
./dotnet-install.sh --version 2.1.400 --install-dir .dotnet &&
25+
./dotnet-install.sh --version 2.2.102 --install-dir .dotnet &&
2626
PATH=".dotnet:"$PATH && dotnet --info
2727
build_script:
2828
- sh: dotnet build WebJobs.Script.sln

build.ps1

Lines changed: 8 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,21 @@ function CrossGen([string] $runtime, [string] $publishTarget, [string] $privateS
3434
$symbolsPath = Join-Path $publishTarget "Symbols"
3535
new-item -itemtype directory -path $symbolsPath
3636

37-
DownloadNupkg "https://dotnet.myget.org/F/dotnet-core/api/v2/package/runtime.$runtime.Microsoft.NETCore.Jit/2.1.0-rtm-26528-02" @("runtimes\$runtime\native\clrjit.dll") @("$publishTarget\download\clrjit")
38-
DownloadNupkg "https://dotnet.myget.org/F/dotnet-core/api/v2/package/runtime.$runtime.Microsoft.NETCore.Runtime.CoreCLR/2.1.0-rtm-26528-02" @("tools\crossgen.exe") @("$publishTarget\download\crossgen")
39-
DownloadNupkg "https://www.nuget.org/api/v2/package/Microsoft.Build.Tasks.Core/15.1.1012" @("lib\netstandard1.3\Microsoft.Build.Tasks.Core.dll") @("$selfContained")
40-
DownloadNupkg "https://www.nuget.org/api/v2/package/Microsoft.Build.Utilities.Core/15.1.1012" @("lib\netstandard1.3\Microsoft.Build.Utilities.Core.dll") @("$selfContained")
41-
if ($runtime -eq "win-x86") {
42-
DownloadNupkg "https://dotnet.myget.org/F/aspnetcore-dev/api/v2/package/Microsoft.AspNetCore.AspNetCoreModuleV2/2.1.0-a-oob-2-1-oob-17297" @("contentFiles\any\any\x86\aspnetcorev2.dll", "contentFiles\any\any\x86\aspnetcorev2_inprocess.dll") @("$privateSiteExtensionPath\ancm", "$privateSiteExtensionPath\ancm")
43-
} else {
44-
DownloadNupkg "https://dotnet.myget.org/F/aspnetcore-dev/api/v2/package/Microsoft.AspNetCore.AspNetCoreModuleV2/2.1.0-a-oob-2-1-oob-17297" @("contentFiles\any\any\x64\aspnetcorev2.dll", "contentFiles\any\any\x64\aspnetcorev2_inprocess.dll") @("$privateSiteExtensionPath\ancm", "$privateSiteExtensionPath\ancm")
45-
}
37+
#https://dotnet.myget.org/feed/dotnet-core/package/nuget/runtime.win-x86.Microsoft.NETCore.Jit
38+
DownloadNupkg "https://dotnet.myget.org/F/dotnet-core/api/v2/package/runtime.$runtime.Microsoft.NETCore.Jit/2.2.0-servicing-26820-03" @("runtimes\$runtime\native\clrjit.dll") @("$publishTarget\download\clrjit")
39+
#https://dotnet.myget.org/feed/dotnet-core/package/nuget/runtime.win-x86.Microsoft.NETCore.Runtime.CoreCLR
40+
DownloadNupkg "https://dotnet.myget.org/F/dotnet-core/api/v2/package/runtime.$runtime.Microsoft.NETCore.Runtime.CoreCLR/2.2.0-servicing-26820-03" @("tools\crossgen.exe") @("$publishTarget\download\crossgen")
4641

4742
# Publish self-contained app with all required dlls for crossgen
4843
dotnet publish .\src\WebJobs.Script.WebHost\WebJobs.Script.WebHost.csproj -r $runtime -o "$selfContained" -v q /p:BuildNumber=$buildNumber
4944

5045
# Modify web.config for inproc
51-
dotnet tool install -g dotnet-xdt --version 2.1.0 2> $null
46+
dotnet tool install -g dotnet-xdt --version 2.2.0 2> $null
5247
dotnet-xdt -s "$privateSiteExtensionPath\web.config" -t "$privateSiteExtensionPath\web.InProcess.$runtime.xdt" -o "$privateSiteExtensionPath\web.config"
5348

5449
$successfullDlls =@()
5550
$failedDlls = @()
51+
5652
Get-ChildItem $privateSiteExtensionPath -Filter *.dll |
5753
Foreach-Object {
5854
$prm = "/JITPath", "$publishTarget\download\clrjit\clrjit.dll", "/Platform_Assemblies_Paths", "$selfContained", "/nologo", "/in", $_.FullName
@@ -61,11 +57,6 @@ function CrossGen([string] $runtime, [string] $publishTarget, [string] $privateS
6157
$prm += "/out"
6258
$prm += Join-Path $privateSiteExtensionPath "Microsoft.Azure.WebJobs.Script.WebHost.ni.dll"
6359
}
64-
# Fix output for System.Private.CoreLib.dll
65-
if ($_.FullName -like "*System.Private.CoreLib.dll") {
66-
$prm += "/out"
67-
$prm += Join-Path $privateSiteExtensionPath "System.Private.CoreLib.ni.dll"
68-
}
6960

7061
& $crossGen $prm >> $buildOutput\crossgenout.$runtime.txt 2>&1
7162

@@ -81,7 +72,7 @@ function CrossGen([string] $runtime, [string] $publishTarget, [string] $privateS
8172
$failedDlls+=[io.path]::GetFileName($_.FullName)
8273
}
8374
}
84-
75+
8576
# print results of crossgen process
8677
$successfullDllsCount = $successfullDlls.length
8778
$failedDllsCount = $failedDlls.length
@@ -168,12 +159,7 @@ function BuildOutput([string] $runtime) {
168159
$siteExtensionPath = "$publishTarget\SiteExtensions"
169160
$privateSiteExtensionPath = "$siteExtensionPath\Functions"
170161

171-
if ($runtime -eq "win-x86" -or $runtime -eq "") {
172-
dotnet publish .\src\WebJobs.Script.WebHost\WebJobs.Script.WebHost.csproj -o "$privateSiteExtensionPath" -v q /p:BuildNumber=$buildNumber /p:IsPackable=false -c Release
173-
} else {
174-
# There are no preinstalled 'x64 .NET Core'/'x64 ASP.NET Core' on the stamp so we we need to build self-contained package for x64.
175-
dotnet publish .\src\WebJobs.Script.WebHost\WebJobs.Script.WebHost.csproj -r $runtime -o "$privateSiteExtensionPath" -v q /p:BuildNumber=$buildNumber /p:IsPackable=false -c Release
176-
}
162+
dotnet publish .\src\WebJobs.Script.WebHost\WebJobs.Script.WebHost.csproj -o "$privateSiteExtensionPath" -v q /p:BuildNumber=$buildNumber /p:IsPackable=false -c Release
177163

178164
# replace IL dlls with crossgen dlls
179165
if (![string]::IsNullOrEmpty($runtime)) {
@@ -198,27 +184,11 @@ function CreateZips([string] $runtimeSuffix) {
198184
# Project cleanup (trim some project files - this should be revisited)
199185
cleanExtension ""
200186

201-
# Prepare private "no-runtime" with custom xdt
202-
$currentXdtPath = "$privateSiteExtensionPath\applicationHost.xdt"
203-
$tempXdtDir = "$buildOutput\xdt-temp"
204-
$tempPublicXdtPath = "$tempXdtDir\applicationHost-public.xdt"
205187

206-
# Make a temp location
207-
New-Item -Itemtype directory -path $tempXdtDir -ErrorAction SilentlyContinue
208-
209-
# Move the current (public) xdt to the temp location
210-
Move-Item $currentXdtPath $tempPublicXdtPath
211-
212-
# Drop in the private XDT
213-
Copy-Item .\src\WebJobs.Script.WebHost\applicationHost-private.xdt $currentXdtPath
214188

215189
# Make the zip
216190
ZipContent $publishTarget "$buildOutput\Functions.Private.$extensionVersion$runtimeSuffix.zip"
217191

218-
# Restore the public XDT
219-
Move-Item $tempPublicXdtPath $currentXdtPath -Force
220-
221-
Remove-Item $tempXdtDir -Recurse
222192
} else {
223193
# Project cleanup (trim some project files - this should be revisited)
224194
cleanExtension "32bit"

src/WebJobs.Script.WebHost/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public static IWebHost BuildWebHost(string[] args)
4040
public static IWebHostBuilder CreateWebHostBuilder(string[] args = null)
4141
{
4242
return AspNetCore.WebHost.CreateDefaultBuilder(args)
43-
.UseKestrel(o =>
43+
.ConfigureKestrel(o =>
4444
{
4545
o.Limits.MaxRequestBodySize = 104857600;
4646
})

src/WebJobs.Script.WebHost/Properties/PublishProfiles/FolderProfile.pubxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ by editing this MSBuild file. In order to learn more about this please visit htt
1515
<ProjectGuid>d5162088-c119-4a06-896d-e65983caedfd</ProjectGuid>
1616
<publishUrl>bin\Release\SiteExtensions\Functions</publishUrl>
1717
<DeleteExistingFiles>False</DeleteExistingFiles>
18-
<TargetFramework>netcoreapp2.1</TargetFramework>
18+
<TargetFramework>netcoreapp2.2</TargetFramework>
1919
</PropertyGroup>
2020
</Project>

src/WebJobs.Script.WebHost/WebJobs.Script.WebHost.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22
<Import Project="..\..\build\common.props" />
33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.1</TargetFramework>
4+
<TargetFramework>netcoreapp2.2</TargetFramework>
55
<AssemblyName>Microsoft.Azure.WebJobs.Script.WebHost</AssemblyName>
66
<RootNamespace>Microsoft.Azure.WebJobs.Script.WebHost</RootNamespace>
77
<PackageId>Microsoft.Azure.WebJobs.Script.WebHost</PackageId>
88
<IsPackable Condition="'$(IsPackable)' != ''">true</IsPackable>
9+
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
910
</PropertyGroup>
1011
<PropertyGroup>
1112
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@@ -49,9 +50,8 @@
4950
</ItemGroup>
5051

5152
<ItemGroup>
52-
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.6" />
53+
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.0" />
5354
<PackageReference Include="Microsoft.Azure.AppService.Proxy.Client" Version="2.0.6830001-df202c6c" />
54-
<PackageReference Include="Microsoft.AspNetCore.Server.IIS" Version="2.1.0-a-oob-2-1-oob-17297" />
5555
<PackageReference Include="Microsoft.Azure.WebJobs.Host.Storage" Version="3.0.3" />
5656
<PackageReference Include="Microsoft.Azure.WebJobs.Logging" Version="3.0.3" />
5757
<PackageReference Include="Microsoft.Azure.WebSites.DataProtection" Version="2.1.88-alpha" />

src/WebJobs.Script.WebHost/applicationHost-private.xdt

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

src/WebJobs.Script.WebHost/applicationHost.xdt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,4 @@
1010
</site>
1111
</sites>
1212
</system.applicationHost>
13-
<system.webServer>
14-
<globalModules>
15-
<add name="AspNetCoreModuleV2" xdt:Locator="Match(name)" xdt:Transform="Remove" />
16-
<add name="AspNetCoreModuleV2" image="%XDT_EXTENSIONPATH%\%XDT_BITNESS%\ancm\aspnetcoreV2.dll" xdt:Transform="Insert" />
17-
</globalModules>
18-
</system.webServer>
19-
<location path="" xdt:Locator="Match(path)">
20-
<system.webServer>
21-
<modules>
22-
<add name="AspNetCoreModuleV2" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" lockItem="true" />
23-
</modules>
24-
</system.webServer>
25-
</location>
2613
</configuration>

src/WebJobs.Script.WebHost/web.InProcess.win-x64.xdt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
<handlers>
55
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" xdt:Transform="Replace" xdt:Locator="Match(name)" />
66
</handlers>
7-
<aspNetCore processPath=".\Microsoft.Azure.WebJobs.Script.WebHost.exe" arguments="" stdoutLogEnabled="false" hostingModel="inprocess" xdt:Transform="Replace" />
7+
<aspNetCore processPath="D:\Program Files\dotnet\dotnet.exe" arguments=".\Microsoft.Azure.WebJobs.Script.WebHost.dll" stdoutLogEnabled="false" hostingModel="inprocess" xdt:Transform="Replace" />
88
</system.webServer>
99
</configuration>

src/WebJobs.Script.WebHost/web.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<system.webServer>
77
<handlers>
88
<remove name="aspNetCore"/>
9-
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
9+
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified"/>
1010
</handlers>
1111
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" />
1212
<security>

test/WebJobs.Script.Scaling.Tests/WebJobs.Script.Scaling.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<Import Project="..\..\build\common.props" />
33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.1</TargetFramework>
4+
<TargetFramework>netcoreapp2.2</TargetFramework>
55
<IsPackable>false</IsPackable>
66
<AssemblyName>Microsoft.Azure.WebJobs.Script.Scaling.Tests</AssemblyName>
77
<RootNamespace>Microsoft.Azure.WebJobs.Script.Scaling.Tests</RootNamespace>

0 commit comments

Comments
 (0)