Skip to content

Commit f3c276f

Browse files
committed
Merge commit '0ab835c0b27280b87db4385740107bf878f1c491' into release/5.0-preview5
2 parents c39954c + 0ab835c commit f3c276f

File tree

1,762 files changed

+190811
-19316
lines changed

Some content is hidden

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

1,762 files changed

+190811
-19316
lines changed

.config/dotnet-tools.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
"isRoot": true,
44
"tools": {
55
"coverlet.console": {
6-
"version": "1.7.0",
6+
"version": "1.7.1",
77
"commands": [
88
"coverlet"
99
]
1010
},
1111
"dotnet-reportgenerator-globaltool": {
12-
"version": "4.5.2",
12+
"version": "4.5.8",
1313
"commands": [
1414
"reportgenerator"
1515
]
1616
},
1717
"microsoft.dotnet.xharness.cli": {
18-
"version": "1.0.0-prerelease.20214.1",
18+
"version": "1.0.0-prerelease.20254.3",
1919
"commands": [
2020
"xharness"
2121
]

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ indent_brace_style = Allman
165165
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}]
166166
indent_size = 2
167167

168+
[*.{csproj,vbproj,proj,nativeproj,locproj}]
169+
charset = utf-8
170+
168171
# Xml build files
169172
[*.builds]
170173
indent_size = 2

Build.proj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
<!-- Upfront restore hooks -->
3030
<Import Project="$(RepositoryEngineeringDir)restore\docs.targets" Condition="'$(DotNetBuildFromSource)' != 'true'" />
3131
<Import Project="$(RepositoryEngineeringDir)restore\optimizationData.targets" Condition="'$(DotNetBuildFromSource)' != 'true' and '$(EnableNgenOptimization)' == 'true'" />
32-
<Import Project="$(RepositoryEngineeringDir)restore\runtimeprops.targets" />
3332

3433
<!--
3534
Use synthetic inputs/outputs to avoid building it all the time. This should let devs build with

Directory.Build.props

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
<InstallerTasksOutputPath>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'installer.tasks'))</InstallerTasksOutputPath>
4242
<InstallerTasksAssemblyPath Condition="'$(MSBuildRuntimeType)' == 'Core'">$([MSBuild]::NormalizePath('$(InstallerTasksOutputPath)', 'Debug', 'netstandard2.0', 'installer.tasks.dll'))</InstallerTasksAssemblyPath>
4343
<InstallerTasksAssemblyPath Condition="'$(MSBuildRuntimeType)' != 'Core'">$([MSBuild]::NormalizePath('$(InstallerTasksOutputPath)', 'Debug', 'net46', 'installer.tasks.dll'))</InstallerTasksAssemblyPath>
44-
<HostMachineInfoProps>$(ArtifactsObjDir)HostMachineInfo.props</HostMachineInfoProps>
4544

4645
<DocsDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'docs'))</DocsDir>
4746
<ManPagesDir>$([MSBuild]::NormalizeDirectory('$(DocsDir)', 'manpages'))</ManPagesDir>
@@ -76,9 +75,6 @@
7675
<!-- Language configuration -->
7776
<PropertyGroup>
7877
<Deterministic>true</Deterministic>
79-
80-
<!-- Resource naming bug: https://github.com/microsoft/msbuild/issues/4740 -->
81-
<EmbeddedResourceUseDependentUponConvention>false</EmbeddedResourceUseDependentUponConvention>
8278
</PropertyGroup>
8379

8480
<PropertyGroup>

Directory.Build.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@
2626
<LangVersion>preview</LangVersion>
2727
<LangVersion Condition="'$(Language)' == 'VB'">latest</LangVersion>
2828
</PropertyGroup>
29+
2930
</Project>

build.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ setlocal
44
set _args=%*
55
if "%~1"=="-?" set _args=-help
66

7-
powershell -ExecutionPolicy ByPass -NoProfile -Command "%~dp0eng\build.ps1" %_args%
7+
powershell -ExecutionPolicy ByPass -NoProfile -Command "& '%~dp0eng\build.ps1'" %_args%
88
exit /b %ERRORLEVEL%

