Skip to content

Commit 85ae18c

Browse files
authored
Make Visual Studio 2019 a prerequisite to building this repo (#7005)
Changes: * Make Visual Studio 2019 a prerequisite for building this repo * Update .sln files * Update Windows SDK to 17134 * Update developer docs * Disable ANCM tests * Update to .NET Core SDK 3.0 Preview 2 * Use Microsoft.NET.Sdk.Razor as a package consistently accross the repo * React to changes in metadata from Microsoft.NETCore.App * React to changes in .NET Core SDK * Attempt to workaround CodeCheck.ps1 failure which doesn't repro locally or on different agents. Possibly due to differences in the version of the PowerShell task? * Remove dead YML file * Rename usages of win7-{x64,x86} to win-{x64,x86} * Update KoreBuild to 3.0.0-build-20190219.1
1 parent 3a785e0 commit 85ae18c

File tree

133 files changed

+353
-368
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+353
-368
lines changed

.azure/pipelines/ci.yml

+18-36
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,16 @@ pr:
2020
- '*'
2121

2222
jobs:
23-
- job: Code_check
24-
displayName: Code check
25-
workspace:
26-
clean: all
27-
pool:
28-
vmImage: vs2017-win2016
29-
steps:
30-
- powershell: ./eng/scripts/CodeCheck.ps1 -ci
31-
displayName: Run eng/scripts/CodeCheck.ps1
23+
- template: jobs/default-build.yml
24+
parameters:
25+
jobName: Code_check
26+
jobDisplayName: Code check
27+
agentOs: Windows
28+
installJdk: false
29+
installNodeJs: false
30+
steps:
31+
- powershell: ./eng/scripts/CodeCheck.ps1 -ci
32+
displayName: Run eng/scripts/CodeCheck.ps1
3233

3334
# Build Windows (x64/x86)
3435
- template: jobs/default-build.yml
@@ -37,7 +38,7 @@ jobs:
3738
jobName: Windows_build
3839
jobDisplayName: "Build: Windows x64/x86"
3940
agentOs: Windows
40-
buildSteps:
41+
steps:
4142
- script: "echo ##vso[build.addbuildtag]daily-build"
4243
condition: and(ne(variables['Build.Reason'], 'PullRequest'), ne(variables['IsFinalBuild'], 'true'))
4344
displayName: 'Set CI tags'
@@ -56,7 +57,7 @@ jobs:
5657

5758
# Build the x86 shared framework
5859
# Set DisableSignCheck because we'll run sign check in an explicit step after installers build
59-
- script: ./eng/scripts/cibuild.cmd -arch x86 /t:BuildSharedFx /p:DisableCodeSigning=true /bl:artifacts/logs/build.x86.binlog
60+
- script: ./eng/scripts/cibuild.cmd -arch x86 -NoRestore /t:BuildSharedFx /p:DisableCodeSigning=true /bl:artifacts/logs/build.x86.binlog
6061
displayName: Build x86
6162

6263
# This is in a separate build step with -forceCoreMsbuild to workaround MAX_PATH limitations - https://github.com/Microsoft/msbuild/issues/53
@@ -66,15 +67,15 @@ jobs:
6667
# This runs code-signing on all packages, zips, and jar files as defined in build/CodeSign.targets. If https://github.com/dotnet/arcade/issues/1957 is resolved,
6768
# consider running code-signing inline with the other previous steps.
6869
# Sign check is disabled because it is run in a separate step below, after installers are built.
69-
- script: ./build.cmd -ci -sign /t:CodeSign /p:SignType=$(_SignType) /p:DisableSignCheck=true /bl:artifacts/logs/build.codesign.binlog
70+
- script: ./build.cmd -ci -sign -NoRestore /t:CodeSign /p:SignType=$(_SignType) /p:DisableSignCheck=true /bl:artifacts/logs/build.codesign.binlog
7071
displayName: Code sign packages
7172

7273
# Windows installers bundle both x86 and x64 assets
7374
- powershell: ./src/Installers/Windows/build.ps1 -ci /p:SignType=$(_SignType)
7475
displayName: Build Installers
7576

7677
# Run sign check to verify everything was code signed.
77-
- script: ./build.cmd -ci -sign /t:SignCheck /p:SignType=$(_SignType) /bl:artifacts/logs/build.signcheck.binlog
78+
- script: ./build.cmd -ci -sign -NoRestore /t:SignCheck /p:SignType=$(_SignType) /bl:artifacts/logs/build.signcheck.binlog
7879
displayName: Run sign check
7980
condition: eq(variables['_SignType'], 'real')
8081

@@ -102,8 +103,8 @@ jobs:
102103
jobName: Windows_arm_build
103104
jobDisplayName: "Build: Windows ARM"
104105
agentOs: Windows
105-
buildScript: ./eng/scripts/cibuild.cmd -NoBuildNodeJS -NoBuildJava
106-
buildArgs: -arch arm /p:SignType=$(_SignType)
106+
buildScript: ./eng/scripts/cibuild.cmd
107+
buildArgs: -arch arm -NoBuildNodeJS -NoBuildJava /p:SignType=$(_SignType)
107108
installNodeJs: false
108109
installJdk: false
109110
afterBuild:
@@ -156,7 +157,7 @@ jobs:
156157
jobDisplayName: "Build: Linux x64"
157158
agentOs: Linux
158159
installNodeJs: false
159-
buildSteps:
160+
steps:
160161
- script: ./eng/scripts/cibuild.sh --arch x64 --no-build-nodejs --no-build-java
161162
displayName: Run cibuild.sh
162163
- script: |
@@ -166,6 +167,7 @@ jobs:
166167
--ci --pack --all --no-build-nodejs --no-build-java \
167168
--arch x64 \
168169
-e KOREBUILD_SKIP_INSTALL_NETFX=0 \
170+
--no-restore \
169171
/t:BuildSharedFx \
170172
/p:BuildRuntimeArchive=false \
171173
/p:LinuxInstallerType=deb
@@ -330,23 +332,3 @@ jobs:
330332
- name: Linux_Test_Logs
331333
path: artifacts/logs/
332334
publishOnError: true
333-
- template: jobs/iisintegration-job.yml
334-
parameters:
335-
condition: ne(variables['SkipTests'], 'true')
336-
TestGroupName: IIS
337-
skipArgs: " /p:SkipIISBackwardsCompatibilityTests=true /p:SkipIISTests=false /p:SkipIISExpressTests=true /p:SkipIISForwardsCompatibilityTests=true"
338-
- template: jobs/iisintegration-job.yml
339-
parameters:
340-
condition: ne(variables['SkipTests'], 'true')
341-
TestGroupName: IISExpress
342-
skipArgs: "/p:SkipIISBackwardsCompatibilityTests=true /p:SkipIISTests=true /p:SkipIISExpressTests=false /p:SkipIISForwardsCompatibilityTests=true"
343-
- template: jobs/iisintegration-job.yml
344-
parameters:
345-
condition: ne(variables['SkipTests'], 'true')
346-
TestGroupName: IISForwardCompat
347-
skipArgs: "/p:SkipIISBackwardsCompatibilityTests=true /p:SkipIISTests=true /p:SkipIISExpressTests=true /p:SkipIISForwardsCompatibilityTests=false"
348-
- template: jobs/iisintegration-job.yml
349-
parameters:
350-
condition: ne(variables['SkipTests'], 'true')
351-
TestGroupName: IISBackCompat
352-
skipArgs: "/p:SkipIISBackwardsCompatibilityTests=false /p:SkipIISTests=true /p:SkipIISExpressTests=true /p:SkipIISForwardsCompatibilityTests=true"

.azure/pipelines/helix-test.yml

+13-18
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,16 @@ pr:
88
- '*'
99

1010
jobs:
11-
- job: Helix
12-
timeoutInMinutes: 240
13-
pool:
14-
name: Hosted VS2017
15-
vmImage: vs2017-win2016
16-
steps:
17-
- checkout: self
18-
clean: true
19-
- script: .\build.cmd -all -ci /t:Helix /p:IsHelixJob=true /bl:$env:BUILD_SOURCESDIRECTORY\artifacts\log\SendToHelix.binlog
20-
displayName: Run build.cmd helix target
21-
- task: PublishBuildArtifacts@1
22-
displayName: Publish Logs to VSTS
23-
inputs:
24-
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log'
25-
PublishLocation: Container
26-
ArtifactName: $(Agent.Os)_$(Agent.JobName)
27-
continueOnError: true
28-
condition: always()
11+
- template: jobs/default-build.yml
12+
parameters:
13+
jobName: Helix
14+
jobDisplayName: 'Tests: Helix'
15+
agentOs: Windows
16+
timeoutInMinutes: 240
17+
steps:
18+
- script: .\build.cmd -all -ci /t:Helix /p:IsHelixJob=true /bl:$env:BUILD_SOURCESDIRECTORY\artifacts\logs\SendToHelix.binlog
19+
displayName: Run build.cmd helix target
20+
artifacts:
21+
- name: Helix_logs
22+
path: artifacts/logs/
23+
publishOnError: true

.azure/pipelines/jobs/default-build.yml

+9-8
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# Note: -ci is always passed
1515
# beforeBuild: [steps]
1616
# Additional steps to run before build.sh/cmd
17-
# buildSteps: [steps]
17+
# steps: [steps]
1818
# Instead of running build.cmd/sh, run these build steps.
1919
# afterBuild: [steps]
2020
# Additional steps to run after build.sh/cmd
@@ -50,7 +50,7 @@ parameters:
5050
buildArgs: ''
5151
configuration: 'Release'
5252
beforeBuild: []
53-
# buildSteps: [] don't define an empty object default because there is no way in template expression yet to check "if isEmpty(parameters.buildSteps)"
53+
# steps: [] don't define an empty object default because there is no way in template expression yet to check "if isEmpty(parameters.steps)"
5454
afterBuild: []
5555
codeSign: false
5656
variables: {}
@@ -64,14 +64,15 @@ parameters:
6464
buildScript: ''
6565
installNodeJs: true
6666
installJdk: true
67+
timeoutInMinutes: 120
6768

6869
jobs:
6970
- job: ${{ coalesce(parameters.jobName, parameters.agentOs) }}
7071
displayName: ${{ coalesce(parameters.jobDisplayName, parameters.agentOs) }}
7172
dependsOn: ${{ parameters.dependsOn }}
7273
${{ if ne(parameters.condition, '') }}:
7374
condition: ${{ parameters.condition }}
74-
timeoutInMinutes: 120
75+
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
7576
workspace:
7677
clean: all
7778
strategy:
@@ -91,9 +92,9 @@ jobs:
9192
name: ${{ parameters.poolName }}
9293
${{ if and(eq(parameters.poolName, ''), eq(parameters.agentOs, 'Windows')) }}:
9394
${{ if eq(variables['System.TeamProject'], 'internal') }}:
94-
name: dotnet-internal-temp
95+
name: dotnet-internal-vs2019-preview
9596
${{ if ne(variables['System.TeamProject'], 'internal') }}:
96-
name: dotnet-external-temp
97+
name: dotnet-external-vs2019-preview
9798
variables:
9899
AgentOsName: ${{ parameters.agentOs }}
99100
ASPNETCORE_TEST_LOG_MAXPATH: "200" # Keep test log file name length low enough for artifact zipping
@@ -132,9 +133,9 @@ jobs:
132133

133134
- ${{ parameters.beforeBuild }}
134135

135-
- ${{ if ne(parameters.buildSteps, '')}}:
136-
- ${{ parameters.buildSteps }}
137-
- ${{ if eq(parameters.buildSteps, '')}}:
136+
- ${{ if ne(parameters.steps, '')}}:
137+
- ${{ parameters.steps }}
138+
- ${{ if eq(parameters.steps, '')}}:
138139
- ${{ if eq(parameters.buildScript, '') }}:
139140
- ${{ if eq(parameters.agentOs, 'Windows') }}:
140141
- script: .\$(BuildDirectory)\build.cmd -ci /p:SignType=$(_SignType) /p:Configuration=$(BuildConfiguration) $(BuildScriptArgs)

.azure/pipelines/jobs/iisintegration-job.yml

-20
This file was deleted.

Directory.Build.props

+1
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@
176176
<TargetingPackLayoutRoot>$(ArtifactsObjDir)TargetingPack.Layout\$(Configuration)\</TargetingPackLayoutRoot>
177177
</PropertyGroup>
178178

179+
<Import Project="eng\Workarounds.props" />
179180
<Import Project="eng\Dependencies.props" />
180181
<Import Project="eng\PatchConfig.props" />
181182
<Import Project="eng\ProjectReferences.props" />

Directory.Build.targets

+19
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
<SuppressDependenciesWhenPacking Condition="'$(SuppressDependenciesWhenPacking)' == '' AND '$(IsAnalyzersProject)' == 'true'">true</SuppressDependenciesWhenPacking>
1616
</PropertyGroup>
1717

18+
<PropertyGroup Condition="'$(PackAsTool)' == 'true' AND '$(IsShippingPackage)' == 'true'">
19+
<!-- This is a requirement for Microsoft tool packages only. -->
20+
<PackAsToolShimRuntimeIdentifiers>win-x64;win-x86</PackAsToolShimRuntimeIdentifiers>
21+
</PropertyGroup>
22+
1823
<PropertyGroup Condition=" '$(MSBuildProjectExtension)' == '.csproj' ">
1924
<PackageId Condition=" '$(PackageId)' == '' ">$(AssemblyName)</PackageId>
2025
<IsPackable Condition="'$(IsPackable)' == '' AND ( '$(IsTestProject)' == 'true' OR '$(IsTestAssetProject)' == 'true' OR '$(IsBenchmarkProject)' == 'true' OR '$(IsSampleProject)' == 'true' ) ">false</IsPackable>
@@ -67,6 +72,20 @@
6772
<BuildHelixPayload Condition="'$(BuildHelixPayload)' == '' AND '$(IsTestProject)' == 'true'">true</BuildHelixPayload>
6873
</PropertyGroup>
6974

75+
<ItemGroup>
76+
<KnownFrameworkReference Update="Microsoft.NETCore.App">
77+
<LatestRuntimeFrameworkVersion>$(MicrosoftNETCoreAppPackageVersion)</LatestRuntimeFrameworkVersion>
78+
<DefaultRuntimeFrameworkVersion Condition="'$(IsServicingBuild)' != 'true'">$(MicrosoftNETCoreAppPackageVersion)</DefaultRuntimeFrameworkVersion>
79+
<TargetingPackVersion Condition="'$(IsServicingBuild)' != 'true'">$(MicrosoftNETCoreAppPackageVersion)</TargetingPackVersion>
80+
</KnownFrameworkReference>
81+
82+
<KnownFrameworkReference Update="Microsoft.AspNetCore.App">
83+
<LatestRuntimeFrameworkVersion>$(SharedFxVersion)</LatestRuntimeFrameworkVersion>
84+
<DefaultRuntimeFrameworkVersion Condition="'$(IsServicingBuild)' != 'true'">$(SharedFxVersion)</DefaultRuntimeFrameworkVersion>
85+
<TargetingPackVersion Condition="'$(IsServicingBuild)' != 'true'">$(SharedFxVersion)</TargetingPackVersion>
86+
</KnownFrameworkReference>
87+
</ItemGroup>
88+
7089
<Import Project="eng\Workarounds.targets" />
7190
<Import Project="eng\targets\ResolveIisReferences.targets" Condition=" '$(MSBuildProjectExtension)' != '.vcxproj' " />
7291
<Import Project="eng\targets\Cpp.Common.targets" Condition="'$(MSBuildProjectExtension)' == '.vcxproj'" />

build.ps1

+4-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,10 @@ $RunRestore = if ($NoRestore) { $false }
291291
else { $true }
292292

293293
# Target selection
294-
$MSBuildArguments += "/p:_RunRestore=$RunRestore"
294+
if ($RunRestore) {
295+
$MSBuildArguments += "/restore"
296+
}
297+
295298
$MSBuildArguments += "/p:_RunBuild=$RunBuild"
296299
$MSBuildArguments += "/p:_RunPack=$Pack"
297300
$MSBuildArguments += "/p:_RunTests=$Test"

build.sh

+7-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ channel='master'
2020
tools_source='https://aspnetcore.blob.core.windows.net/buildtools'
2121
target_os_name=''
2222
ci=false
23-
run_restore=true
23+
run_restore=''
2424
run_build=true
2525
run_pack=false
2626
run_tests=false
@@ -190,7 +190,7 @@ while [[ $# -gt 0 ]]; do
190190
--no-build)
191191
run_build=false
192192
# --no-build implies --no-restore
193-
run_restore=false
193+
[ -z "$run_restore" ] && run_restore=false
194194
;;
195195
--no-build-deps)
196196
build_deps=false
@@ -313,7 +313,10 @@ fi
313313
[ ! -z "$build_nodejs" ] && msbuild_args[${#msbuild_args[*]}]="-p:BuildNodeJS=$build_nodejs"
314314
[ ! -z "$build_managed" ] && msbuild_args[${#msbuild_args[*]}]="-p:BuildManaged=$build_managed"
315315

316-
msbuild_args[${#msbuild_args[*]}]="-p:_RunRestore=$run_restore"
316+
# Run restore by default unless --no-restore or --no-build was specified.
317+
[ -z "$run_restore" ] && run_restore=true
318+
319+
[ "$run_restore" = true ] && msbuild_args[${#msbuild_args[*]}]="-restore"
317320
msbuild_args[${#msbuild_args[*]}]="-p:_RunBuild=$run_build"
318321
msbuild_args[${#msbuild_args[*]}]="-p:_RunPack=$run_pack"
319322
msbuild_args[${#msbuild_args[*]}]="-p:_RunTests=$run_tests"
@@ -324,6 +327,7 @@ msbuild_args[${#msbuild_args[*]}]="-p:TargetOsName=$target_os_name"
324327
# Disable downloading ref assemblies as a tarball. Use netfx refs from the Microsoft.NETFramework.ReferenceAssemblies NuGet package instead.
325328
[ -z "${KOREBUILD_SKIP_INSTALL_NETFX:-}" ] && KOREBUILD_SKIP_INSTALL_NETFX=1
326329

330+
export KOREBUILD_KEEPGLOBALJSON=1
327331
set_korebuildsettings "$tools_source" "$DOTNET_HOME" "$DIR" "$config_file" "$ci"
328332

329333
# This incantation avoids unbound variable issues if msbuild_args is empty

build/repo.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
<!-- Project selection can be overridden on the command line by passing in -projects -->
7878
<When Condition="'$(Projects)' != ''">
7979
<ItemGroup>
80-
<ProjectToBuild Include="$(Projects)" Exclude="@(ProjectToExclude)">
80+
<ProjectToBuild Include="$(Projects)" Exclude="@(ProjectToExclude);$(RepositoryRoot)**\bin\**\*;$(RepositoryRoot)**\obj\**\*">
8181
<RestoreInParallel Condition="'%(Extension)' == '.npmproj'">false</RestoreInParallel>
8282
</ProjectToBuild>
8383
</ItemGroup>

build/repo.targets

-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<!-- Reset the default korebuild lifecycle. -->
1111
<BuildDependsOn>Prepare</BuildDependsOn>
1212
<!-- Map bootstrapper flags to KoreBuild targets -->
13-
<BuildDependsOn Condition=" '$(_RunRestore)' == 'true' ">$(BuildDependsOn);Restore</BuildDependsOn>
1413
<BuildDependsOn Condition=" '$(_RunBuild)' == 'true' ">$(BuildDependsOn);Compile</BuildDependsOn>
1514
<BuildDependsOn Condition=" '$(_RunPack)' == 'true' ">$(BuildDependsOn);Package</BuildDependsOn>
1615
<BuildDependsOn Condition=" '$(_RunTests)' == 'true' ">$(BuildDependsOn);Test;Verify</BuildDependsOn>
@@ -22,7 +21,6 @@
2221
<RestoreDependsOn>$(RestoreDependsOn);InstallDotNet;RestoreProjects</RestoreDependsOn>
2322

2423
<CompileDependsOn />
25-
<CompileDependsOn Condition=" '$(_RunRestore)' == 'true' ">Restore</CompileDependsOn>
2624
<CompileDependsOn>$(CompileDependsOn);BuildProjects</CompileDependsOn>
2725

2826
<PackageDependsOn>$(PackageDependsOn);PackProjects</PackageDependsOn>

build/tasks/RepoTasks.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<Import Project="$(RepoTasksSdkPath)\Sdk.props" Condition="'$(RepoTasksSdkPath)' != '' "/>
33

44
<PropertyGroup>
5-
<TargetFramework Condition="'$(MSBuildRuntimeType)' == 'Core' ">netcoreapp2.2</TargetFramework>
6-
<TargetFramework Condition="'$(MSBuildRuntimeType)' != 'Core' ">net461</TargetFramework>
5+
<TargetFramework Condition="'$(MSBuildRuntimeType)' == 'Core' ">netcoreapp3.0</TargetFramework>
6+
<TargetFramework Condition="'$(MSBuildRuntimeType)' != 'Core' ">net472</TargetFramework>
77
<DefineConstants Condition="'$(BuildInstallers)' == 'true' AND '$(TargetOsName)' == 'win'">$(DefineConstants);BUILD_MSI_TASKS</DefineConstants>
88
<Optimize>false</Optimize>
99
<DebugType>embedded</DebugType>
@@ -12,7 +12,7 @@
1212

1313
<ItemGroup>
1414
<PackageReference Remove="Internal.AspNetCore.Sdk" />
15-
<PackageReference Include="NuGet.Build.Tasks" Version="4.9.1" />
15+
<PackageReference Include="NuGet.Build.Tasks" Version="4.9.3" />
1616
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.1.0" />
1717
</ItemGroup>
1818

build/tasks/tasks.sln

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.26124.0
5-
MinimumVisualStudioVersion = 15.0.26124.0
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.0.0
5+
MinimumVisualStudioVersion = 16.0.28608.199
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RepoTasks", "RepoTasks.csproj", "{A114791F-35B7-4E5B-8E5B-9A91E0B6E4AE}"
77
EndProject
88
Global

docs/BuildFromSource.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ See https://github.com/aspnet/AspNetCore/labels/area-infrastructure for known is
1111

1212
Building ASP.NET Core on Windows requires:
1313

14-
* Windows 7 or higher
14+
* Windows 10
1515
* At least 10 GB of disk space and a good internet connection (our build scripts download a lot of tools and dependencies)
16-
* Visual Studio 2017. <https://visualstudio.com>
17-
* To install the exact required components, run [eng/scripts/InstallVisualStudio.ps1](/eng/scripts/InstallVisualStudio.ps1). This will use VS2017.
16+
* Visual Studio **2019 Preview**. <https://visualstudio.com>
17+
* To install the exact required components, run [eng/scripts/InstallVisualStudio.ps1](/eng/scripts/InstallVisualStudio.ps1).
1818
```ps1
19-
PS> ./eng/scripts/InstallVisualStudio.ps1 -Edition Community
19+
PS> ./eng/scripts/InstallVisualStudio.ps1
2020
```
2121
* Git. <https://git-scm.org>
2222
* (Optional) some optional components, like the SignalR Java client, may require

0 commit comments

Comments
 (0)