docs/coding-guidelines/adding-api-guidelines.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ the implementation without compat concerns in future releases.
2424

2525
### Determine target framework
2626

27-
`netcoreapp5.0` is the target framework version currently under development and the new apis
28-
should be added to `netcoreapp5.0`. [More Information on TargetFrameworks](https://docs.microsoft.com/en-us/dotnet/standard/frameworks)
27+
`net5.0` is the target framework version currently under development and the new apis
28+
should be added to `net5.0`. [More Information on TargetFrameworks](https://docs.microsoft.com/en-us/dotnet/standard/frameworks)
2929

3030
## Making the changes in repo
3131

docs/coding-guidelines/api-guidelines/nullability.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ The C# compiler respects a set of attributes that impact its flow analysis. We
9494
- **DO** annotate `ref` arguments that guarantee the argument will be non-`null` upon exit (e.g. lazy initialization helpers) with `[NotNull]`.
9595
- **DO** annotate properties where a getter will never return `null` but a setter allows `null` as being non-nullable but also `[AllowNull]`.
9696
- **DO** annotate properties where a getter may return `null` but a setter throws for `null` as being nullable but also `[DisallowNull]`.
97+
- **DO** add `[NotNullWhen(true)]` to nullable arguments of `Try` methods that will definitively be non-`null` if the method returns `true`. For example, if `Int32.TryParse(string? s)` returns `true`, `s` is known to not be `null`, and so the method should be `public static bool TryParse([NotNullWhen(true)] string? s, out int result)`.
9798

9899
## Code Review Guidance
99100

docs/coding-guidelines/interop-guidelines.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ Guidelines for shim C++ API:
178178
- If an export point has a 1:1 correspondence to the platform API, then name it after the platform API in PascalCase (e.g. stat -> Stat, fstat -> FStat).
179179
- If an export is not 1:1, then spell things out as we typically would in dotnet/runtime code (i.e. don't use abbreviations unless they come from the underlying API.
180180
- At first, it seemed that we'd want to use 1:1 names throughout, but it turns out there are many cases where being strictly 1:1 isn't practical.
181-
- In order to reduce the chance of collisions when linking with CoreRT, all exports should have a prefix that corresponds to the Libraries' name, e.g. "SystemNative_" or "CryptoNative_" to make the method name more unique. See https://github.com/dotnet/corefx/issues/4818.
181+
- In order to reduce the chance of collisions when linking with CoreRT, all exports should have a prefix that corresponds to the Libraries' name, e.g. "SystemNative_" or "CryptoNative_" to make the method name more unique. See https://github.com/dotnet/runtime/issues/15854.
182182
- Stick to data types which are guaranteed not to vary in size across flavors.
183183
- Use int32_t, int64_t, etc. from stdint.h and not int, long, etc.
184184
- Use char* for ASCII or UTF-8 strings and uint8_t* for byte buffers.

docs/coding-guidelines/project-guidelines.md

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Below is a list of all the various options we pivot the project builds on:
2828
## Individual build properties
2929
The following are the properties associated with each build pivot
3030

31-
- `$(BuildTargetFramework) -> netstandard2.1 | netcoreapp5.0 | net472`
31+
- `$(BuildTargetFramework) -> netstandard2.1 | net5.0 | net472`
3232
- `$(TargetOS) -> Windows | Linux | OSX | FreeBSD | [defaults to running OS when empty]`
3333
- `$(Configuration) -> Release | [defaults to Debug when empty]`
3434
- `$(TargetArchitecture) - x86 | x64 | arm | arm64 | [defaults to x64 when empty]`
@@ -82,7 +82,7 @@ When we have a project that has a `netstandard2.0` target framework that means t
8282
A full or individual project build is centered around BuildTargetFramework, TargetOS, Configuration and TargetArchitecture.
8383

8484
1. `$(BuildTargetFramework), $(TargetOS), $(Configuration), $(TargetArchitecture)` can individually be passed in to change the default values.
85-
2. If nothing is passed to the build then we will default value of these properties from the environment. Example: `netcoreapp5.0-[TargetOS Running On]-Debug-x64`.
85+
2. If nothing is passed to the build then we will default value of these properties from the environment. Example: `net5.0-[TargetOS Running On]-Debug-x64`.
8686
3. While Building an individual project from the VS, we build the project for all latest netcoreapp target frameworks.
8787

8888
We also have `RuntimeOS` which can be passed to customize the specific OS and version needed for native package builds as well as package restoration. If not passed it will default based on the OS you are running on.
@@ -97,6 +97,46 @@ When building an individual project the `BuildTargetFramework` and `TargetOS` wi
9797
- .NET Framework latest -> `$(NetFrameworkCurrent)-Windows_NT`
9898

9999
# Library project guidelines
100+
101+
## TargetFramework conditions
102+
`TargetFramework` conditions should be avoided in the first PropertyGroup as that causes DesignTimeBuild issues: https://github.com/dotnet/project-system/issues/6143
103+
104+
1. Use an equality check if the TargetFramework isn't overloaded with the OS portion.
105+
Example:
106+
```
107+
<PropertyGroup>
108+
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
109+
</PropertyGroup>
110+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">...</ItemGroup>
111+
```
112+
2. Use a StartsWith when you want to test for multiple .NETStandard or .NETFramework versions.
113+
Example:
114+
```
115+
<PropertyGroup>
116+
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
117+
</PropertyGroup>
118+
<ItemGroup Condition="$(TargetFramework.StartsWith('netstandard'))>...</ItemGroup>
119+
```
120+
3. Use a StartsWith if the TargetFramework is overloaded with the OS portion.
121+
Example:
122+
```
123+
<PropertyGroup>
124+
<TargetFrameworks>netstandard2.0-Windows_NT;netstandard2.0-Unix</TargetFrameworks>
125+
</PropertyGroup>
126+
<ItemGroup Condition="$(TargetFramework.StartsWith('netstandard2.0'))>...</ItemGroup>
127+
```
128+
4. Use negations if that makes the conditions easier.
129+
Example:
130+
```
131+
<PropertyGroup>
132+
<TargetFrameworks>netstandard2.0;net461;net472;net5.0</TargetFrameworks>
133+
</PropertyGroup>
134+
<ItemGroup Condition="!$(TargetFramework.StartsWith('net4'))>...</ItemGroup>
135+
<ItemGroup Condition="'$(TargetFramework)' != 'netstandard2.0'">...</ItemGroup>
136+
```
137+
138+
## Directory layout
139+
100140
Library projects should use the following directory layout.
101141

102142
```
@@ -121,7 +161,7 @@ The output for the ref project build will be a flat targeting pack folder in the
121161
## src
122162
In the src directory for a library there should be only **one** `.csproj` file that contains any information necessary to build the library in various target frameworks. All supported target frameworks should be listed in the `TargetFrameworks` property.
123163

124-
All libraries should use `<Reference Include="..." />` for all their project references. That will cause them to be resolved against a targeting pack (i.e. `bin\ref\netcoreapp5.0` or `\bin\ref\netstanard2.0`) based on the project target framework. There should not be any direct project references to other libraries. The only exception to that rule right now is for partial facades which directly reference System.Private.CoreLib and thus need to directly reference other partial facades to avoid type conflicts.
164+
All libraries should use `<Reference Include="..." />` for all their project references. That will cause them to be resolved against a targeting pack (i.e. `bin\ref\net5.0` or `\bin\ref\netstanard2.0`) based on the project target framework. There should not be any direct project references to other libraries. The only exception to that rule right now is for partial facades which directly reference System.Private.CoreLib and thus need to directly reference other partial facades to avoid type conflicts.
125165
<BR>//**CONSIDER**: just using Reference and use a reference to System.Private.CoreLib as a trigger to turn the other References into a ProjectReference automatically. That will allow us to have consistency where all projects just use Reference.
126166

127167
### src output

0 commit comments

Comments
 (0)