diff options
147 files changed, 710 insertions, 495 deletions
diff --git a/Documentation/README.md b/Documentation/README.md index 1d778b9ea8..78dfd2ad23 100644 --- a/Documentation/README.md +++ b/Documentation/README.md @@ -46,12 +46,14 @@ Coding Guidelines - [Breaking Change Rules](coding-guidelines/breaking-change-rules.md) - [Project Guidelines](coding-guidelines/project-guidelines.md) - [Adding APIs Guidelines](coding-guidelines/adding-api-guidelines.md) +- [Legal Native calls](building/pinvoke-checker.md) Building from Source ==================== - [Building CoreFX on FreeBSD, Linux and OS X](building/unix-instructions.md) - [Code Coverage](building/code-coverage.md) +- [Cross Building](building/cross-building.md) - [Package and Assembly File Versioning](building/versioning.md) Other Information diff --git a/Documentation/building/pinvoke-checker.md b/Documentation/building/pinvoke-checker.md new file mode 100644 index 0000000000..98aa8788a3 --- /dev/null +++ b/Documentation/building/pinvoke-checker.md @@ -0,0 +1,39 @@ +# PInvoke Analyzer + +During the build of any product library in CoreFX we use a Roslyn code analyzer to look for disallowed native calls (PInvokes). When there is a violation, it will fail the build. To fix the build, either find an alternative to the PInvoke or baseline the failure temporarily. To baseline it, add the function name in the format `module!entrypoint` to a file named PInvokeAnalyzerExceptionList.analyzerdata in the same folder as the project. [Here](https://github.com/dotnet/corefx/blob/master/src/System.Diagnostics.Process/src/PInvokeAnalyzerExceptionList.analyzerdata) is an example. + +If you baseline a violation, please open an issue to fix it because the library likely cannot ship in this situation. It is better to not introduce the violation. We want to clean out any baselines. There are situations where a violation may be acceptable. One situation is where we are shipping the native implementation of the API. An example of this situation is `sni.dll` which is used by SqlClient. + +Each project is analyzed against one of two possible lists we maintain. + +## Legal UWP API's + +### Applies to +This applies to product libraries that are being built for use in a modern Windows app (aka UWP app, or app running on UAP). When building the `uapaot` or `uap` configurations we will apply this check. If the library does not have a `uap` or `uapaot` configuration explicitly listed in `Configuration.props` in the project folder, when targeting `uap` or `uapaot` we will build the `netstandard` configuration, and apply this check. + +We do not currently apply this check to test binaries. Although when testing UWP libraries the tests must run within a test app, they do not need to pass through the store validation process. It is still possible they may call an API that does not work correctly within an app's security boundary and that call would have to be avoided. + +### Motivation +Not all PInvokes are legal within a UWP app. An allow-list is enforced when the Windows store ingests an app, and also in a build step in the Visual Studio build process for apps. If we produce a library for UWP use, any PInvokes it performs must be to API's that are on the allow-list or the app using the library will fail validation. + +### Implementation +To enforce this the analyzer consults the list [here](https://github.com/dotnet/buildtools/blob/master/src/Microsoft.DotNet.CodeAnalysis/PackageFiles/PinvokeAnalyzer_Win32UWPApis.txt). + +The analyzer is enabled by default in the configurations below by the setting of the MSBuild property `UWPCompatible`. We aim to make all our `netstandard` compliant libraries work within a UWP app, but in rare cases where a library cannot, the check can be disabled with `<UWPCompatible>false</UWPCompatible>` in the project file. + +There is also a more fine grained property `<EnablePInvokeUWPAnalyzer>false</EnablePInvokeUWPAnalyzer>` for temporary use. + +## Legal OneCore API's + +### Applies to +This applies to all other product libraries in all other configurations targeted at Windows. + +We do not currently apply this check to test binaries as they do not need to run on Windows Nano. + +### Motivation +.NET Core supports execution on Windows Nano, which has a reduced API surface area known as OneCore. To run on Windows Nano we cannot invoke any platform API that is not available on OneCore. + +### Implementation +To enforce this the analyzer consults the list [here](https://github.com/dotnet/buildtools/blob/master/src/Microsoft.DotNet.CodeAnalysis/PackageFiles/PinvokeAnalyzer_Win32Apis.txt). + +The analyzer is enabled by default when building for Windows, not a test, and not building for UWP. We aim to make all such configurations OneCore compilant, but in the rare cases where a library cannot be, the check can be disabled with `<EnablePInvokeAnalyzer>false<EnablePInvokeAnalyzer>` in the project file. diff --git a/Tools-Override/Build.Common.targets b/Tools-Override/Build.Common.targets index 90386aeed5..81fa0ff1ce 100644 --- a/Tools-Override/Build.Common.targets +++ b/Tools-Override/Build.Common.targets @@ -272,8 +272,8 @@ APIs in libraries that include this. The attribute can also be applied to individual public APIs to similarly block them. --> <PropertyGroup> - <BlockReflectionAttribute Condition="'$(BlockReflectionAttribute)'=='' and ('$(TargetGroup)'=='netcore50' or '$(TargetGroup)'=='netcore50aot')">true</BlockReflectionAttribute> - <BlockReflectionAttribute Condition="'$(MSBuildProjectExtension)' == '.vbproj'">false</BlockReflectionAttribute> + <BlockReflectionAttribute Condition="'$(BlockReflectionAttribute)' == '' and '$(UWPCompatible)' == 'true'">true</BlockReflectionAttribute> + <BlockReflectionAttribute Condition="'$(MSBuildProjectExtension)' != '.csproj'">false</BlockReflectionAttribute> </PropertyGroup> <PropertyGroup Condition="'$(BlockReflectionAttribute)'=='true'"> diff --git a/Tools-Override/codeAnalysis.targets b/Tools-Override/codeAnalysis.targets index 1080bd15c3..9c5aa1fb35 100644 --- a/Tools-Override/codeAnalysis.targets +++ b/Tools-Override/codeAnalysis.targets @@ -11,16 +11,12 @@ <!-- PInvokeChecker data files--> <PropertyGroup Condition="'$(OSGroup)'=='Windows_NT' and '$(EnableDotnetAnalyzers)' == 'true'"> - <!-- - This file helps us choose the correct allowed pinvoke file. - 1. In case we are building for windows and TargetGroup is Netcore50 or netcore50aot (Store profile) or SupportsUWP is set to true we use OneCoreUWPApis.txt - 2. For all other windows configuration we use OneCoreAPIs.txt file. - --> - <UseWin32Apis Condition="'$(OSGroup)'=='Windows_NT'">true</UseWin32Apis> - <ValidPinvokeMappings>$(MSBuildThisFileDirectory)PinvokeAnalyzer_OneCoreApis.txt</ValidPinvokeMappings> - <ValidPinvokeMappings Condition="'$(UseWin32Apis)'=='true'">$(MSBuildThisFileDirectory)PinvokeAnalyzer_Win32Apis.txt</ValidPinvokeMappings> - <ValidPinvokeMappings Condition="'$(TargetGroup)'=='netcore50' or '$(TargetGroup)'=='netcore50aot' or '$(SupportsUWP)'=='true'">$(MSBuildThisFileDirectory)PinvokeAnalyzer_UWPApis.txt</ValidPinvokeMappings> - <ValidPinvokeMappings Condition="('$(TargetGroup)'=='netcore50' or '$(TargetGroup)'=='netcore50aot' or '$(SupportsUWP)'=='true') and '$(UseWin32Apis)'=='true'">$(MSBuildThisFileDirectory)PinvokeAnalyzer_Win32UWPApis.txt</ValidPinvokeMappings> + <!-- Just validate for OneCore: default --> + <ValidPInvokeMappings>$(MSBuildThisFileDirectory)PinvokeAnalyzer_Win32Apis.txt</ValidPInvokeMappings> + + <!-- Further restrict to API allowed for UWP --> + <EnablePinvokeUWPAnalyzer Condition="'$(EnablePinvokeUWPAnalyzer)' == ''">true</EnablePinvokeUWPAnalyzer> + <ValidPInvokeMappings Condition="'$(UWPCompatible)'=='true' and '$(EnablePinvokeUWPAnalyzer)' == 'true'">$(MSBuildThisFileDirectory)PinvokeAnalyzer_Win32UWPApis.txt</ValidPInvokeMappings> </PropertyGroup> <PropertyGroup> @@ -35,6 +31,9 @@ <PropertyGroup Condition="$(EnableFxCopAnalyzers)"> <CodeAnalysisRuleSet Condition="'$(CodeAnalysisRuleSet)' == ''">$(MSBuildThisFileDirectory)Default.ruleset</CodeAnalysisRuleSet> </PropertyGroup> + <PropertyGroup> + <EnablePInvokeAnalyzer Condition="'$(EnablePInvokeAnalyzer)' == ''">true</EnablePInvokeAnalyzer> + </PropertyGroup> <ItemGroup Condition="'$(EnableDotnetAnalyzers)' == 'true'"> <!-- Enable the Microsoft.Dotnet.CodeAnalysis.dll analyzer --> <Analyzer Include="$(CodeAnalyzerDir)Microsoft.DotNet.CodeAnalysis.dll"/> @@ -43,11 +42,11 @@ <AdditionalFiles Include="$(MSBuildProjectDirectory)/*.analyzerdata.$(Platform)" /> <!-- Add the necessary valid Pinvoke mapping file --> - <AdditionalFiles Condition="'$(ValidPinvokeMappings)' != ''" Include="$(ValidPinvokeMappings)"/> + <AdditionalFiles Condition="'$(ValidPInvokeMappings)' != ''" Include="$(ValidPInvokeMappings)"/> <!-- Disable any analyzers that should not run --> - <DisabledAnalyzers Condition="'$(IsTestProject)' == true or '$(TargetsUnix)' == 'true'" Include="PinvokeAnalyzer"/> - <DisabledAnalyzers Condition="'$(TargetsWindows)'=='true' and ($(TargetGroup.Contains('net46')) or $(TargetGroup.Contains('net45')))" Include="PinvokeAnalyzer" /> + <DisabledAnalyzers Condition="'$(IsTestProject)' == 'true' or '$(TargetsUnix)' == 'true' or '$(EnablePInvokeAnalyzer)' != 'true'" Include="PInvokeAnalyzer"/> + <DisabledAnalyzers Condition="'$(TargetsWindows)'=='true' and ($(TargetGroup.Contains('net46')) or $(TargetGroup.Contains('net45')))" Include="PInvokeAnalyzer" /> </ItemGroup> <!-- If we have specified any analyzers that need to be disabled write them into the file --> @@ -70,16 +70,6 @@ <!-- Provides package dependency version properties and verification/auto-upgrade configuration --> <Import Project="$(MSBuildThisFileDirectory)dependencies.props" /> - <!-- Explicitly setting - - SupportsUWP to true when TargetGroup is uap101*. This will enable the correct pinvoke checker to be picked - - BlockReflectionAttribute to true. This will enable injecting BlockReflectionAttribute.cs into the compile target. - TODO: Both of these properties are being set in buildtools targets, however they need to be updated to reflect uap101 changes. - --> - <PropertyGroup Condition="'$(TargetGroup)' == 'uap101' or '$(TargetGroup)' == 'uap101aot'"> - <SupportsUWP>true</SupportsUWP> - <BlockReflectionAttribute>true</BlockReflectionAttribute> - </PropertyGroup> - <!-- list of nuget package sources passed to dnu --> <ItemGroup Condition="'$(ExcludeInternetFeeds)' != 'true'"> <!-- Example to consume local CoreCLR package: diff --git a/src/Common/src/Interop/Windows/BCrypt/Interop.BCryptExportKey.cs b/src/Common/src/Interop/Windows/BCrypt/Interop.BCryptExportKey.cs index 6c8c142453..2cca6a6552 100644 --- a/src/Common/src/Interop/Windows/BCrypt/Interop.BCryptExportKey.cs +++ b/src/Common/src/Interop/Windows/BCrypt/Interop.BCryptExportKey.cs @@ -12,7 +12,7 @@ internal partial class Interop { internal partial class BCrypt { -#if !NETNATIVE +#if !uap [DllImport(Libraries.BCrypt, CharSet = CharSet.Unicode)] internal static extern NTSTATUS BCryptExportKey(SafeBCryptKeyHandle hKey, IntPtr hExportKey, string pszBlobType, [Out] byte[] pbOutput, int cbOutput, out int pcbResult, int dwFlags); #endif diff --git a/src/Common/src/System/Security/Cryptography/ECDsaCng.cs b/src/Common/src/System/Security/Cryptography/ECDsaCng.cs index aedf289372..ea8e940443 100644 --- a/src/Common/src/System/Security/Cryptography/ECDsaCng.cs +++ b/src/Common/src/System/Security/Cryptography/ECDsaCng.cs @@ -13,7 +13,7 @@ namespace System.Security.Cryptography #endif public sealed partial class ECDsaCng : ECDsa { -#if !NETNATIVE +#if !uap /// <summary> /// Create an ECDsaCng algorithm with a named curve. /// </summary> diff --git a/src/Microsoft.Win32.Registry/src/Microsoft.Win32.Registry.csproj b/src/Microsoft.Win32.Registry/src/Microsoft.Win32.Registry.csproj index 7d6cf25c37..edb327bdee 100644 --- a/src/Microsoft.Win32.Registry/src/Microsoft.Win32.Registry.csproj +++ b/src/Microsoft.Win32.Registry/src/Microsoft.Win32.Registry.csproj @@ -8,6 +8,11 @@ <AllowUnsafeBlocks>true</AllowUnsafeBlocks> <DefineConstants>$(DefineConstants);REGISTRY_ASSEMBLY</DefineConstants> <IsPartialFacadeAssembly Condition="'$(TargetGroup)' == 'netfx'">true</IsPartialFacadeAssembly> + <!-- + Temporarily necessary as this is only being built for UWP due to an unwanted dependency on it + https://github.com/dotnet/corefx/issues/15966 + --> + <EnablePinvokeUWPAnalyzer>false</EnablePinvokeUWPAnalyzer> </PropertyGroup> <!-- Help VS understand available configurations --> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Debug|AnyCPU'" /> diff --git a/src/System.Collections.NonGeneric/src/System/Collections/SortedList.cs b/src/System.Collections.NonGeneric/src/System/Collections/SortedList.cs index 719ad86de5..ed5d97aa5b 100644 --- a/src/System.Collections.NonGeneric/src/System/Collections/SortedList.cs +++ b/src/System.Collections.NonGeneric/src/System/Collections/SortedList.cs @@ -60,9 +60,6 @@ namespace System.Collections // [DebuggerTypeProxy(typeof(System.Collections.SortedList.SortedListDebugView))] [DebuggerDisplay("Count = {Count}")] -#if FEATURE_CORECLR - [Obsolete("Non-generic collections have been deprecated. Please use collections in System.Collections.Generic.")] -#endif [Serializable] public class SortedList : IDictionary, ICloneable { diff --git a/src/System.Console/src/FxCopBaseline.cs b/src/System.Console/src/FxCopBaseline.cs index be75298ec3..c49b860f9b 100644 --- a/src/System.Console/src/FxCopBaseline.cs +++ b/src/System.Console/src/FxCopBaseline.cs @@ -47,3 +47,5 @@ using System.Diagnostics.CodeAnalysis; [assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.ConsolePal.#RefreshColors(System.ConsoleColor&,System.ConsoleColor)")] [assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.ConsolePal.#EnsureInitializedCore()")] [assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.ConsolePal.#WriteStdoutAnsiString(System.String)")] +[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.ConsolePal.#ForegroundColor")] +[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.ConsolePal.#BackgroundColor")]
\ No newline at end of file diff --git a/src/System.Console/src/PinvokeAnalyzerExceptionList.analyzerdata b/src/System.Console/src/PinvokeAnalyzerExceptionList.analyzerdata index d77f3f677c..f91af73582 100644 --- a/src/System.Console/src/PinvokeAnalyzerExceptionList.analyzerdata +++ b/src/System.Console/src/PinvokeAnalyzerExceptionList.analyzerdata @@ -1,2 +1 @@ -<!-- Not a bug, this API was recently added to the allowed list --> user32.dll!GetKeyState diff --git a/src/System.Console/src/System.Console.csproj b/src/System.Console/src/System.Console.csproj index 7f25143115..007ce3f991 100644 --- a/src/System.Console/src/System.Console.csproj +++ b/src/System.Console/src/System.Console.csproj @@ -33,13 +33,12 @@ <Link>Common\System\Text\ConsoleEncoding.cs</Link> </Compile> </ItemGroup> - <!-- Windows : UAP - <ItemGroup Condition="'$(TargetsWindows)' == 'true' And '$(TargetGroup)' == 'uap101aot' "> + <!-- Windows : UAP --> + <ItemGroup Condition="'$(TargetGroup)' == 'uap'"> <Compile Include="System\ConsolePal.Uap.cs" /> </ItemGroup> - --> <!-- Windows : Win32 --> - <ItemGroup Condition="'$(TargetsWindows)' == 'true'"> + <ItemGroup Condition="'$(TargetsWindows)' == 'true' and '$(TargetGroup)' != 'uap'"> <Compile Include="System\ConsolePal.Windows.cs" /> <Compile Include="$(CommonPath)\System\Text\OSEncoding.Windows.cs"> <Link>Common\System\Text\OSEncoding.Windows.cs</Link> diff --git a/src/System.Data.SqlClient/src/System.Data.SqlClient.csproj b/src/System.Data.SqlClient/src/System.Data.SqlClient.csproj index 3b101cdd12..fc1af56651 100644 --- a/src/System.Data.SqlClient/src/System.Data.SqlClient.csproj +++ b/src/System.Data.SqlClient/src/System.Data.SqlClient.csproj @@ -6,6 +6,8 @@ <AssemblyName>System.Data.SqlClient</AssemblyName> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> <IsPartialFacadeAssembly Condition="'$(TargetGroup)' == 'net463'">true</IsPartialFacadeAssembly> + <!-- Although we have a NS configuration, we know we use API that's not currently whitelisted: just validate against OneCore --> + <UWPCompatible>false</UWPCompatible> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Unix-Debug|AnyCPU'" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Unix-Release|AnyCPU'" /> diff --git a/src/System.Diagnostics.Process/src/PinvokeAnalyzerExceptionList.analyzerdata b/src/System.Diagnostics.Process/src/PinvokeAnalyzerExceptionList.analyzerdata index ead7918e45..c8cfbb4bf4 100644 --- a/src/System.Diagnostics.Process/src/PinvokeAnalyzerExceptionList.analyzerdata +++ b/src/System.Diagnostics.Process/src/PinvokeAnalyzerExceptionList.analyzerdata @@ -1,10 +1,34 @@ -user32.dll!EnumWindows -user32.dll!GetWindow -user32.dll!GetWindowThreadProcessId -user32.dll!IsWindowVisible -user32.dll!GetWindowLong +ntdll.dll!NtQuerySystemInformation +ntdll.dll!NtQueryInformationProcess +advapi32.dll!CreateProcessWithLogonW user32.dll!GetWindowTextLength +user32.dll!EnumWindows +user32.dll!SendMessageTimeout user32.dll!GetWindowText +user32.dll!GetWindow user32.dll!PostMessage -user32.dll!SendMessageTimeout +user32.dll!GetWindowLong user32.dll!WaitForInputIdle +user32.dll!IsWindowVisible +user32.dll!GetWindowThreadProcessId +kernel32.dll!IsWow64Process +kernel32.dll!GetStdHandle +kernel32.dll!CreateProcessW +kernel32.dll!K32EnumProcessModules +kernel32.dll!K32EnumProcesses +kernel32.dll!SetProcessWorkingSetSizeEx +kernel32.dll!GetProcessWorkingSetSizeEx +kernel32.dll!SetProcessAffinityMask +kernel32.dll!GetProcessAffinityMask +kernel32.dll!GetThreadPriorityBoost +kernel32.dll!SetThreadPriorityBoost +kernel32.dll!GetProcessPriorityBoost +kernel32.dll!SetProcessPriorityBoost +kernel32.dll!SetThreadAffinityMask +kernel32.dll!GetPriorityClass +kernel32.dll!SetPriorityClass +kernel32.dll!GetComputerNameW +kernel32.dll!GetConsoleCP +kernel32.dll!GetConsoleOutputCP +kernel32.dll!CreatePipe +advapi32.dll!OpenProcessToken
\ No newline at end of file diff --git a/src/System.Diagnostics.Tracing/src/System.Diagnostics.Tracing.csproj b/src/System.Diagnostics.Tracing/src/System.Diagnostics.Tracing.csproj index ab3d5ce6d7..ec41612c7f 100644 --- a/src/System.Diagnostics.Tracing/src/System.Diagnostics.Tracing.csproj +++ b/src/System.Diagnostics.Tracing/src/System.Diagnostics.Tracing.csproj @@ -8,7 +8,7 @@ <IsPartialFacadeAssembly>true</IsPartialFacadeAssembly> <NoWarn>CA2002</NoWarn> <GenFacadesIgnoreMissingTypes Condition="'$(TargetGroup)'=='uapaot'">true</GenFacadesIgnoreMissingTypes> - <!-- Disable binplacing for now since we need to use the netcore50aot version of this assembly --> + <!-- Disable binplacing for now since we need to use the uapaot version of this assembly --> <BinPlaceILCInputFolder>false</BinPlaceILCInputFolder> </PropertyGroup> <!-- Default configurations to help VS understand the options --> diff --git a/src/System.DirectoryServices.AccountManagement/src/PinvokeAnalyzerExceptionList.analyzerdata b/src/System.DirectoryServices.AccountManagement/src/PinvokeAnalyzerExceptionList.analyzerdata index d93537e8ef..9df17a61aa 100644 --- a/src/System.DirectoryServices.AccountManagement/src/PinvokeAnalyzerExceptionList.analyzerdata +++ b/src/System.DirectoryServices.AccountManagement/src/PinvokeAnalyzerExceptionList.analyzerdata @@ -1,4 +1,3 @@ -<!-- Temporary workaround to get build to work. --> -credui.dll!CredUIParseUserNameW -advapi32.dll!LsaNtStatusToWinError activeds.dll!ADsOpenObject +advapi32.dll!LsaNtStatusToWinError +credui.dll!CredUIParseUserNameW diff --git a/src/System.DirectoryServices.AccountManagement/src/System.DirectoryServices.AccountManagement.csproj b/src/System.DirectoryServices.AccountManagement/src/System.DirectoryServices.AccountManagement.csproj index 25e6fc9c11..404e046bd4 100644 --- a/src/System.DirectoryServices.AccountManagement/src/System.DirectoryServices.AccountManagement.csproj +++ b/src/System.DirectoryServices.AccountManagement/src/System.DirectoryServices.AccountManagement.csproj @@ -7,6 +7,8 @@ <AllowUnsafeBlocks>true</AllowUnsafeBlocks> <DefineConstants>$(DefineConstants);FLAVOR_WHIDBEY;PAPI_AD;PAPI_REGSAM;USE_CTX_CACHE</DefineConstants> <NoWarn>$(NoWarn);8073</NoWarn> + <!-- Although we have a netstandard configuration, we know we are not currently UAP compatible--> + <UWPCompatible>false</UWPCompatible> </PropertyGroup> <!-- Help VS understand available configurations --> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Windows_NT-Debug|AnyCPU'" /> diff --git a/src/System.DirectoryServices.Protocols/src/System.DirectoryServices.Protocols.csproj b/src/System.DirectoryServices.Protocols/src/System.DirectoryServices.Protocols.csproj index c1fd63ad14..6a6e5efebe 100644 --- a/src/System.DirectoryServices.Protocols/src/System.DirectoryServices.Protocols.csproj +++ b/src/System.DirectoryServices.Protocols/src/System.DirectoryServices.Protocols.csproj @@ -6,6 +6,8 @@ <AssemblyName>System.DirectoryServices.Protocols</AssemblyName> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> <NoWarn>$(NoWarn);0649</NoWarn> + <!-- Although we have a netstandard configuration, we know we are not currently UAP compatible--> + <UWPCompatible>false</UWPCompatible> </PropertyGroup> <!-- Help VS understand available configurations --> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Windows_NT-Debug|AnyCPU'" /> diff --git a/src/System.DirectoryServices/src/System.DirectoryServices.csproj b/src/System.DirectoryServices/src/System.DirectoryServices.csproj index d86ca449b1..ffc0a619bf 100644 --- a/src/System.DirectoryServices/src/System.DirectoryServices.csproj +++ b/src/System.DirectoryServices/src/System.DirectoryServices.csproj @@ -6,6 +6,8 @@ <AssemblyName>System.DirectoryServices</AssemblyName> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> <NoWarn>$(NoWarn);0649</NoWarn> + <!-- Although we have a netstandard configuration, we know we are not currently UAP compatible--> + <UWPCompatible>false</UWPCompatible> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Windows_NT-Debug|AnyCPU'" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Windows_NT-Release|AnyCPU'" /> diff --git a/src/System.Dynamic.Runtime/src/System.Dynamic.Runtime.csproj b/src/System.Dynamic.Runtime/src/System.Dynamic.Runtime.csproj index 75acb796d7..d01c842d9f 100644 --- a/src/System.Dynamic.Runtime/src/System.Dynamic.Runtime.csproj +++ b/src/System.Dynamic.Runtime/src/System.Dynamic.Runtime.csproj @@ -6,7 +6,7 @@ <AssemblyName>System.Dynamic.Runtime</AssemblyName> <RootNamespace>System.Dynamic.Runtime</RootNamespace> <IsPartialFacadeAssembly>true</IsPartialFacadeAssembly> - <!-- Disable binplacing for now since we need to use the netcore50aot version of this assembly --> + <!-- Disable binplacing for now since we need to use the uapaot version of this assembly --> <BinPlaceILCInputFolder>false</BinPlaceILCInputFolder> </PropertyGroup> <!-- Default configurations to help VS understand the configurations --> diff --git a/src/System.IO.FileSystem.DriveInfo/src/PinvokeAnalyzerExceptionList.analyzerdata b/src/System.IO.FileSystem.DriveInfo/src/PinvokeAnalyzerExceptionList.analyzerdata new file mode 100644 index 0000000000..885626aff7 --- /dev/null +++ b/src/System.IO.FileSystem.DriveInfo/src/PinvokeAnalyzerExceptionList.analyzerdata @@ -0,0 +1,5 @@ +kernel32.dll!GetDriveTypeW +kernel32.dll!GetLogicalDrives +kernel32.dll!GetVolumeInformationW +kernel32.dll!SetErrorMode +kernel32.dll!SetVolumeLabelW diff --git a/src/System.IO.FileSystem.Watcher/src/PinvokeAnalyzerExceptionList.analyzerdata b/src/System.IO.FileSystem.Watcher/src/PinvokeAnalyzerExceptionList.analyzerdata new file mode 100644 index 0000000000..c2ec44e811 --- /dev/null +++ b/src/System.IO.FileSystem.Watcher/src/PinvokeAnalyzerExceptionList.analyzerdata @@ -0,0 +1,2 @@ +kernel32.dll!CreateFileW +kernel32.dll!ReadDirectoryChangesW diff --git a/src/System.IO.FileSystem/src/PinvokeAnalyzerExceptionList.analyzerdata b/src/System.IO.FileSystem/src/PinvokeAnalyzerExceptionList.analyzerdata new file mode 100644 index 0000000000..7e81c48922 --- /dev/null +++ b/src/System.IO.FileSystem/src/PinvokeAnalyzerExceptionList.analyzerdata @@ -0,0 +1,7 @@ +kernel32.dll!CopyFileExW +kernel32.dll!CreateFileW +kernel32.dll!DeleteVolumeMountPointW +kernel32.dll!GetLogicalDrives +kernel32.dll!LockFile +kernel32.dll!SetErrorMode +kernel32.dll!UnlockFile diff --git a/src/System.IO.FileSystem/src/System.IO.FileSystem.csproj b/src/System.IO.FileSystem/src/System.IO.FileSystem.csproj index bc4ecf0ff7..545d576f5d 100644 --- a/src/System.IO.FileSystem/src/System.IO.FileSystem.csproj +++ b/src/System.IO.FileSystem/src/System.IO.FileSystem.csproj @@ -7,10 +7,10 @@ <AllowUnsafeBlocks>true</AllowUnsafeBlocks> <IsPartialFacadeAssembly>true</IsPartialFacadeAssembly> <!-- - Currently the uap build is broken so forcing EnableWinRT = false to use Win32 code + Currently the uap build is broken so forcing UWPCompatible = false to use Win32 code https://github.com/dotnet/corefx/issues/16422 --> - <EnableWinRT>false</EnableWinRT> + <UWPCompatible>false</UWPCompatible> </PropertyGroup> <PropertyGroup Condition="'$(TargetsUnix)' == 'true'"> <NoWarn>$(NoWarn);414</NoWarn> @@ -190,7 +190,7 @@ </Compile> </ItemGroup> <!-- Windows : Win32 only --> - <ItemGroup Condition="'$(TargetsWindows)' == 'true' and '$(EnableWinRT)' != 'true'"> + <ItemGroup Condition="'$(TargetsWindows)' == 'true' and '$(UWPCompatible)' != 'true'"> <Compile Include="$(CommonPath)\Interop\Windows\kernel32\Interop.UnsafeCreateFile.cs"> <Link>Common\Interop\Windows\Interop.UnsafeCreateFile.cs</Link> </Compile> @@ -222,7 +222,7 @@ </Compile> </ItemGroup> <!-- Windows : UAP - Win32 + WinRT --> - <ItemGroup Condition="'$(TargetsWindows)' == 'true' AND '$(EnableWinRT)' == 'true'"> + <ItemGroup Condition="'$(TargetsWindows)' == 'true' AND '$(UWPCompatible)' == 'true'"> <Compile Include="$(CommonPath)\Interop\Windows\kernel32\Interop.UnsafeCreateFile.Uap.cs"> <Link>Common\Interop\Windows\Interop.UnsafeCreateFile.Uap.cs</Link> </Compile> @@ -384,7 +384,7 @@ <ItemGroup Condition="'$(TargetsUnix)' == 'true'"> <Reference Include="System.Threading" /> </ItemGroup> - <ItemGroup Condition="'$(EnableWinRT)' == 'true'"> + <ItemGroup Condition="'$(UWPCompatible)' == 'true'"> <Reference Include="mscorlib" /> <Reference Include="Windows" /> </ItemGroup> diff --git a/src/System.IO.IsolatedStorage/src/ApiCompatBaseline.uap101.txt b/src/System.IO.IsolatedStorage/src/ApiCompatBaseline.uap101.txt deleted file mode 100644 index 45a022d97e..0000000000 --- a/src/System.IO.IsolatedStorage/src/ApiCompatBaseline.uap101.txt +++ /dev/null @@ -1,3 +0,0 @@ -Compat issues with assembly System.IO.IsolatedStorage: -MembersMustExist : Member 'System.IO.IsolatedStorage.IsolatedStorageException..ctor(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)' does not exist in the implementation but it does exist in the contract. -Total Issues: 1 diff --git a/src/System.IO.IsolatedStorage/src/System.IO.IsolatedStorage.csproj b/src/System.IO.IsolatedStorage/src/System.IO.IsolatedStorage.csproj index 094004eb8b..e1bbb74637 100644 --- a/src/System.IO.IsolatedStorage/src/System.IO.IsolatedStorage.csproj +++ b/src/System.IO.IsolatedStorage/src/System.IO.IsolatedStorage.csproj @@ -23,10 +23,10 @@ </Compile> <Compile Include="System\IO\IsolatedStorage\IsolatedStorageException.Serialization.cs" /> </ItemGroup> - <ItemGroup Condition="'$(EnableWinRT)' != 'true'"> + <ItemGroup Condition="'$(TargetGroup)' != 'uap'"> <Compile Include="System\IO\IsolatedStorage\Helper.Win32.Unix.cs" /> </ItemGroup> - <ItemGroup Condition="'$(EnableWinRT)' == 'true'"> + <ItemGroup Condition="'$(TargetGroup)' == 'uap'"> <Compile Include="System\IO\IsolatedStorage\Helper.WinRT.cs" /> </ItemGroup> <ItemGroup> @@ -46,7 +46,7 @@ <Reference Include="System.Security.Principal.Windows" /> <Reference Include="System.Threading" /> </ItemGroup> - <ItemGroup Condition="'$(EnableWinRT)' == 'true'"> + <ItemGroup Condition="'$(TargetGroup)' == 'uap'"> <Reference Include="mscorlib" /> <Reference Include="Windows" /> </ItemGroup> diff --git a/src/System.IO.MemoryMappedFiles/src/PinvokeAnalyzerExceptionList.analyzerdata b/src/System.IO.MemoryMappedFiles/src/PinvokeAnalyzerExceptionList.analyzerdata new file mode 100644 index 0000000000..33367e4f3a --- /dev/null +++ b/src/System.IO.MemoryMappedFiles/src/PinvokeAnalyzerExceptionList.analyzerdata @@ -0,0 +1,4 @@ +kernel32.dll!CreateFileMappingW +kernel32.dll!MapViewOfFile +kernel32.dll!OpenFileMappingW +kernel32.dll!VirtualAlloc diff --git a/src/System.IO.MemoryMappedFiles/src/System.IO.MemoryMappedFiles.csproj b/src/System.IO.MemoryMappedFiles/src/System.IO.MemoryMappedFiles.csproj index 9c66cc0b84..8a95070988 100644 --- a/src/System.IO.MemoryMappedFiles/src/System.IO.MemoryMappedFiles.csproj +++ b/src/System.IO.MemoryMappedFiles/src/System.IO.MemoryMappedFiles.csproj @@ -27,6 +27,24 @@ <Compile Include="System\IO\MemoryMappedFiles\MemoryMappedViewStream.cs" /> <Compile Include="System\IO\MemoryMappedFiles\MemoryMappedFileRights.cs" /> </ItemGroup> + <ItemGroup Condition=" '$(TargetGroup)' == 'uap'"> + <Compile Include="$(CommonPath)\Interop\Windows\kernel32\Interop.CreateFileMappingFromApp.cs"> + <Link>Common\Interop\Windows\Interop.CreateFileMappingFromApp.cs</Link> + </Compile> + <Compile Include="$(CommonPath)\Interop\Windows\kernel32\Interop.MapViewOfFileFromApp.cs"> + <Link>Common\Interop\Windows\Interop.MapViewOfFileFromApp.cs</Link> + </Compile> + <Compile Include="$(CommonPath)\Interop\Windows\mincore\Interop.OpenFileMappingFromApp.cs"> + <Link>Common\Interop\Windows\Interop.OpenFileMappingFromApp.cs</Link> + </Compile> + <Compile Include="$(CommonPath)\Interop\Windows\mincore\Interop.VirtualAllocFromApp.cs"> + <Link>Common\Interop\Windows\Interop.VirtualAllocFromApp.cs</Link> + </Compile> + <Compile Include="System\IO\MemoryMappedFiles\Interop.Windows.Uap.cs" /> + </ItemGroup> + <ItemGroup Condition="'$(TargetsWindows)' == 'true' and '$(TargetGroup)' != 'uap'"> + <Compile Include="System\IO\MemoryMappedFiles\Interop.Windows.cs" /> + </ItemGroup> <ItemGroup Condition=" '$(TargetsWindows)' == 'true'"> <Compile Include="$(CommonPath)\Interop\Windows\kernel32\Interop.GlobalMemoryStatusEx.cs"> <Link>Common\Interop\Windows\Interop.GlobalMemoryStatusEx.cs</Link> @@ -40,27 +58,12 @@ <Compile Include="$(CommonPath)\Interop\Windows\kernel32\Interop.OpenFileMapping.cs"> <Link>Common\Interop\Windows\Interop.OpenFileMapping.cs</Link> </Compile> + <Compile Include="$(CommonPath)\Interop\Windows\kernel32\Interop.SECURITY_ATTRIBUTES.cs"> + <Link>Common\Interop\Windows\Interop.SECURITY_ATTRIBUTES.cs</Link> + </Compile> <Compile Include="$(CommonPath)\Interop\Windows\kernel32\Interop.VirtualAlloc.cs"> <Link>Common\Interop\Windows\Interop.VirtualAlloc.cs</Link> </Compile> - <Compile Include="System\IO\MemoryMappedFiles\Interop.Windows.cs" /> - </ItemGroup> - <ItemGroup Condition=" '$(TargetsWindows)' == 'true' And '$(TargetGroup)' == 'netcore50' "> - <Compile Include="$(CommonPath)\Interop\Windows\kernel32\Interop.CreateFileMappingFromApp.cs"> - <Link>Common\Interop\Windows\Interop.CreateFileMappingFromApp.cs</Link> - </Compile> - <Compile Include="$(CommonPath)\Interop\Windows\kernel32\Interop.MapViewOfFileFromApp.cs"> - <Link>Common\Interop\Windows\Interop.MapViewOfFileFromApp.cs</Link> - </Compile> - <Compile Include="$(CommonPath)\Interop\Windows\mincore\Interop.OpenFileMappingFromApp.cs"> - <Link>Common\Interop\Windows\Interop.OpenFileMappingFromApp.cs</Link> - </Compile> - <Compile Include="$(CommonPath)\Interop\Windows\mincore\Interop.VirtualAllocFromApp.cs"> - <Link>Common\Interop\Windows\Interop.VirtualAllocFromApp.cs</Link> - </Compile> - <Compile Include="System\IO\MemoryMappedFiles\Interop.Windows.Uap.cs" /> - </ItemGroup> - <ItemGroup Condition=" '$(TargetsWindows)' == 'true'"> <Compile Include="$(CommonPath)\Interop\Windows\Interop.Libraries.cs"> <Link>Common\Interop\Windows\Interop.Libraries.cs</Link> </Compile> @@ -109,9 +112,6 @@ <Compile Include="$(CommonPath)\Interop\Windows\Interop.BOOL.cs"> <Link>Common\Interop\Windows\Interop.BOOL.cs</Link> </Compile> - <Compile Include="$(CommonPath)\Interop\Windows\kernel32\Interop.SECURITY_ATTRIBUTES.cs"> - <Link>Common\Interop\Windows\Interop.SECURITY_ATTRIBUTES.cs</Link> - </Compile> <Compile Include="$(CommonPath)\Interop\Windows\kernel32\Interop.SecurityOptions.cs"> <Link>Common\Interop\Windows\Interop.SecurityOptions.cs</Link> </Compile> diff --git a/src/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/Interop.Windows.Uap.cs b/src/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/Interop.Windows.Uap.cs index ac84657294..b99675f81e 100644 --- a/src/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/Interop.Windows.Uap.cs +++ b/src/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/Interop.Windows.Uap.cs @@ -17,7 +17,7 @@ internal partial class Interop public static SafeMemoryMappedFileHandle CreateFileMapping( SafeFileHandle hFile, - ref mincore.SECURITY_ATTRIBUTES securityAttributes, + ref Kernel32.SECURITY_ATTRIBUTES securityAttributes, int pageProtection, long maximumSize, string name) @@ -27,7 +27,7 @@ internal partial class Interop public static SafeMemoryMappedFileHandle CreateFileMapping( IntPtr hFile, - ref mincore.SECURITY_ATTRIBUTES securityAttributes, + ref Kernel32.SECURITY_ATTRIBUTES securityAttributes, int pageProtection, long maximumSize, string name) @@ -48,7 +48,7 @@ internal partial class Interop bool inheritHandle, string name) { - return Interop.Kernel32.OpenFileMappingFromApp(desiredAccess, inheritHandle, name); + return Interop.mincore.OpenFileMappingFromApp(desiredAccess, inheritHandle, name); } public static IntPtr VirtualAlloc( SafeHandle baseAddress, @@ -56,6 +56,6 @@ internal partial class Interop int allocationType, int protection) { - return Interop.Kernel32.VirtualAllocFromApp(baseAddress, size, allocationType, protection); + return Interop.mincore.VirtualAllocFromApp(baseAddress, size, allocationType, protection); } }
\ No newline at end of file diff --git a/src/System.IO.Pipes/src/PinvokeAnalyzerExceptionList.analyzerdata b/src/System.IO.Pipes/src/PinvokeAnalyzerExceptionList.analyzerdata new file mode 100644 index 0000000000..5377d8cf50 --- /dev/null +++ b/src/System.IO.Pipes/src/PinvokeAnalyzerExceptionList.analyzerdata @@ -0,0 +1,10 @@ +advapi32.dll!RevertToSelf +kernel32.dll!ConnectNamedPipe +kernel32.dll!CreateFileW +kernel32.dll!CreateNamedPipeW +kernel32.dll!CreatePipe +kernel32.dll!DisconnectNamedPipe +kernel32.dll!GetNamedPipeHandleStateW +kernel32.dll!GetNamedPipeInfo +kernel32.dll!SetNamedPipeHandleState +kernel32.dll!WaitNamedPipeW diff --git a/src/System.IO.Ports/src/PinvokeAnalyzerExceptionList.analyzerdata b/src/System.IO.Ports/src/PinvokeAnalyzerExceptionList.analyzerdata new file mode 100644 index 0000000000..dc851261b8 --- /dev/null +++ b/src/System.IO.Ports/src/PinvokeAnalyzerExceptionList.analyzerdata @@ -0,0 +1,14 @@ +kernel32.dll!ClearCommBreak +kernel32.dll!ClearCommError +kernel32.dll!CreateFileW +kernel32.dll!EscapeCommFunction +kernel32.dll!GetCommModemStatus +kernel32.dll!GetCommProperties +kernel32.dll!GetCommState +kernel32.dll!PurgeComm +kernel32.dll!SetCommBreak +kernel32.dll!SetCommMask +kernel32.dll!SetCommState +kernel32.dll!SetCommTimeouts +kernel32.dll!SetupComm +kernel32.dll!WaitCommEvent
\ No newline at end of file diff --git a/src/System.IO/src/ApiCompatBaseline.uap101aot.txt b/src/System.IO/src/ApiCompatBaseline.uap101aot.txt deleted file mode 100644 index d9ed8cd107..0000000000 --- a/src/System.IO/src/ApiCompatBaseline.uap101aot.txt +++ /dev/null @@ -1,19 +0,0 @@ -Compat issues with assembly System.IO: -CannotRemoveBaseTypeOrInterface : Type 'System.IO.BufferedStream' does not inherit from base type 'System.MarshalByRefObject' in the implementation but it does in the contract. -CannotRemoveBaseTypeOrInterface : Type 'System.IO.EndOfStreamException' does not inherit from base type 'System.SystemException' in the implementation but it does in the contract. -MembersMustExist : Member 'System.IO.EndOfStreamException..ctor(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)' does not exist in the implementation but it does exist in the contract. -CannotRemoveBaseTypeOrInterface : Type 'System.IO.FileNotFoundException' does not inherit from base type 'System.SystemException' in the implementation but it does in the contract. -MembersMustExist : Member 'System.IO.FileNotFoundException..ctor(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.IO.FileNotFoundException.FusionLog.get()' does not exist in the implementation but it does exist in the contract. -CannotRemoveBaseTypeOrInterface : Type 'System.IO.IOException' does not inherit from base type 'System.SystemException' in the implementation but it does in the contract. -MembersMustExist : Member 'System.IO.IOException..ctor(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)' does not exist in the implementation but it does exist in the contract. -CannotRemoveBaseTypeOrInterface : Type 'System.IO.MemoryStream' does not inherit from base type 'System.MarshalByRefObject' in the implementation but it does in the contract. -CannotRemoveBaseTypeOrInterface : Type 'System.IO.Stream' does not inherit from base type 'System.MarshalByRefObject' in the implementation but it does in the contract. -MembersMustExist : Member 'System.IO.Stream.CreateWaitHandle()' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.IO.Stream.ObjectInvariant()' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.IO.Stream.Synchronized(System.IO.Stream)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.IO.TextReader.Synchronized(System.IO.TextReader)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.IO.TextWriter.Synchronized(System.IO.TextWriter)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.IO.BufferedStream.BufferSize.get()' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.IO.BufferedStream.UnderlyingStream.get()' does not exist in the implementation but it does exist in the contract. -CannotMakeMemberNonVirtual : Member 'System.IO.Stream.CopyTo(System.IO.Stream, System.Int32)' is non-virtual in the implementation but is virtual in the contract. diff --git a/src/System.Linq.Expressions/src/System.Linq.Expressions.csproj b/src/System.Linq.Expressions/src/System.Linq.Expressions.csproj index 0f6e4025dd..fdb809d4e6 100644 --- a/src/System.Linq.Expressions/src/System.Linq.Expressions.csproj +++ b/src/System.Linq.Expressions/src/System.Linq.Expressions.csproj @@ -9,7 +9,13 @@ <ProjectGuid>{AEF718E9-D4FC-418F-A7AE-ED6B2C7B3787}</ProjectGuid> <AssemblyName>System.Linq.Expressions</AssemblyName> <RootNamespace>System.Linq.Expressions</RootNamespace> - <IsInterpreting Condition="'$(TargetGroup)' == 'netcore50'">true</IsInterpreting> + <IsInterpreting Condition="'$(TargetGroup)' == 'uap'">true</IsInterpreting> + + <!-- Temporarily disable IsInterpreting build as it's broken and needs investigation + https://github.com/dotnet/corefx/issues/16910 + --> + <IsInterpreting>false</IsInterpreting> + <DefineConstants Condition=" '$(IsInterpreting)' != 'true' ">$(DefineConstants);FEATURE_COMPILE</DefineConstants> <DefineConstants Condition=" '$(FeatureInterpret)' == 'true' ">$(DefineConstants);FEATURE_INTERPRET</DefineConstants> </PropertyGroup> @@ -18,10 +24,10 @@ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Release|AnyCPU'" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Debug|AnyCPU'" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Release|AnyCPU'" /> - <PropertyGroup Condition="'$(TargetGroup)' == 'netcore50aot'"> + <PropertyGroup Condition="'$(TargetGroup)' == 'uapaot'"> <DefineConstants>$(DefineConstants);FEATURE_DYNAMIC_DELEGATE</DefineConstants> </PropertyGroup> - <ItemGroup Condition="'$(TargetGroup)' == 'netcore50aot'"> + <ItemGroup Condition="'$(TargetGroup)' == 'uapaot'"> <EmbeddedResource Include="Resources\$(AssemblyName).rd.xml" /> <ReferenceFromRuntime Include="System.Private.CoreLib.DynamicDelegate" /> </ItemGroup> diff --git a/src/System.Linq.Expressions/tests/System.Linq.Expressions.Tests.csproj b/src/System.Linq.Expressions/tests/System.Linq.Expressions.Tests.csproj index 756e29b308..65602e86d8 100644 --- a/src/System.Linq.Expressions/tests/System.Linq.Expressions.Tests.csproj +++ b/src/System.Linq.Expressions/tests/System.Linq.Expressions.Tests.csproj @@ -7,7 +7,7 @@ </PropertyGroup> <PropertyGroup> <ProjectGuid>{4B4AA59B-89F9-4A34-B3C3-C97EF531EE00}</ProjectGuid> - <IsInterpreting Condition="'$(TargetGroup)' == 'netcore50'">true</IsInterpreting> + <IsInterpreting Condition="'$(TargetGroup)' == 'uap'">true</IsInterpreting> <DefineConstants Condition=" '$(IsInterpreting)' != 'true' ">$(DefineConstants);FEATURE_COMPILE</DefineConstants> <DefineConstants Condition=" '$(FeatureInterpret)' == 'true' ">$(DefineConstants);FEATURE_INTERPRET</DefineConstants> </PropertyGroup> diff --git a/src/System.Net.Http.WinHttpHandler/src/PinvokeAnalyzerExceptionList.analyzerdata b/src/System.Net.Http.WinHttpHandler/src/PinvokeAnalyzerExceptionList.analyzerdata new file mode 100644 index 0000000000..35cad528fc --- /dev/null +++ b/src/System.Net.Http.WinHttpHandler/src/PinvokeAnalyzerExceptionList.analyzerdata @@ -0,0 +1,26 @@ +kernel32.dll!GetModuleHandleW +winhttp.dll!WinHttpAddRequestHeaders +winhttp.dll!WinHttpCloseHandle +winhttp.dll!WinHttpConnect +winhttp.dll!WinHttpGetIEProxyConfigForCurrentUser +winhttp.dll!WinHttpGetProxyForUrl +winhttp.dll!WinHttpOpen +winhttp.dll!WinHttpOpenRequest +winhttp.dll!WinHttpQueryAuthSchemes +winhttp.dll!WinHttpQueryDataAvailable +winhttp.dll!WinHttpQueryHeaders +winhttp.dll!WinHttpQueryOption +winhttp.dll!WinHttpReadData +winhttp.dll!WinHttpReceiveResponse +winhttp.dll!WinHttpSendRequest +winhttp.dll!WinHttpSetCredentials +winhttp.dll!WinHttpSetOption +winhttp.dll!WinHttpSetStatusCallback +winhttp.dll!WinHttpSetTimeouts +winhttp.dll!WinHttpWebSocketClose +winhttp.dll!WinHttpWebSocketCompleteUpgrade +winhttp.dll!WinHttpWebSocketQueryCloseStatus +winhttp.dll!WinHttpWebSocketReceive +winhttp.dll!WinHttpWebSocketSend +winhttp.dll!WinHttpWebSocketShutdown +winhttp.dll!WinHttpWriteData
\ No newline at end of file diff --git a/src/System.Net.Http/src/System.Net.Http.csproj b/src/System.Net.Http/src/System.Net.Http.csproj index abb2888988..8b546e1d1f 100644 --- a/src/System.Net.Http/src/System.Net.Http.csproj +++ b/src/System.Net.Http/src/System.Net.Http.csproj @@ -25,7 +25,7 @@ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Debug|AnyCPU'" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Release|AnyCPU'" /> <PropertyGroup Condition="'$(TargetGroup)' == 'uap'"> - <DefineConstants>$(DefineConstants);NETNative;NETNative_SystemNetHttp</DefineConstants> + <DefineConstants>$(DefineConstants);uap</DefineConstants> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> </PropertyGroup> <!-- Shims --> @@ -342,7 +342,7 @@ <Link>Common\Microsoft\Win32\SafeHandles\Asn1SafeHandles.Unix.cs</Link> </Compile> </ItemGroup> - <ItemGroup Condition="'$(TargetGroup)' == 'uap'"> + <ItemGroup Condition="'$(TargetGroup)' == 'uap'" > <Reference Include="Windows" /> <Reference Include="mscorlib" /> <Reference Include="System.Runtime.WindowsRuntime" /> diff --git a/src/System.Net.Http/src/System/Net/Http/Headers/HeaderUtilities.cs b/src/System.Net.Http/src/System/Net/Http/Headers/HeaderUtilities.cs index 7133252041..de509b9521 100644 --- a/src/System.Net.Http/src/System/Net/Http/Headers/HeaderUtilities.cs +++ b/src/System.Net.Http/src/System/Net/Http/Headers/HeaderUtilities.cs @@ -298,7 +298,7 @@ namespace System.Net.Http.Headers { try { -#if NETNative +#if uap new MailAddress(value); #else MailAddressParser.ParseAddress(value); diff --git a/src/System.Net.Http/src/System/Net/Http/Headers/UriHeaderParser.cs b/src/System.Net.Http/src/System/Net/Http/Headers/UriHeaderParser.cs index 0be87c5d34..a2d483f9ff 100644 --- a/src/System.Net.Http/src/System/Net/Http/Headers/UriHeaderParser.cs +++ b/src/System.Net.Http/src/System/Net/Http/Headers/UriHeaderParser.cs @@ -95,7 +95,7 @@ namespace System.Net.Http.Headers try { // We don't want '?' replacement characters, just fail. -#if PHONE || NETNative +#if uap System.Text.Encoding decoder = new System.Text.UTF8Encoding(encoderShouldEmitUTF8Identifier: true, throwOnInvalidBytes: true); #else System.Text.Encoding decoder = System.Text.Encoding.GetEncoding("utf-8", System.Text.EncoderFallback.ExceptionFallback, diff --git a/src/System.Net.Http/src/System/Net/Http/HttpContent.cs b/src/System.Net.Http/src/System/Net/Http/HttpContent.cs index cf490a647a..4f90af0e54 100644 --- a/src/System.Net.Http/src/System/Net/Http/HttpContent.cs +++ b/src/System.Net.Http/src/System/Net/Http/HttpContent.cs @@ -33,7 +33,7 @@ namespace System.Net.Http private const byte UTF8PreambleByte2 = 0xBF; private const int UTF8PreambleFirst2Bytes = 0xEFBB; -#if !NETNative +#if !uap // UTF32 not supported on Phone private const int UTF32CodePage = 12000; private const int UTF32PreambleLength = 4; @@ -64,7 +64,7 @@ namespace System.Net.Http UTF8PreambleByte1, UTF8PreambleByte2); -#if !NETNative +#if !uap // UTF32 not supported on Phone AssertEncodingConstants(Encoding.UTF32, UTF32CodePage, UTF32PreambleLength, UTF32OrUnicodePreambleFirst2Bytes, UTF32PreambleByte0, @@ -547,7 +547,7 @@ namespace System.Net.Http && data[offset + 0] == UTF8PreambleByte0 && data[offset + 1] == UTF8PreambleByte1 && data[offset + 2] == UTF8PreambleByte2) ? UTF8PreambleLength : 0; -#if !NETNative +#if !uap // UTF32 not supported on Phone case UTF32CodePage: return (dataLength >= UTF32PreambleLength @@ -596,7 +596,7 @@ namespace System.Net.Http break; case UTF32OrUnicodePreambleFirst2Bytes: -#if !NETNative +#if !uap // UTF32 not supported on Phone if (dataLength >= UTF32PreambleLength && data[offset + 2] == UTF32PreambleByte2 && data[offset + 3] == UTF32PreambleByte3) { diff --git a/src/System.Net.Http/src/System/Net/Http/HttpRuleParser.cs b/src/System.Net.Http/src/System/Net/Http/HttpRuleParser.cs index 57b6034659..514be9b5c2 100644 --- a/src/System.Net.Http/src/System/Net/Http/HttpRuleParser.cs +++ b/src/System.Net.Http/src/System/Net/Http/HttpRuleParser.cs @@ -40,7 +40,7 @@ namespace System.Net.Http internal const int MaxInt32Digits = 10; // iso-8859-1, Western European (ISO) -#if PHONE || NETNative +#if uap internal static readonly Encoding DefaultHttpEncoding = Encoding.GetEncoding("iso-8859-1"); #else internal static readonly Encoding DefaultHttpEncoding = Encoding.GetEncoding(28591); diff --git a/src/System.Net.Http/src/System/Net/Http/HttpUtilities.cs b/src/System.Net.Http/src/System/Net/Http/HttpUtilities.cs index 46d1bf999e..252e1c3928 100644 --- a/src/System.Net.Http/src/System/Net/Http/HttpUtilities.cs +++ b/src/System.Net.Http/src/System/Net/Http/HttpUtilities.cs @@ -15,7 +15,7 @@ namespace System.Net.Http internal static class HttpUtilities { internal static Version DefaultRequestVersion => -#if NETNative +#if uap HttpVersionInternal.Version20; #else HttpVersionInternal.Version11; diff --git a/src/System.Net.Http/src/netcore50/System/Net/cookie.cs b/src/System.Net.Http/src/netcore50/System/Net/cookie.cs index 756a4ce382..9a94a76e79 100644 --- a/src/System.Net.Http/src/netcore50/System/Net/cookie.cs +++ b/src/System.Net.Http/src/netcore50/System/Net/cookie.cs @@ -8,15 +8,15 @@ using System.Globalization; using System.Text; using System.Threading; -// The NETNative_SystemNetHttp #define is used in some source files to indicate we are compiling classes -// directly into the .NET Native System.Net.Http.dll implementation assembly in order to use internal class +// The uap #define is used in some source files to indicate we are compiling classes +// directly into the UWP System.Net.Http.dll implementation assembly in order to use internal class // methods. Internal methods are needed in order to map cookie response headers from the WinRT Windows.Web.Http APIs. // Windows.Web.Http is used underneath the System.Net.Http classes on .NET Native. Having other similarly -// named classes would normally conflict with the public System.Net namespace classes that are also in the -// System.Private.Networking dll. So, we need to move the classes to a different namespace. Those classes are never +// named classes would normally conflict with the public System.Net namespace classes. +// So, we need to move the classes to a different namespace. Those classes are never // exposed up to user code so there isn't a problem. In the future, we might expose some of the internal methods // as new public APIs and then we can remove this duplicate source code inclusion in the binaries. -#if NETNative_SystemNetHttp +#if uap namespace System.Net.Internal #else namespace System.Net @@ -751,7 +751,7 @@ namespace System.Net set { // only set by HttpListenerRequest::Cookies_get() -#if !NETNative_SystemNetHttp +#if !uap if (NetEventSource.IsEnabled) NetEventSource.Info(this, $"value:{value}"); #endif m_cookieVariant = value; @@ -960,7 +960,7 @@ namespace System.Net /// </devdoc> internal void Dump() { -#if !NETNative_SystemNetHttp +#if !uap if (NetEventSource.IsEnabled) NetEventSource.Info(this, "Cookie: " + ToString() + "->\n" diff --git a/src/System.Net.Http/src/netcore50/System/Net/cookieexception.cs b/src/System.Net.Http/src/netcore50/System/Net/cookieexception.cs index 46b8d1b85e..c497d0c42b 100644 --- a/src/System.Net.Http/src/netcore50/System/Net/cookieexception.cs +++ b/src/System.Net.Http/src/netcore50/System/Net/cookieexception.cs @@ -4,15 +4,15 @@ using System.Diagnostics.CodeAnalysis; -// The NETNative_SystemNetHttp #define is used in some source files to indicate we are compiling classes -// directly into the .NET Native System.Net.Http.dll implementation assembly in order to use internal class +// The uap #define is used in some source files to indicate we are compiling classes +// directly into the UWP System.Net.Http.dll implementation assembly in order to use internal class // methods. Internal methods are needed in order to map cookie response headers from the WinRT Windows.Web.Http APIs. // Windows.Web.Http is used underneath the System.Net.Http classes on .NET Native. Having other similarly -// named classes would normally conflict with the public System.Net namespace classes that are also in the -// System.Private.Networking dll. So, we need to move the classes to a different namespace. Those classes are never +// named classes would normally conflict with the public System.Net namespace classes. +// So, we need to move the classes to a different namespace. Those classes are never // exposed up to user code so there isn't a problem. In the future, we might expose some of the internal methods // as new public APIs and then we can remove this duplicate source code inclusion in the binaries. -#if NETNative_SystemNetHttp +#if uap namespace System.Net.Internal #else namespace System.Net diff --git a/src/System.Net.NameResolution/src/System.Net.NameResolution.csproj b/src/System.Net.NameResolution/src/System.Net.NameResolution.csproj index 8fd3e9fe62..ad352c1389 100644 --- a/src/System.Net.NameResolution/src/System.Net.NameResolution.csproj +++ b/src/System.Net.NameResolution/src/System.Net.NameResolution.csproj @@ -5,12 +5,9 @@ <AssemblyName>System.Net.NameResolution</AssemblyName> <ProjectGuid>{1714448C-211E-48C1-8B7E-4EE667D336A1}</ProjectGuid> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> - </PropertyGroup> - <PropertyGroup Condition="'$(EnableWinRT)' != 'true'"> - <DefineConstants>$(DefineConstants);FEATURE_CORECLR</DefineConstants> - </PropertyGroup> - <PropertyGroup Condition="'$(EnableWinRT)' == 'true'"> - <DefineConstants>$(DefineConstants);NETNATIVE</DefineConstants> + </PropertyGroup> + <PropertyGroup> + <DefineConstants Condition="'$(TargetGroup)' == 'uap'">$(DefineConstants);uap</DefineConstants> </PropertyGroup> <!-- Help VS understand available configurations --> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='uap-Windows_NT-Debug|AnyCPU'" /> @@ -121,13 +118,13 @@ </Compile> </ItemGroup> <!-- Windows : Win32 only --> - <ItemGroup Condition="'$(TargetsWindows)' == 'true' AND '$(EnableWinRT)' != 'true'"> + <ItemGroup Condition="'$(TargetsWindows)' == 'true' AND '$(TargetGroup)' != 'uap'"> <Compile Include="$(CommonPath)\System\Net\ContextAwareResult.Windows.cs"> <Link>Common\System\Net\ContextAwareResult.Windows.cs</Link> </Compile> </ItemGroup> <!-- Windows : Win32 + WinRT --> - <ItemGroup Condition="'$(TargetsWindows)' == 'true' AND '$(EnableWinRT)' == 'true'"> + <ItemGroup Condition="'$(TargetsWindows)' == 'true' AND '$(TargetGroup)' == 'uap'"> <Compile Include="$(CommonPath)\System\Net\ContextAwareResult.Uap.cs"> <Link>Common\System\Net\ContextAwareResult.Uap.cs</Link> </Compile> diff --git a/src/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj b/src/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj index b39b3ec9c5..40beab68c2 100644 --- a/src/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj +++ b/src/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj @@ -7,11 +7,8 @@ <ProjectGuid>{3CA89D6C-F8D1-4813-9775-F8D249686E31}</ProjectGuid> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> </PropertyGroup> - <PropertyGroup Condition="'$(EnableWinRT)' != 'true'"> - <DefineConstants>$(DefineConstants);FEATURE_CORECLR</DefineConstants> - </PropertyGroup> - <PropertyGroup Condition="'$(EnableWinRT)' == 'true'"> - <DefineConstants>$(DefineConstants);NETNATIVE</DefineConstants> + <PropertyGroup> + <DefineConstants Condition="'$(TargetGroup)' == 'uap'">$(DefineConstants);uap</DefineConstants> </PropertyGroup> <!-- Help VS understand available configurations --> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='uap-Windows_NT-Debug|AnyCPU'" /> @@ -91,7 +88,7 @@ </Compile> </ItemGroup> <!-- Windows : Win32 only --> - <ItemGroup Condition="'$(TargetsWindows)' == 'true' AND '$(EnableWinRT)' != 'true'"> + <ItemGroup Condition="'$(TargetsWindows)' == 'true' AND '$(TargetGroup)' != 'uap'"> <Compile Include="System\Net\NetworkInformation\IPGlobalPropertiesPal.Windows.cs" /> <Compile Include="System\Net\NetworkInformation\NetworkAddressChange.Windows.cs" /> <Compile Include="System\Net\NetworkInformation\NetworkInterfacePal.Windows.cs" /> @@ -240,7 +237,7 @@ </Compile> </ItemGroup> <!-- Windows : Win32 + WinRT --> - <ItemGroup Condition="'$(TargetsWindows)' == 'true' AND '$(EnableWinRT)' == 'true'"> + <ItemGroup Condition="'$(TargetsWindows)' == 'true' AND '$(TargetGroup)' == 'uap'"> <Compile Include="System\Net\NetworkInformation\IPGlobalPropertiesPal.Uap.cs" /> <Compile Include="System\Net\NetworkInformation\NetNativeIPGlobalProperties.cs" /> <Compile Include="System\Net\NetworkInformation\NetworkAddressChange.Uap.cs" /> diff --git a/src/System.Net.Ping/src/System.Net.Ping.csproj b/src/System.Net.Ping/src/System.Net.Ping.csproj index 438ba705ac..e5ff8179ea 100644 --- a/src/System.Net.Ping/src/System.Net.Ping.csproj +++ b/src/System.Net.Ping/src/System.Net.Ping.csproj @@ -5,7 +5,6 @@ <AssemblyName>System.Net.Ping</AssemblyName> <ProjectGuid>{85FD05E8-A4B1-4B89-ABED-33AFD200CABD}</ProjectGuid> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> - <DefineConstants>$(DefineConstants);FEATURE_CORECLR</DefineConstants> </PropertyGroup> <!-- Help VS understand available configurations --> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Debug|AnyCPU'" /> diff --git a/src/System.Net.Primitives/src/ApiCompatBaseline.uap.txt b/src/System.Net.Primitives/src/ApiCompatBaseline.uap.txt new file mode 100644 index 0000000000..7208de96d3 --- /dev/null +++ b/src/System.Net.Primitives/src/ApiCompatBaseline.uap.txt @@ -0,0 +1,10 @@ +Compat issues with assembly System.Net.Primitives: +TypesMustExist : Type 'System.Net.Cookie' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Net.CookieCollection.Add(System.Net.Cookie)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Net.CookieCollection.CopyTo(System.Net.Cookie[], System.Int32)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Net.CookieCollection.Item.get(System.Int32)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Net.CookieCollection.Item.get(System.String)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Net.CookieContainer.Add(System.Net.Cookie)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Net.CookieContainer.Add(System.Uri, System.Net.Cookie)' does not exist in the implementation but it does exist in the contract. +TypesMustExist : Type 'System.Net.CookieException' does not exist in the implementation but it does exist in the contract. +Total Issues: 8 diff --git a/src/System.Net.Primitives/src/ApiCompatBaseline.uap101.txt b/src/System.Net.Primitives/src/ApiCompatBaseline.uap101.txt deleted file mode 100644 index 86db74ba9a..0000000000 --- a/src/System.Net.Primitives/src/ApiCompatBaseline.uap101.txt +++ /dev/null @@ -1,4 +0,0 @@ -Compat issues with assembly System.Net.Primitives: -CannotRemoveBaseTypeOrInterface : Type 'System.Net.Sockets.SocketException' does not inherit from base type 'System.Runtime.InteropServices.ExternalException' in the implementation but it does in the contract. -MembersMustExist : Member 'System.Net.Sockets.SocketException..ctor(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)' does not exist in the implementation but it does exist in the contract. -Total Issues: 2 diff --git a/src/System.Net.Primitives/src/System.Net.Primitives.csproj b/src/System.Net.Primitives/src/System.Net.Primitives.csproj index 7db1912aab..5a52e4f258 100644 --- a/src/System.Net.Primitives/src/System.Net.Primitives.csproj +++ b/src/System.Net.Primitives/src/System.Net.Primitives.csproj @@ -7,11 +7,8 @@ <ProjectGuid>{8772BC91-7B55-49B9-94FA-4B1BE5BEAB55}</ProjectGuid> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> </PropertyGroup> - <PropertyGroup Condition="'$(EnableWinRT)' != 'true' AND '$(TargetGroup)' == 'netcoreapp'"> - <DefineConstants>$(DefineConstants);FEATURE_CORECLR</DefineConstants> - </PropertyGroup> - <PropertyGroup Condition="'$(EnableWinRT)' == 'true'"> - <DefineConstants>$(DefineConstants);NETNATIVE</DefineConstants> + <PropertyGroup> + <DefineConstants Condition="'$(TargetGroup)' == 'uap'">$(DefineConstants);uap</DefineConstants> </PropertyGroup> <!-- Help VS understand available configurations --> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='uap-Windows_NT-Debug|AnyCPU'" /> @@ -143,7 +140,7 @@ </Compile> </ItemGroup> <!-- Windows : Win32 only --> - <ItemGroup Condition="'$(TargetsWindows)' == 'true' AND '$(EnableWinRT)' != 'true'"> + <ItemGroup Condition="'$(TargetsWindows)' == 'true' AND '$(TargetGroup)' != 'uap'"> <Compile Include="$(CommonPath)\System\Net\NetworkInformation\HostInformationPal.Windows.cs"> <Link>Common\System\Net\NetworkInformation\HostInformationPal.Windows.cs</Link> </Compile> @@ -164,7 +161,7 @@ </Compile> </ItemGroup> <!-- Windows : Win32 + WinRT --> - <ItemGroup Condition="'$(TargetsWindows)' == 'true' AND '$(EnableWinRT)' == 'true'"> + <ItemGroup Condition="'$(TargetsWindows)' == 'true' AND '$(TargetGroup)' == 'uap'"> <Compile Include="$(CommonPath)\System\Net\NetworkInformation\HostInformationPal.Uap.cs"> <Link>Common\System\Net\NetworkInformation\HostInformationPal.Uap.cs</Link> </Compile> diff --git a/src/System.Net.Primitives/src/System/Net/Cookie.cs b/src/System.Net.Primitives/src/System/Net/Cookie.cs index 7964a9012a..b6317f2e0b 100644 --- a/src/System.Net.Primitives/src/System/Net/Cookie.cs +++ b/src/System.Net.Primitives/src/System/Net/Cookie.cs @@ -8,15 +8,15 @@ using System.Globalization; using System.IO; using System.Text; -// The NETNative_SystemNetHttp #define is used in some source files to indicate we are compiling classes -// directly into the .NET Native System.Net.Http.dll implementation assembly in order to use internal class +// The uap #define is used in some source files to indicate we are compiling classes +// directly into the UWP System.Net.Http.dll implementation assembly in order to use internal class // methods. Internal methods are needed in order to map cookie response headers from the WinRT Windows.Web.Http APIs. // Windows.Web.Http is used underneath the System.Net.Http classes on .NET Native. Having other similarly -// named classes would normally conflict with the public System.Net namespace classes that are also in the -// System.Private.Networking dll. So, we need to move the classes to a different namespace. Those classes are never +// named classes would normally conflict with the public System.Net namespace classes. +// So, we need to move the classes to a different namespace. Those classes are never // exposed up to user code so there isn't a problem. In the future, we might expose some of the internal methods // as new public APIs and then we can remove this duplicate source code inclusion in the binaries. -#if NETNative_SystemNetHttp +#if uap namespace System.Net.Internal #else namespace System.Net @@ -682,7 +682,7 @@ namespace System.Net set { // Only set by HttpListenerRequest::Cookies_get() -#if !NETNative_SystemNetHttp +#if !uap if (value != CookieVariant.Rfc2965) { NetEventSource.Fail(this, $"value != Rfc2965:{value}"); @@ -852,7 +852,7 @@ namespace System.Net #if DEBUG internal void Dump() { -#if !NETNative_SystemNetHttp +#if !uap if (NetEventSource.IsEnabled) { if (NetEventSource.IsEnabled) NetEventSource.Info(this, diff --git a/src/System.Net.Primitives/src/System/Net/CookieCollection.cs b/src/System.Net.Primitives/src/System/Net/CookieCollection.cs index 38ccf53507..e37008d72c 100644 --- a/src/System.Net.Primitives/src/System/Net/CookieCollection.cs +++ b/src/System.Net.Primitives/src/System/Net/CookieCollection.cs @@ -4,6 +4,9 @@ using System.Collections; using System.Collections.Generic; +#if uap +using System.Net.Internal; +#endif namespace System.Net { diff --git a/src/System.Net.Primitives/src/System/Net/CookieContainer.cs b/src/System.Net.Primitives/src/System/Net/CookieContainer.cs index 7d32809745..4206af2a1c 100644 --- a/src/System.Net.Primitives/src/System/Net/CookieContainer.cs +++ b/src/System.Net.Primitives/src/System/Net/CookieContainer.cs @@ -7,6 +7,9 @@ using System.Diagnostics; using System.IO; using System.Net.NetworkInformation; using System.Text; +#if uap +using System.Net.Internal; +#endif // Relevant cookie specs: // diff --git a/src/System.Net.Primitives/src/System/Net/CookieException.cs b/src/System.Net.Primitives/src/System/Net/CookieException.cs index c903574588..84f724cc3a 100644 --- a/src/System.Net.Primitives/src/System/Net/CookieException.cs +++ b/src/System.Net.Primitives/src/System/Net/CookieException.cs @@ -4,15 +4,15 @@ using System.Runtime.Serialization; -// The NETNative_SystemNetHttp #define is used in some source files to indicate we are compiling classes -// directly into the .NET Native System.Net.Http.dll implementation assembly in order to use internal class +// The uap #define is used in some source files to indicate we are compiling classes +// directly into the UWP System.Net.Http.dll implementation assembly in order to use internal class // methods. Internal methods are needed in order to map cookie response headers from the WinRT Windows.Web.Http APIs. // Windows.Web.Http is used underneath the System.Net.Http classes on .NET Native. Having other similarly -// named classes would normally conflict with the public System.Net namespace classes that are also in the -// System.Private.Networking dll. So, we need to move the classes to a different namespace. Those classes are never +// named classes would normally conflict with the public System.Net namespace classes. +// So, we need to move the classes to a different namespace. Those classes are never // exposed up to user code so there isn't a problem. In the future, we might expose some of the internal methods // as new public APIs and then we can remove this duplicate source code inclusion in the binaries. -#if NETNative_SystemNetHttp +#if uap namespace System.Net.Internal #else namespace System.Net diff --git a/src/System.Net.Requests/src/System.Net.Requests.csproj b/src/System.Net.Requests/src/System.Net.Requests.csproj index 987db2266b..5228e652f3 100644 --- a/src/System.Net.Requests/src/System.Net.Requests.csproj +++ b/src/System.Net.Requests/src/System.Net.Requests.csproj @@ -6,7 +6,7 @@ <RootNamespace>System.Net.Requests</RootNamespace> <AssemblyName>System.Net.Requests</AssemblyName> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> - <!-- Disable binplacing for now since we need to use the netcore50aot version of this assembly --> + <!-- Disable binplacing for now since we need to use the uapaot version of this assembly --> <BinPlaceILCInputFolder>false</BinPlaceILCInputFolder> </PropertyGroup> <!-- Help VS understand available configurations --> diff --git a/src/System.Net.Security/src/PinvokeAnalyzerExceptionList.analyzerdata b/src/System.Net.Security/src/PinvokeAnalyzerExceptionList.analyzerdata new file mode 100644 index 0000000000..e229924b6e --- /dev/null +++ b/src/System.Net.Security/src/PinvokeAnalyzerExceptionList.analyzerdata @@ -0,0 +1,16 @@ +sspicli.dll!AcceptSecurityContext +sspicli.dll!AcquireCredentialsHandleW +sspicli.dll!ApplyControlToken +sspicli.dll!CompleteAuthToken +sspicli.dll!DecryptMessage +sspicli.dll!DeleteSecurityContext +sspicli.dll!EncryptMessage +sspicli.dll!EnumerateSecurityPackagesW +sspicli.dll!FreeContextBuffer +sspicli.dll!FreeCredentialsHandle +sspicli.dll!InitializeSecurityContextW +sspicli.dll!QueryContextAttributesW +sspicli.dll!QuerySecurityContextToken +sspicli.dll!SetContextAttributesW +sspicli.dll!SspiEncodeStringsAsAuthIdentity +sspicli.dll!SspiFreeAuthIdentity diff --git a/src/System.Net.Security/src/System.Net.Security.csproj b/src/System.Net.Security/src/System.Net.Security.csproj index 2f1e61fb8b..d912c51e88 100644 --- a/src/System.Net.Security/src/System.Net.Security.csproj +++ b/src/System.Net.Security/src/System.Net.Security.csproj @@ -5,7 +5,6 @@ <AssemblyName>System.Net.Security</AssemblyName> <ProjectGuid>{89F37791-6254-4D60-AB96-ACD3CCA0E771}</ProjectGuid> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> - <DefineConstants>$(DefineConstants);FEATURE_CORECLR</DefineConstants> </PropertyGroup> <!-- Help VS understand available configurations --> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Debug|AnyCPU'" /> diff --git a/src/System.Net.Sockets/src/System.Net.Sockets.csproj b/src/System.Net.Sockets/src/System.Net.Sockets.csproj index feb66d998d..895f603fc6 100644 --- a/src/System.Net.Sockets/src/System.Net.Sockets.csproj +++ b/src/System.Net.Sockets/src/System.Net.Sockets.csproj @@ -244,7 +244,7 @@ </Compile> </ItemGroup> <!-- Windows : Win32 only --> - <ItemGroup Condition="'$(TargetsWindows)' == 'true' AND '$(EnableWinRT)' != 'true'"> + <ItemGroup Condition="'$(TargetsWindows)' == 'true' AND '$(TargetGroup)' != 'uap'"> <Compile Include="$(CommonPath)\Interop\Windows\kernel32\Interop.SetFileCompletionNotificationModes.cs"> <Link>Interop\Windows\kernel32\Interop.SetFileCompletionNotificationModes.cs</Link> </Compile> @@ -256,7 +256,7 @@ </Compile> </ItemGroup> <!-- Windows : Win32 + WinRT --> - <ItemGroup Condition="'$(TargetsWindows)' == 'true' AND '$(EnableWinRT)' == 'true'"> + <ItemGroup Condition="'$(TargetsWindows)' == 'true' AND '$(TargetGroup)' == 'uap'"> <Compile Include="$(CommonPath)\System\Net\ContextAwareResult.Uap.cs"> <Link>Common\System\Net\ContextAwareResult.Uap.cs</Link> </Compile> diff --git a/src/System.Net.Sockets/src/System/Net/Sockets/NetworkStream.cs b/src/System.Net.Sockets/src/System/Net/Sockets/NetworkStream.cs index 40083ea612..0111bfd663 100644 --- a/src/System.Net.Sockets/src/System/Net/Sockets/NetworkStream.cs +++ b/src/System.Net.Sockets/src/System/Net/Sockets/NetworkStream.cs @@ -442,10 +442,7 @@ namespace System.Net.Sockets // Returns: // // An IASyncResult, representing the read. -#if !netcore50 - override -#endif - public IAsyncResult BeginRead(byte[] buffer, int offset, int size, AsyncCallback callback, Object state) + public override IAsyncResult BeginRead(byte[] buffer, int offset, int size, AsyncCallback callback, Object state) { #if DEBUG using (DebugThreadTracking.SetThreadKind(ThreadKinds.User | ThreadKinds.Async)) @@ -504,10 +501,7 @@ namespace System.Net.Sockets // Returns: // // The number of bytes read. May throw an exception. -#if !netcore50 - override -#endif - public int EndRead(IAsyncResult asyncResult) + public override int EndRead(IAsyncResult asyncResult) { #if DEBUG using (DebugThreadTracking.SetThreadKind(ThreadKinds.User)) @@ -553,10 +547,7 @@ namespace System.Net.Sockets // Returns: // // An IASyncResult, representing the write. -#if !netcore50 - override -#endif - public IAsyncResult BeginWrite(byte[] buffer, int offset, int size, AsyncCallback callback, Object state) + public override IAsyncResult BeginWrite(byte[] buffer, int offset, int size, AsyncCallback callback, Object state) { #if DEBUG using (DebugThreadTracking.SetThreadKind(ThreadKinds.User | ThreadKinds.Async)) @@ -612,10 +603,7 @@ namespace System.Net.Sockets // This method is called when an async write is completed. All we // do is call through to the core socket EndSend functionality. // Returns: The number of bytes read. May throw an exception. -#if !netcore50 - override -#endif - public void EndWrite(IAsyncResult asyncResult) + public override void EndWrite(IAsyncResult asyncResult) { #if DEBUG using (DebugThreadTracking.SetThreadKind(ThreadKinds.User)) diff --git a/src/System.Net.WebSockets.Client/src/System.Net.WebSockets.Client.csproj b/src/System.Net.WebSockets.Client/src/System.Net.WebSockets.Client.csproj index 5938fb88a0..198a2a2da5 100644 --- a/src/System.Net.WebSockets.Client/src/System.Net.WebSockets.Client.csproj +++ b/src/System.Net.WebSockets.Client/src/System.Net.WebSockets.Client.csproj @@ -9,11 +9,8 @@ <TargetsUnix>true</TargetsUnix> --> </PropertyGroup> - <PropertyGroup Condition="'$(EnableWinRT)' != 'true'"> - <DefineConstants>$(DefineConstants);FEATURE_CORECLR</DefineConstants> - </PropertyGroup> - <PropertyGroup Condition="'$(EnableWinRT)' == 'true'"> - <DefineConstants>$(DefineConstants);NETNATIVE</DefineConstants> + <PropertyGroup> + <DefineConstants Condition="'$(TargetGroup)' == 'uap'">$(DefineConstants);uap</DefineConstants> </PropertyGroup> <!-- Help VS understand available configurations --> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='uap-Windows_NT-Debug|AnyCPU'" /> @@ -41,7 +38,7 @@ <Compile Include="System\Net\WebSockets\WebSocketHandle.Windows.cs" /> </ItemGroup> <!-- Windows : Win32 only --> - <ItemGroup Condition="'$(TargetsWindows)' == 'true' AND '$(EnableWinRT)' != 'true'"> + <ItemGroup Condition="'$(TargetsWindows)' == 'true' AND '$(TargetGroup)' != 'uap'"> <Compile Include="System\Net\WebSockets\WebSocketHandle.Win32.cs" /> <Compile Include="System\Net\WebSockets\WebSocketMessageTypeAdapter.cs" /> <Compile Include="System\Net\WebSockets\WinHttpWebSocket.cs" /> @@ -87,7 +84,7 @@ </Compile> </ItemGroup> <!-- Windows : Win32 + WinRT --> - <ItemGroup Condition="'$(TargetsWindows)' == 'true' AND '$(EnableWinRT)' == 'true'"> + <ItemGroup Condition="'$(TargetsWindows)' == 'true' AND '$(TargetGroup)' == 'uap'"> <Compile Include="System\Net\WebSockets\WebSocketHandle.WinRT.cs" /> <Compile Include="System\Net\WebSockets\WinRTWebSocket.cs" /> </ItemGroup> diff --git a/src/System.Private.DataContractSerialization/src/System.Private.DataContractSerialization.csproj b/src/System.Private.DataContractSerialization/src/System.Private.DataContractSerialization.csproj index 76ed2ffc39..0d99dd4e33 100644 --- a/src/System.Private.DataContractSerialization/src/System.Private.DataContractSerialization.csproj +++ b/src/System.Private.DataContractSerialization/src/System.Private.DataContractSerialization.csproj @@ -11,7 +11,7 @@ <DebugSymbols>true</DebugSymbols> <PlatformTarget>AnyCPU</PlatformTarget> <DefineConstants>$(DefineConstants);FEATURE_SERIALIZATION</DefineConstants> - <DefineConstants Condition="'$(TargetGroup)'=='uapaot'">$(DefineConstants);NET_NATIVE</DefineConstants> + <DefineConstants Condition="'$(TargetGroup)' == 'uapaot'">$(DefineConstants);uapaot</DefineConstants> <!-- We do not want to block reflection for this assembly --> <BlockReflectionAttribute Condition="'$(TargetGroup)'=='uapaot'">false</BlockReflectionAttribute> </PropertyGroup> @@ -27,7 +27,6 @@ <JsonSources>System\Runtime\Serialization\Json</JsonSources> <XmlSources>System\Xml</XmlSources> <TextSources>System\Text</TextSources> - <NetNative>$(DefineConstants.Contains('NET_NATIVE'))</NetNative> </PropertyGroup> <ItemGroup> <Compile Include="$(CommonPath)\System\HResults.cs"> @@ -54,7 +53,7 @@ <Compile Include="$(RuntimeSerializationSources)\Globals.cs" /> <Compile Include="$(RuntimeSerializationSources)\GenericParameterDataContract.cs" /> <Compile Include="$(RuntimeSerializationSources)\HybridObjectCache.cs" /> - <Compile Include="$(RuntimeSerializationSources)\InvalidDataContract.cs" Condition="$(NetNative)" /> + <Compile Include="$(RuntimeSerializationSources)\InvalidDataContract.cs" Condition="'$(TargetGroup)' == 'uapaot'" /> <Compile Include="$(RuntimeSerializationSources)\ObjectToIdCache.cs" /> <Compile Include="$(RuntimeSerializationSources)\ObjectReferenceStack.cs" /> <Compile Include="$(RuntimeSerializationSources)\PrimitiveDataContract.cs" /> @@ -78,7 +77,7 @@ <Compile Include="$(RuntimeSerializationSources)\KnownTypeDataContractResolver.cs" /> <Compile Include="$(RuntimeSerializationSources)\XmlObjectSerializerReadContextComplex.cs" /> <Compile Include="$(RuntimeSerializationSources)\XmlObjectSerializerWriteContextComplex.cs" /> - <Compile Include="$(RuntimeSerializationSources)\BitFlagsGenerator.cs" Condition="!$(NetNative)" /> + <Compile Include="$(RuntimeSerializationSources)\BitFlagsGenerator.cs" Condition="'$(TargetGroup)' != 'uapaot'" /> <Compile Include="$(RuntimeSerializationSources)\DataContractSurrogateCaller.cs" /> <Compile Include="$(RuntimeSerializationSources)\DataContractSerializerExtensions.cs" /> <Compile Include="$(RuntimeSerializationSources)\XmlSerializableServices.cs" /> @@ -143,7 +142,7 @@ <Compile Include="$(JsonSources)\IXmlJsonWriterInitializer.cs" /> <Compile Include="$(JsonSources)\ByteArrayHelperWithString.cs" /> <Compile Include="$(JsonSources)\JsonEncodingStreamWrapper.cs" /> - <Compile Include="$(JsonSources)\JsonFormatGeneratorStatics.cs" Condition="!$(NetNative)" /> + <Compile Include="$(JsonSources)\JsonFormatGeneratorStatics.cs" Condition="'$(TargetGroup)' != 'uapaot'" /> <Compile Include="System\Runtime\Serialization\AccessorBuilder.cs" /> <Compile Include="$(CommonPath)\System\CodeDom\CodeTypeReference.cs" /> <Compile Include="$(CommonPath)\System\CodeDom\CodeTypeReferenceCollection.cs" /> diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ClassDataContract.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ClassDataContract.cs index a8c97faa6c..57e074ab2f 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ClassDataContract.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ClassDataContract.cs @@ -18,7 +18,7 @@ namespace System.Runtime.Serialization using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, DataContract>; using System.Linq; -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot public sealed class ClassDataContract : DataContract #else internal sealed class ClassDataContract : DataContract @@ -36,7 +36,7 @@ namespace System.Runtime.Serialization private bool _isScriptObject; -#if NET_NATIVE +#if uapaot public ClassDataContract() : base(new ClassDataContractCriticalHelper()) { InitClassDataContract(); @@ -129,7 +129,7 @@ namespace System.Runtime.Serialization get { return _helper.ExtensionDataSetMethod; } } -#if !NET_NATIVE +#if !uapaot public override DataContractDictionary KnownDataContracts { get @@ -149,7 +149,7 @@ namespace System.Runtime.Serialization { return _helper.IsNonAttributedType; } } -#if NET_NATIVE +#if uapaot public bool HasDataContract { get @@ -242,7 +242,7 @@ namespace System.Runtime.Serialization return true; } -#if NET_NATIVE +#if uapaot private XmlFormatClassWriterDelegate _xmlFormatWriterDelegate; public XmlFormatClassWriterDelegate XmlFormatWriterDelegate #else @@ -251,7 +251,7 @@ namespace System.Runtime.Serialization { get { -#if NET_NATIVE +#if uapaot if (DataContractSerializer.Option == SerializationOption.CodeGenOnly || (DataContractSerializer.Option == SerializationOption.ReflectionAsBackup && _xmlFormatWriterDelegate != null)) { @@ -274,13 +274,13 @@ namespace System.Runtime.Serialization } set { -#if NET_NATIVE +#if uapaot _xmlFormatWriterDelegate = value; #endif } } -#if NET_NATIVE +#if uapaot private XmlFormatClassReaderDelegate _xmlFormatReaderDelegate; public XmlFormatClassReaderDelegate XmlFormatReaderDelegate #else @@ -289,7 +289,7 @@ namespace System.Runtime.Serialization { get { -#if NET_NATIVE +#if uapaot if (DataContractSerializer.Option == SerializationOption.CodeGenOnly || (DataContractSerializer.Option == SerializationOption.ReflectionAsBackup && _xmlFormatReaderDelegate != null)) { @@ -312,7 +312,7 @@ namespace System.Runtime.Serialization } set { -#if NET_NATIVE +#if uapaot _xmlFormatReaderDelegate = value; #endif } @@ -1361,7 +1361,7 @@ namespace System.Runtime.Serialization internal bool HasDataContract { get { return _hasDataContract; } -#if NET_NATIVE +#if uapaot set { _hasDataContract = value; } #endif } @@ -1551,7 +1551,7 @@ namespace System.Runtime.Serialization internal static DataMemberComparer Singleton = new DataMemberComparer(); } -#if !NET_NATIVE +#if !uapaot /// <summary> /// Get object type for Xml/JsonFormmatReaderGenerator /// </summary> diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/CodeGenerator.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/CodeGenerator.cs index 0fe2f439b0..37215c9ffd 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/CodeGenerator.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/CodeGenerator.cs @@ -13,7 +13,7 @@ using System.IO; using System.Security; using System.Diagnostics; -#if !NET_NATIVE +#if !uapaot namespace System.Runtime.Serialization { internal class CodeGenerator @@ -60,7 +60,7 @@ namespace System.Runtime.Serialization } } -#if !NET_NATIVE +#if !uapaot private static MethodInfo s_objectToString; private static MethodInfo ObjectToString { @@ -124,7 +124,7 @@ namespace System.Runtime.Serialization private enum CodeGenTrace { None, Save, Tron }; private CodeGenTrace _codeGenTrace; -#if !NET_NATIVE +#if !uapaot private LocalBuilder _stringFormatArray; #endif @@ -1620,7 +1620,7 @@ namespace System.Runtime.Serialization If(Cmp.NotEqualTo); } -#if !NET_NATIVE +#if !uapaot internal void BeginWhileCondition() { Label startWhile = DefineLabel(); diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/CollectionDataContract.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/CollectionDataContract.cs index 60d573b4ab..b01fd27fd3 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/CollectionDataContract.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/CollectionDataContract.cs @@ -117,7 +117,7 @@ namespace System.Runtime.Serialization } } -#if NET_NATIVE +#if uapaot public enum CollectionKind : byte #else internal enum CollectionKind : byte @@ -135,7 +135,7 @@ namespace System.Runtime.Serialization Array, } -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot public sealed class CollectionDataContract : DataContract #else internal sealed class CollectionDataContract : DataContract @@ -330,7 +330,7 @@ namespace System.Runtime.Serialization { return _helper.InvalidCollectionInSharedContractMessage; } } -#if NET_NATIVE +#if uapaot private XmlFormatCollectionWriterDelegate _xmlFormatWriterDelegate; public XmlFormatCollectionWriterDelegate XmlFormatWriterDelegate #else @@ -339,7 +339,7 @@ namespace System.Runtime.Serialization { get { -#if NET_NATIVE +#if uapaot if (DataContractSerializer.Option == SerializationOption.CodeGenOnly || (DataContractSerializer.Option == SerializationOption.ReflectionAsBackup && _xmlFormatWriterDelegate != null)) { @@ -362,13 +362,13 @@ namespace System.Runtime.Serialization } set { -#if NET_NATIVE +#if uapaot _xmlFormatWriterDelegate = value; #endif } } -#if NET_NATIVE +#if uapaot private XmlFormatCollectionReaderDelegate _xmlFormatReaderDelegate; public XmlFormatCollectionReaderDelegate XmlFormatReaderDelegate #else @@ -377,7 +377,7 @@ namespace System.Runtime.Serialization { get { -#if NET_NATIVE +#if uapaot if (DataContractSerializer.Option == SerializationOption.CodeGenOnly || (DataContractSerializer.Option == SerializationOption.ReflectionAsBackup && _xmlFormatReaderDelegate != null)) { @@ -400,13 +400,13 @@ namespace System.Runtime.Serialization } set { -#if NET_NATIVE +#if uapaot _xmlFormatReaderDelegate = value; #endif } } -#if NET_NATIVE +#if uapaot private XmlFormatGetOnlyCollectionReaderDelegate _xmlFormatGetOnlyCollectionReaderDelegate; public XmlFormatGetOnlyCollectionReaderDelegate XmlFormatGetOnlyCollectionReaderDelegate #else @@ -415,7 +415,7 @@ namespace System.Runtime.Serialization { get { -#if NET_NATIVE +#if uapaot if (DataContractSerializer.Option == SerializationOption.CodeGenOnly || (DataContractSerializer.Option == SerializationOption.ReflectionAsBackup && _xmlFormatGetOnlyCollectionReaderDelegate != null)) { @@ -443,7 +443,7 @@ namespace System.Runtime.Serialization } set { -#if NET_NATIVE +#if uapaot _xmlFormatGetOnlyCollectionReaderDelegate = value; #endif } @@ -1440,7 +1440,7 @@ namespace System.Runtime.Serialization { // IsGetOnlyCollection value has already been used to create current collectiondatacontract, value can now be reset. context.IsGetOnlyCollection = false; -#if NET_NATIVE +#if uapaot if (XmlFormatGetOnlyCollectionReaderDelegate == null) { throw new InvalidDataContractException(SR.Format(SR.SerializationCodeIsMissingForType, UnderlyingType.ToString())); diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataContract.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataContract.cs index db25b54366..5aa4d0649a 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataContract.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataContract.cs @@ -16,7 +16,7 @@ namespace System.Runtime.Serialization using System.Linq; using Xml.Schema; -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot public abstract class DataContract #else internal abstract class DataContract @@ -59,7 +59,7 @@ namespace System.Runtime.Serialization internal static DataContract GetDataContractFromGeneratedAssembly(Type type) { -#if NET_NATIVE +#if uapaot if (DataContractSerializer.Option == SerializationOption.ReflectionOnly) { return null; @@ -180,7 +180,7 @@ namespace System.Runtime.Serialization DataContractCriticalHelper.ThrowInvalidDataContractException(message, type); } -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot internal DataContractCriticalHelper Helper #else protected DataContractCriticalHelper Helper @@ -216,7 +216,7 @@ namespace System.Runtime.Serialization { return _helper.TypeForInitialization; } } -#if NET_NATIVE +#if uapaot /// <summary> /// Invoked once immediately before attempting to read, permitting additional setup or verification /// </summary> @@ -341,7 +341,7 @@ namespace System.Runtime.Serialization get { return false; } } -#if NET_NATIVE +#if uapaot public bool TypeIsInterface; public bool TypeIsCollectionInterface; public Type GenericTypeDefinition; @@ -406,7 +406,7 @@ namespace System.Runtime.Serialization internal static DataContract GetDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type type) { -#if NET_NATIVE +#if uapaot // The generated serialization assembly uses different ids than the running code. // We should have 'dataContractCache' from 'Type' to 'DataContract', since ids are not used at runtime. id = GetId(typeHandle); @@ -427,7 +427,7 @@ namespace System.Runtime.Serialization internal static DataContract GetGetOnlyCollectionDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type type) { -#if NET_NATIVE +#if uapaot // The generated serialization assembly uses different ids than the running code. // We should have 'dataContractCache' from 'Type' to 'DataContract', since ids are not used at runtime. id = GetId(typeHandle); @@ -1144,7 +1144,7 @@ namespace System.Runtime.Serialization internal virtual DataContractDictionary KnownDataContracts { -#if NET_NATIVE +#if uapaot get; set; #else get { return null; } @@ -2257,7 +2257,7 @@ namespace System.Runtime.Serialization return false; } -#if !NET_NATIVE +#if !uapaot internal static string SanitizeTypeName(string typeName) { return typeName.Replace('.', '_'); diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataContractSerializer.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataContractSerializer.cs index f1b8f24793..060faa7ce9 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataContractSerializer.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataContractSerializer.cs @@ -83,7 +83,7 @@ namespace System.Runtime.Serialization Initialize(type, rootName, rootNamespace, knownTypes, int.MaxValue, false, false, null, false); } -#if NET_NATIVE +#if uapaot public DataContractSerializer(Type type, IEnumerable<Type> knownTypes, int maxItemsInObjectGraph, bool ignoreExtensionDataObject, bool preserveObjectReferences) #else internal DataContractSerializer(Type type, IEnumerable<Type> knownTypes, int maxItemsInObjectGraph, bool ignoreExtensionDataObject, bool preserveObjectReferences) @@ -425,7 +425,7 @@ namespace System.Runtime.Serialization if (dataContractResolver == null) dataContractResolver = this.DataContractResolver; -#if NET_NATIVE +#if uapaot // Give the root contract a chance to initialize or pre-verify the read RootContract.PrepareToRead(xmlReader); #endif diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataMember.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataMember.cs index 7948eef5ca..7fc7055332 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataMember.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataMember.cs @@ -13,7 +13,7 @@ using System.Security; namespace System.Runtime.Serialization { -#if NET_NATIVE +#if uapaot public class DataMember #else internal class DataMember diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/EnumDataContract.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/EnumDataContract.cs index 84263e68ef..7f0897f68e 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/EnumDataContract.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/EnumDataContract.cs @@ -16,7 +16,7 @@ using System.Linq; namespace System.Runtime.Serialization { -#if NET_NATIVE +#if uapaot public sealed class EnumDataContract : DataContract #else internal sealed class EnumDataContract : DataContract diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ExtensionDataObject.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ExtensionDataObject.cs index 5ecd355e49..dbc5d2759a 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ExtensionDataObject.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ExtensionDataObject.cs @@ -13,7 +13,7 @@ namespace System.Runtime.Serialization { private IList<ExtensionDataMember> _members; -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot public ExtensionDataObject() #else internal ExtensionDataObject() @@ -21,7 +21,7 @@ namespace System.Runtime.Serialization { } -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot public IList<ExtensionDataMember> Members #else internal IList<ExtensionDataMember> Members @@ -32,7 +32,7 @@ namespace System.Runtime.Serialization } } -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot public class ExtensionDataMember #else internal class ExtensionDataMember @@ -67,7 +67,7 @@ namespace System.Runtime.Serialization } } -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot public interface IDataNode #else internal interface IDataNode diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ExtensionDataReader.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ExtensionDataReader.cs index f9e7678c6c..daa389c6e6 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ExtensionDataReader.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ExtensionDataReader.cs @@ -530,7 +530,7 @@ namespace System.Runtime.Serialization } } -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot public class AttributeData #else internal class AttributeData @@ -542,7 +542,7 @@ namespace System.Runtime.Serialization public string value; } -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot public class ElementData #else internal class ElementData diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Globals.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Globals.cs index 3636e1826d..edb3205f0a 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Globals.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Globals.cs @@ -519,7 +519,7 @@ namespace System.Runtime.Serialization private static Type s_typeOfXmlDataNode; internal static Type TypeOfXmlDataNode => s_typeOfXmlDataNode ?? (s_typeOfXmlDataNode = typeof (XmlDataNode)); -#if NET_NATIVE +#if uapaot private static Type s_typeOfSafeSerializationManager; private static bool s_typeOfSafeSerializationManagerSet; internal static Type TypeOfSafeSerializationManager diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonClassDataContract.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonClassDataContract.cs index 87f4a75d43..3af456aabb 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonClassDataContract.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonClassDataContract.cs @@ -34,7 +34,7 @@ namespace System.Runtime.Serialization.Json { tempDelegate = new ReflectionJsonClassReader(TraditionalClassDataContract).ReflectionReadClass; } -#if NET_NATIVE +#if uapaot else if (DataContractSerializer.Option == SerializationOption.ReflectionAsBackup) { tempDelegate = JsonDataContract.TryGetReadWriteDelegatesFromGeneratedAssembly(TraditionalClassDataContract)?.ClassReaderDelegate; @@ -46,7 +46,7 @@ namespace System.Runtime.Serialization.Json #endif else { -#if NET_NATIVE +#if uapaot tempDelegate = JsonDataContract.GetReadWriteDelegatesFromGeneratedAssembly(TraditionalClassDataContract).ClassReaderDelegate; #else tempDelegate = new JsonFormatReaderGenerator().GenerateClassReader(TraditionalClassDataContract); @@ -77,7 +77,7 @@ namespace System.Runtime.Serialization.Json { tempDelegate = new ReflectionJsonFormatWriter().ReflectionWriteClass; } -#if NET_NATIVE +#if uapaot else if (DataContractSerializer.Option == SerializationOption.ReflectionAsBackup) { tempDelegate = JsonDataContract.TryGetReadWriteDelegatesFromGeneratedAssembly(TraditionalClassDataContract)?.ClassWriterDelegate; @@ -89,7 +89,7 @@ namespace System.Runtime.Serialization.Json #endif else { -#if NET_NATIVE +#if uapaot tempDelegate = JsonDataContract.GetReadWriteDelegatesFromGeneratedAssembly(TraditionalClassDataContract).ClassWriterDelegate; #else tempDelegate = new JsonFormatWriterGenerator().GenerateClassWriter(TraditionalClassDataContract); diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonCollectionDataContract.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonCollectionDataContract.cs index 2c1b594811..33f643a4ed 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonCollectionDataContract.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonCollectionDataContract.cs @@ -33,7 +33,7 @@ namespace System.Runtime.Serialization.Json { tempDelegate = new ReflectionJsonCollectionReader().ReflectionReadCollection; } -#if NET_NATIVE +#if uapaot else if (DataContractSerializer.Option == SerializationOption.ReflectionAsBackup) { tempDelegate = JsonDataContract.TryGetReadWriteDelegatesFromGeneratedAssembly(TraditionalCollectionDataContract)?.CollectionReaderDelegate; @@ -45,7 +45,7 @@ namespace System.Runtime.Serialization.Json #endif else { -#if NET_NATIVE +#if uapaot tempDelegate = JsonDataContract.GetReadWriteDelegatesFromGeneratedAssembly(TraditionalCollectionDataContract).CollectionReaderDelegate; #else tempDelegate = new JsonFormatReaderGenerator().GenerateCollectionReader(TraditionalCollectionDataContract); @@ -82,7 +82,7 @@ namespace System.Runtime.Serialization.Json { tempDelegate = new ReflectionJsonCollectionReader().ReflectionReadGetOnlyCollection; } -#if NET_NATIVE +#if uapaot else if (DataContractSerializer.Option == SerializationOption.ReflectionAsBackup) { tempDelegate = JsonDataContract.TryGetReadWriteDelegatesFromGeneratedAssembly(TraditionalCollectionDataContract)?.GetOnlyCollectionReaderDelegate; @@ -94,7 +94,7 @@ namespace System.Runtime.Serialization.Json #endif else { -#if NET_NATIVE +#if uapaot tempDelegate = JsonDataContract.GetReadWriteDelegatesFromGeneratedAssembly(TraditionalCollectionDataContract).GetOnlyCollectionReaderDelegate; #else tempDelegate = new JsonFormatReaderGenerator().GenerateGetOnlyCollectionReader(TraditionalCollectionDataContract); @@ -125,7 +125,7 @@ namespace System.Runtime.Serialization.Json { tempDelegate = new ReflectionJsonFormatWriter().ReflectionWriteCollection; } -#if NET_NATIVE +#if uapaot else if (DataContractSerializer.Option == SerializationOption.ReflectionAsBackup) { tempDelegate = JsonDataContract.TryGetReadWriteDelegatesFromGeneratedAssembly(TraditionalCollectionDataContract)?.CollectionWriterDelegate; @@ -137,7 +137,7 @@ namespace System.Runtime.Serialization.Json #endif else { -#if NET_NATIVE +#if uapaot tempDelegate = JsonDataContract.GetReadWriteDelegatesFromGeneratedAssembly(TraditionalCollectionDataContract).CollectionWriterDelegate; #else tempDelegate = new JsonFormatWriterGenerator().GenerateCollectionWriter(TraditionalCollectionDataContract); diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonDataContract.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonDataContract.cs index 6c65bb4b13..47aef6a92f 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonDataContract.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonDataContract.cs @@ -38,7 +38,7 @@ namespace System.Runtime.Serialization.Json // with the restructuring for multi-file, this is no longer true - instead // this has become a normal method JsonReadWriteDelegates result; -#if NET_NATIVE +#if uapaot // The c passed in could be a clone which is different from the original key, // We'll need to get the original key data contract from generated assembly. DataContract keyDc = (c?.UnderlyingType != null) ? @@ -318,7 +318,7 @@ namespace System.Runtime.Serialization.Json } } -#if NET_NATIVE +#if uapaot public class JsonReadWriteDelegates #else internal class JsonReadWriteDelegates diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonFormatReaderGenerator.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonFormatReaderGenerator.cs index 1df308c664..7a998b5e96 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonFormatReaderGenerator.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonFormatReaderGenerator.cs @@ -5,7 +5,7 @@ using System; using System.Xml; -#if NET_NATIVE +#if uapaot namespace System.Runtime.Serialization.Json { public delegate object JsonFormatClassReaderDelegate(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContextComplexJson context, XmlDictionaryString emptyDictionaryString, XmlDictionaryString[] memberNames); diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonFormatWriterGenerator.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonFormatWriterGenerator.cs index 3bac5d0e49..3a5ddb404b 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonFormatWriterGenerator.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonFormatWriterGenerator.cs @@ -5,7 +5,7 @@ using System; using System.Xml; -#if NET_NATIVE +#if uapaot namespace System.Runtime.Serialization.Json { public delegate void JsonFormatClassWriterDelegate(XmlWriterDelegator xmlWriter, object obj, XmlObjectSerializerWriteContextComplexJson context, ClassDataContract dataContract, XmlDictionaryString[] memberNames); diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlObjectSerializerReadContextComplexJson.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlObjectSerializerReadContextComplexJson.cs index caaa42c90b..e896dfd6c2 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlObjectSerializerReadContextComplexJson.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlObjectSerializerReadContextComplexJson.cs @@ -14,7 +14,7 @@ using System.Diagnostics; namespace System.Runtime.Serialization.Json { -#if NET_NATIVE +#if uapaot public class XmlObjectSerializerReadContextComplexJson : XmlObjectSerializerReadContextComplex #else internal class XmlObjectSerializerReadContextComplexJson : XmlObjectSerializerReadContextComplex @@ -355,7 +355,7 @@ namespace System.Runtime.Serialization.Json return name; } -#if !NET_NATIVE +#if !uapaot public static void ThrowDuplicateMemberException(object obj, XmlDictionaryString[] memberNames, int memberIndex) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SerializationException( diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlObjectSerializerWriteContextComplexJson.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlObjectSerializerWriteContextComplexJson.cs index b7aa8d4d29..a19b7605aa 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlObjectSerializerWriteContextComplexJson.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlObjectSerializerWriteContextComplexJson.cs @@ -13,7 +13,7 @@ using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml. namespace System.Runtime.Serialization.Json { -#if NET_NATIVE +#if uapaot public class XmlObjectSerializerWriteContextComplexJson : XmlObjectSerializerWriteContextComplex #else internal class XmlObjectSerializerWriteContextComplexJson : XmlObjectSerializerWriteContextComplex diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/KnownTypeDataContractResolver.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/KnownTypeDataContractResolver.cs index dc462b6e04..652f697dd4 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/KnownTypeDataContractResolver.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/KnownTypeDataContractResolver.cs @@ -7,7 +7,7 @@ using System.Reflection; namespace System.Runtime.Serialization { -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot public sealed class KnownTypeDataContractResolver : DataContractResolver #else internal sealed class KnownTypeDataContractResolver : DataContractResolver diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/PrimitiveDataContract.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/PrimitiveDataContract.cs index d4cb7cbc88..787ec1cdad 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/PrimitiveDataContract.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/PrimitiveDataContract.cs @@ -11,7 +11,7 @@ using System.Xml; namespace System.Runtime.Serialization { -#if NET_NATIVE +#if uapaot public abstract class PrimitiveDataContract : DataContract #else internal abstract class PrimitiveDataContract : DataContract @@ -152,7 +152,7 @@ namespace System.Runtime.Serialization } } -#if NET_NATIVE +#if uapaot public class CharDataContract : PrimitiveDataContract #else internal class CharDataContract : PrimitiveDataContract @@ -186,7 +186,7 @@ namespace System.Runtime.Serialization } } -#if NET_NATIVE +#if uapaot public class AsmxCharDataContract : CharDataContract #else internal class AsmxCharDataContract : CharDataContract @@ -195,7 +195,7 @@ namespace System.Runtime.Serialization internal AsmxCharDataContract() : base(DictionaryGlobals.CharLocalName, DictionaryGlobals.AsmxTypesNamespace) { } } -#if NET_NATIVE +#if uapaot public class BooleanDataContract : PrimitiveDataContract #else internal class BooleanDataContract : PrimitiveDataContract @@ -225,7 +225,7 @@ namespace System.Runtime.Serialization } } -#if NET_NATIVE +#if uapaot public class SignedByteDataContract : PrimitiveDataContract #else internal class SignedByteDataContract : PrimitiveDataContract @@ -255,7 +255,7 @@ namespace System.Runtime.Serialization } } -#if NET_NATIVE +#if uapaot public class UnsignedByteDataContract : PrimitiveDataContract #else internal class UnsignedByteDataContract : PrimitiveDataContract @@ -285,7 +285,7 @@ namespace System.Runtime.Serialization } } -#if NET_NATIVE +#if uapaot public class ShortDataContract : PrimitiveDataContract #else internal class ShortDataContract : PrimitiveDataContract @@ -315,7 +315,7 @@ namespace System.Runtime.Serialization } } -#if NET_NATIVE +#if uapaot public class UnsignedShortDataContract : PrimitiveDataContract #else internal class UnsignedShortDataContract : PrimitiveDataContract @@ -384,7 +384,7 @@ namespace System.Runtime.Serialization } } -#if NET_NATIVE +#if uapaot public class IntDataContract : PrimitiveDataContract #else internal class IntDataContract : PrimitiveDataContract @@ -414,7 +414,7 @@ namespace System.Runtime.Serialization } } -#if NET_NATIVE +#if uapaot public class UnsignedIntDataContract : PrimitiveDataContract #else internal class UnsignedIntDataContract : PrimitiveDataContract @@ -444,7 +444,7 @@ namespace System.Runtime.Serialization } } -#if NET_NATIVE +#if uapaot public class LongDataContract : PrimitiveDataContract #else internal class LongDataContract : PrimitiveDataContract @@ -478,7 +478,7 @@ namespace System.Runtime.Serialization } } -#if NET_NATIVE +#if uapaot public class IntegerDataContract : LongDataContract #else internal class IntegerDataContract : LongDataContract @@ -487,7 +487,7 @@ namespace System.Runtime.Serialization internal IntegerDataContract() : base(DictionaryGlobals.integerLocalName, DictionaryGlobals.SchemaNamespace) { } } -#if NET_NATIVE +#if uapaot public class PositiveIntegerDataContract : LongDataContract #else internal class PositiveIntegerDataContract : LongDataContract @@ -496,7 +496,7 @@ namespace System.Runtime.Serialization internal PositiveIntegerDataContract() : base(DictionaryGlobals.positiveIntegerLocalName, DictionaryGlobals.SchemaNamespace) { } } -#if NET_NATIVE +#if uapaot public class NegativeIntegerDataContract : LongDataContract #else internal class NegativeIntegerDataContract : LongDataContract @@ -505,7 +505,7 @@ namespace System.Runtime.Serialization internal NegativeIntegerDataContract() : base(DictionaryGlobals.negativeIntegerLocalName, DictionaryGlobals.SchemaNamespace) { } } -#if NET_NATIVE +#if uapaot public class NonPositiveIntegerDataContract : LongDataContract #else internal class NonPositiveIntegerDataContract : LongDataContract @@ -514,7 +514,7 @@ namespace System.Runtime.Serialization internal NonPositiveIntegerDataContract() : base(DictionaryGlobals.nonPositiveIntegerLocalName, DictionaryGlobals.SchemaNamespace) { } } -#if NET_NATIVE +#if uapaot public class NonNegativeIntegerDataContract : LongDataContract #else internal class NonNegativeIntegerDataContract : LongDataContract @@ -523,7 +523,7 @@ namespace System.Runtime.Serialization internal NonNegativeIntegerDataContract() : base(DictionaryGlobals.nonNegativeIntegerLocalName, DictionaryGlobals.SchemaNamespace) { } } -#if NET_NATIVE +#if uapaot public class UnsignedLongDataContract : PrimitiveDataContract #else internal class UnsignedLongDataContract : PrimitiveDataContract @@ -553,7 +553,7 @@ namespace System.Runtime.Serialization } } -#if NET_NATIVE +#if uapaot public class FloatDataContract : PrimitiveDataContract #else internal class FloatDataContract : PrimitiveDataContract @@ -583,7 +583,7 @@ namespace System.Runtime.Serialization } } -#if NET_NATIVE +#if uapaot public class DoubleDataContract : PrimitiveDataContract #else internal class DoubleDataContract : PrimitiveDataContract @@ -613,7 +613,7 @@ namespace System.Runtime.Serialization } } -#if NET_NATIVE +#if uapaot public class DecimalDataContract : PrimitiveDataContract #else internal class DecimalDataContract : PrimitiveDataContract @@ -643,7 +643,7 @@ namespace System.Runtime.Serialization } } -#if NET_NATIVE +#if uapaot public class DateTimeDataContract : PrimitiveDataContract #else internal class DateTimeDataContract : PrimitiveDataContract @@ -673,7 +673,7 @@ namespace System.Runtime.Serialization } } -#if NET_NATIVE +#if uapaot public class StringDataContract : PrimitiveDataContract #else internal class StringDataContract : PrimitiveDataContract @@ -713,7 +713,7 @@ namespace System.Runtime.Serialization } } -#if NET_NATIVE +#if uapaot public class TimeDataContract : StringDataContract #else internal class TimeDataContract : StringDataContract @@ -722,7 +722,7 @@ namespace System.Runtime.Serialization internal TimeDataContract() : base(DictionaryGlobals.timeLocalName, DictionaryGlobals.SchemaNamespace) { } } -#if NET_NATIVE +#if uapaot public class DateDataContract : StringDataContract #else internal class DateDataContract : StringDataContract @@ -736,7 +736,7 @@ namespace System.Runtime.Serialization internal HexBinaryDataContract() : base(DictionaryGlobals.hexBinaryLocalName, DictionaryGlobals.SchemaNamespace) { } } -#if NET_NATIVE +#if uapaot public class GYearMonthDataContract : StringDataContract #else internal class GYearMonthDataContract : StringDataContract @@ -745,7 +745,7 @@ namespace System.Runtime.Serialization internal GYearMonthDataContract() : base(DictionaryGlobals.gYearMonthLocalName, DictionaryGlobals.SchemaNamespace) { } } -#if NET_NATIVE +#if uapaot public class GYearDataContract : StringDataContract #else internal class GYearDataContract : StringDataContract @@ -754,7 +754,7 @@ namespace System.Runtime.Serialization internal GYearDataContract() : base(DictionaryGlobals.gYearLocalName, DictionaryGlobals.SchemaNamespace) { } } -#if NET_NATIVE +#if uapaot public class GMonthDayDataContract : StringDataContract #else internal class GMonthDayDataContract : StringDataContract @@ -763,7 +763,7 @@ namespace System.Runtime.Serialization internal GMonthDayDataContract() : base(DictionaryGlobals.gMonthDayLocalName, DictionaryGlobals.SchemaNamespace) { } } -#if NET_NATIVE +#if uapaot public class GDayDataContract : StringDataContract #else internal class GDayDataContract : StringDataContract @@ -772,7 +772,7 @@ namespace System.Runtime.Serialization internal GDayDataContract() : base(DictionaryGlobals.gDayLocalName, DictionaryGlobals.SchemaNamespace) { } } -#if NET_NATIVE +#if uapaot public class GMonthDataContract : StringDataContract #else internal class GMonthDataContract : StringDataContract @@ -781,7 +781,7 @@ namespace System.Runtime.Serialization internal GMonthDataContract() : base(DictionaryGlobals.gMonthLocalName, DictionaryGlobals.SchemaNamespace) { } } -#if NET_NATIVE +#if uapaot public class NormalizedStringDataContract : StringDataContract #else internal class NormalizedStringDataContract : StringDataContract @@ -790,7 +790,7 @@ namespace System.Runtime.Serialization internal NormalizedStringDataContract() : base(DictionaryGlobals.normalizedStringLocalName, DictionaryGlobals.SchemaNamespace) { } } -#if NET_NATIVE +#if uapaot public class TokenDataContract : StringDataContract #else internal class TokenDataContract : StringDataContract @@ -799,7 +799,7 @@ namespace System.Runtime.Serialization internal TokenDataContract() : base(DictionaryGlobals.tokenLocalName, DictionaryGlobals.SchemaNamespace) { } } -#if NET_NATIVE +#if uapaot public class LanguageDataContract : StringDataContract #else internal class LanguageDataContract : StringDataContract @@ -808,7 +808,7 @@ namespace System.Runtime.Serialization internal LanguageDataContract() : base(DictionaryGlobals.languageLocalName, DictionaryGlobals.SchemaNamespace) { } } -#if NET_NATIVE +#if uapaot public class NameDataContract : StringDataContract #else internal class NameDataContract : StringDataContract @@ -817,7 +817,7 @@ namespace System.Runtime.Serialization internal NameDataContract() : base(DictionaryGlobals.NameLocalName, DictionaryGlobals.SchemaNamespace) { } } -#if NET_NATIVE +#if uapaot public class NCNameDataContract : StringDataContract #else internal class NCNameDataContract : StringDataContract @@ -826,7 +826,7 @@ namespace System.Runtime.Serialization internal NCNameDataContract() : base(DictionaryGlobals.NCNameLocalName, DictionaryGlobals.SchemaNamespace) { } } -#if NET_NATIVE +#if uapaot public class IDDataContract : StringDataContract #else internal class IDDataContract : StringDataContract @@ -835,7 +835,7 @@ namespace System.Runtime.Serialization internal IDDataContract() : base(DictionaryGlobals.XSDIDLocalName, DictionaryGlobals.SchemaNamespace) { } } -#if NET_NATIVE +#if uapaot public class IDREFDataContract : StringDataContract #else internal class IDREFDataContract : StringDataContract @@ -844,7 +844,7 @@ namespace System.Runtime.Serialization internal IDREFDataContract() : base(DictionaryGlobals.IDREFLocalName, DictionaryGlobals.SchemaNamespace) { } } -#if NET_NATIVE +#if uapaot public class IDREFSDataContract : StringDataContract #else internal class IDREFSDataContract : StringDataContract @@ -853,7 +853,7 @@ namespace System.Runtime.Serialization internal IDREFSDataContract() : base(DictionaryGlobals.IDREFSLocalName, DictionaryGlobals.SchemaNamespace) { } } -#if NET_NATIVE +#if uapaot public class ENTITYDataContract : StringDataContract #else internal class ENTITYDataContract : StringDataContract @@ -862,7 +862,7 @@ namespace System.Runtime.Serialization internal ENTITYDataContract() : base(DictionaryGlobals.ENTITYLocalName, DictionaryGlobals.SchemaNamespace) { } } -#if NET_NATIVE +#if uapaot public class ENTITIESDataContract : StringDataContract #else internal class ENTITIESDataContract : StringDataContract @@ -871,7 +871,7 @@ namespace System.Runtime.Serialization internal ENTITIESDataContract() : base(DictionaryGlobals.ENTITIESLocalName, DictionaryGlobals.SchemaNamespace) { } } -#if NET_NATIVE +#if uapaot public class NMTOKENDataContract : StringDataContract #else internal class NMTOKENDataContract : StringDataContract @@ -880,7 +880,7 @@ namespace System.Runtime.Serialization internal NMTOKENDataContract() : base(DictionaryGlobals.NMTOKENLocalName, DictionaryGlobals.SchemaNamespace) { } } -#if NET_NATIVE +#if uapaot public class NMTOKENSDataContract : StringDataContract #else internal class NMTOKENSDataContract : StringDataContract @@ -889,7 +889,7 @@ namespace System.Runtime.Serialization internal NMTOKENSDataContract() : base(DictionaryGlobals.NMTOKENSLocalName, DictionaryGlobals.SchemaNamespace) { } } -#if NET_NATIVE +#if uapaot public class ByteArrayDataContract : PrimitiveDataContract #else internal class ByteArrayDataContract : PrimitiveDataContract @@ -927,7 +927,7 @@ namespace System.Runtime.Serialization } } -#if NET_NATIVE +#if uapaot public class ObjectDataContract : PrimitiveDataContract #else internal class ObjectDataContract : PrimitiveDataContract @@ -982,7 +982,7 @@ namespace System.Runtime.Serialization } } -#if NET_NATIVE +#if uapaot public class TimeSpanDataContract : PrimitiveDataContract #else internal class TimeSpanDataContract : PrimitiveDataContract @@ -1016,7 +1016,7 @@ namespace System.Runtime.Serialization } } -#if NET_NATIVE +#if uapaot public class XsDurationDataContract : TimeSpanDataContract #else internal class XsDurationDataContract : TimeSpanDataContract @@ -1025,7 +1025,7 @@ namespace System.Runtime.Serialization public XsDurationDataContract() : base(DictionaryGlobals.TimeSpanLocalName, DictionaryGlobals.SchemaNamespace) { } } -#if NET_NATIVE +#if uapaot public class GuidDataContract : PrimitiveDataContract #else internal class GuidDataContract : PrimitiveDataContract @@ -1059,7 +1059,7 @@ namespace System.Runtime.Serialization } } -#if NET_NATIVE +#if uapaot public class AsmxGuidDataContract : GuidDataContract #else internal class AsmxGuidDataContract : GuidDataContract @@ -1068,7 +1068,7 @@ namespace System.Runtime.Serialization internal AsmxGuidDataContract() : base(DictionaryGlobals.GuidLocalName, DictionaryGlobals.AsmxTypesNamespace) { } } -#if NET_NATIVE +#if uapaot public class UriDataContract : PrimitiveDataContract #else internal class UriDataContract : PrimitiveDataContract @@ -1104,7 +1104,7 @@ namespace System.Runtime.Serialization } } -#if NET_NATIVE +#if uapaot public class QNameDataContract : PrimitiveDataContract #else internal class QNameDataContract : PrimitiveDataContract diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/SerializationMode.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/SerializationMode.cs index e4001fdbbf..114e89f895 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/SerializationMode.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/SerializationMode.cs @@ -7,7 +7,7 @@ namespace System.Runtime.Serialization internal enum SerializationMode { SharedContract, -#if NET_NATIVE +#if uapaot SharedType #endif } diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlDataContract.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlDataContract.cs index ad4181c58e..c318c5acc3 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlDataContract.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlDataContract.cs @@ -15,7 +15,7 @@ namespace System.Runtime.Serialization using System.Security; using System.Linq; -#if NET_NATIVE +#if uapaot public delegate IXmlSerializable CreateXmlSerializableDelegate(); public sealed class XmlDataContract : DataContract #else @@ -84,14 +84,14 @@ namespace System.Runtime.Serialization { _helper.TopLevelElementNamespace = value; } } -#if NET_NATIVE +#if uapaot private CreateXmlSerializableDelegate _createXmlSerializableDelegate; public CreateXmlSerializableDelegate CreateXmlSerializableDelegate #else internal CreateXmlSerializableDelegate CreateXmlSerializableDelegate #endif { -#if !NET_NATIVE +#if !uapaot get { // We create XmlSerializableDelegate via CodeGen when CodeGen is enabled; @@ -268,7 +268,7 @@ namespace System.Runtime.Serialization return ctor; } -#if !NET_NATIVE +#if !uapaot internal CreateXmlSerializableDelegate GenerateCreateXmlSerializableDelegate() { Type type = this.UnderlyingType; diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlFormatGeneratorStatics.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlFormatGeneratorStatics.cs index d64820a332..f0de995ab0 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlFormatGeneratorStatics.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlFormatGeneratorStatics.cs @@ -915,7 +915,7 @@ namespace System.Runtime.Serialization } } -#if !NET_NATIVE +#if !uapaot private static MethodInfo s_getTypeHandleMethod; internal static MethodInfo GetTypeHandleMethod { diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlFormatReaderGenerator.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlFormatReaderGenerator.cs index a36f736368..eeadb4d2e3 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlFormatReaderGenerator.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlFormatReaderGenerator.cs @@ -14,7 +14,7 @@ using System.Security; namespace System.Runtime.Serialization { -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot public delegate object XmlFormatClassReaderDelegate(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, XmlDictionaryString[] memberNames, XmlDictionaryString[] memberNamespaces); public delegate object XmlFormatCollectionReaderDelegate(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, XmlDictionaryString itemName, XmlDictionaryString itemNamespace, CollectionDataContract collectionContract); public delegate void XmlFormatGetOnlyCollectionReaderDelegate(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, XmlDictionaryString itemName, XmlDictionaryString itemNamespace, CollectionDataContract collectionContract); @@ -57,7 +57,7 @@ namespace System.Runtime.Serialization /// </SecurityNote> private class CriticalHelper { -#if !NET_NATIVE +#if !uapaot private CodeGenerator _ilg; private LocalBuilder _objectLocal; private Type _objectType; @@ -74,7 +74,7 @@ namespace System.Runtime.Serialization { return new ReflectionXmlClassReader(classContract).ReflectionReadClass; } -#if NET_NATIVE +#if uapaot else if (DataContractSerializer.Option == SerializationOption.ReflectionAsBackup) { return new ReflectionXmlClassReader(classContract).ReflectionReadClass; @@ -82,7 +82,7 @@ namespace System.Runtime.Serialization #endif else { -#if NET_NATIVE +#if uapaot throw new InvalidOperationException("Cannot generate class reader"); #else _ilg = new CodeGenerator(); @@ -159,7 +159,7 @@ namespace System.Runtime.Serialization { return new ReflectionXmlCollectionReader().ReflectionReadCollection; } -#if NET_NATIVE +#if uapaot else if (DataContractSerializer.Option == SerializationOption.ReflectionAsBackup) { return new ReflectionXmlCollectionReader().ReflectionReadCollection; @@ -167,7 +167,7 @@ namespace System.Runtime.Serialization #endif else { -#if NET_NATIVE +#if uapaot throw new InvalidOperationException("Cannot generate class reader"); #else _ilg = GenerateCollectionReaderHelper(collectionContract, false /*isGetOnlyCollection*/); @@ -185,7 +185,7 @@ namespace System.Runtime.Serialization { return new ReflectionXmlCollectionReader().ReflectionReadGetOnlyCollection; } -#if NET_NATIVE +#if uapaot else if (DataContractSerializer.Option == SerializationOption.ReflectionAsBackup) { return new ReflectionXmlCollectionReader().ReflectionReadGetOnlyCollection; @@ -193,7 +193,7 @@ namespace System.Runtime.Serialization #endif else { -#if NET_NATIVE +#if uapaot throw new InvalidOperationException("Cannot generate class reader"); #else _ilg = GenerateCollectionReaderHelper(collectionContract, true /*isGetOnlyCollection*/); @@ -203,7 +203,7 @@ namespace System.Runtime.Serialization } } -#if !NET_NATIVE +#if !uapaot private CodeGenerator GenerateCollectionReaderHelper(CollectionDataContract collectionContract, bool isGetOnlyCollection) { _ilg = new CodeGenerator(); diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlFormatWriterGenerator.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlFormatWriterGenerator.cs index b45d407274..999b73388c 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlFormatWriterGenerator.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlFormatWriterGenerator.cs @@ -15,7 +15,7 @@ using System.Security; namespace System.Runtime.Serialization { -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot public delegate void XmlFormatClassWriterDelegate(XmlWriterDelegator xmlWriter, object obj, XmlObjectSerializerWriteContext context, ClassDataContract dataContract); public delegate void XmlFormatCollectionWriterDelegate(XmlWriterDelegator xmlWriter, object obj, XmlObjectSerializerWriteContext context, CollectionDataContract dataContract); public sealed class XmlFormatWriterGenerator @@ -49,7 +49,7 @@ namespace System.Runtime.Serialization /// </SecurityNote> private class CriticalHelper { -#if !USE_REFEMIT && !NET_NATIVE +#if !USE_REFEMIT && !uapaot private CodeGenerator _ilg; private ArgBuilder _xmlWriterArg; private ArgBuilder _contextArg; @@ -70,7 +70,7 @@ namespace System.Runtime.Serialization { return new ReflectionXmlFormatWriter().ReflectionWriteClass; } -#if NET_NATIVE +#if uapaot else if (DataContractSerializer.Option == SerializationOption.ReflectionAsBackup) { return new ReflectionXmlFormatWriter().ReflectionWriteClass; @@ -78,7 +78,7 @@ namespace System.Runtime.Serialization #endif else { -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot throw new InvalidOperationException("Cannot generate class writer"); #else _ilg = new CodeGenerator(); @@ -111,7 +111,7 @@ namespace System.Runtime.Serialization { return new ReflectionXmlFormatWriter().ReflectionWriteCollection; } -#if NET_NATIVE +#if uapaot else if (DataContractSerializer.Option == SerializationOption.ReflectionAsBackup) { return new ReflectionXmlFormatWriter().ReflectionWriteCollection; @@ -119,7 +119,7 @@ namespace System.Runtime.Serialization #endif else { -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot throw new InvalidOperationException("Cannot generate class writer"); #else _ilg = new CodeGenerator(); @@ -146,7 +146,7 @@ namespace System.Runtime.Serialization } } -#if !USE_REFEMIT && !NET_NATIVE +#if !USE_REFEMIT && !uapaot private void InitArgs(Type objType) { _xmlWriterArg = _ilg.GetArg(0); diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlObjectSerializerContext.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlObjectSerializerContext.cs index dfbd58384c..74a82a14aa 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlObjectSerializerContext.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlObjectSerializerContext.cs @@ -12,7 +12,7 @@ namespace System.Runtime.Serialization using System.Xml; using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, DataContract>; -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot public class XmlObjectSerializerContext #else internal class XmlObjectSerializerContext @@ -248,7 +248,7 @@ namespace System.Runtime.Serialization DataContract dataContract = PrimitiveDataContract.GetPrimitiveDataContract(typeName.Name, typeName.Namespace); if (dataContract == null) { -#if NET_NATIVE +#if uapaot if (typeName.Name == Globals.SafeSerializationManagerName && typeName.Namespace == Globals.SafeSerializationManagerNamespace && Globals.TypeOfSafeSerializationManager != null) { return GetDataContract(Globals.TypeOfSafeSerializationManager); diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlObjectSerializerReadContext.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlObjectSerializerReadContext.cs index 79d1b6c71d..47219393c1 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlObjectSerializerReadContext.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlObjectSerializerReadContext.cs @@ -14,7 +14,7 @@ namespace System.Runtime.Serialization using System.Security; using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, DataContract>; -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot public class XmlObjectSerializerReadContext : XmlObjectSerializerContext #else internal class XmlObjectSerializerReadContext : XmlObjectSerializerContext @@ -267,7 +267,7 @@ namespace System.Runtime.Serialization throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(XmlObjectSerializer.TryAddLineInfo(xmlReader, SR.Format(SR.UnexpectedElementExpectingElements, xmlReader.NodeType, xmlReader.LocalName, xmlReader.NamespaceURI, stringBuilder.ToString())))); } -#if NET_NATIVE +#if uapaot public static void ThrowMissingRequiredMembers(object obj, XmlDictionaryString[] memberNames, byte[] expectedElements, byte[] requiredElements) { StringBuilder stringBuilder = new StringBuilder(); diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlObjectSerializerReadContextComplex.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlObjectSerializerReadContextComplex.cs index 99d9275d8e..1e341bb688 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlObjectSerializerReadContextComplex.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlObjectSerializerReadContextComplex.cs @@ -6,7 +6,7 @@ using System.Reflection; namespace System.Runtime.Serialization { -#if NET_NATIVE +#if uapaot public class XmlObjectSerializerReadContextComplex : XmlObjectSerializerReadContext #else internal class XmlObjectSerializerReadContextComplex : XmlObjectSerializerReadContext diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlObjectSerializerWriteContext.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlObjectSerializerWriteContext.cs index 9bcac95c7b..ce397dcba2 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlObjectSerializerWriteContext.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlObjectSerializerWriteContext.cs @@ -14,13 +14,13 @@ using System.Collections.Generic; using System.Xml.Serialization; using System.Security; using System.Runtime.CompilerServices; -#if !NET_NATIVE +#if !uapaot using ExtensionDataObject = System.Object; #endif namespace System.Runtime.Serialization { -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot public class XmlObjectSerializerWriteContext : XmlObjectSerializerContext #else internal class XmlObjectSerializerWriteContext : XmlObjectSerializerContext @@ -57,7 +57,7 @@ namespace System.Runtime.Serialization _unsafeTypeForwardingEnabled = true; } -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot internal ObjectToIdCache SerializedObjects #else protected ObjectToIdCache SerializedObjects @@ -178,7 +178,7 @@ namespace System.Runtime.Serialization protected virtual void SerializeWithXsiType(XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle objectTypeHandle, Type objectType, int declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declaredType) { bool verifyKnownType = false; -#if !NET_NATIVE +#if !uapaot DataContract dataContract; if (declaredType.IsInterface && CollectionDataContract.IsCollectionInterface(declaredType)) { @@ -263,7 +263,7 @@ namespace System.Runtime.Serialization knownTypesAddedInCurrentScope = true; } -#if !NET_NATIVE +#if !uapaot if (verifyKnownType) { if (!IsKnownType(dataContract, declaredType)) @@ -304,7 +304,7 @@ namespace System.Runtime.Serialization return false; } -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot public virtual void WriteAnyType(XmlWriterDelegator xmlWriter, object value) #else internal virtual void WriteAnyType(XmlWriterDelegator xmlWriter, object value) @@ -313,7 +313,7 @@ namespace System.Runtime.Serialization xmlWriter.WriteAnyType(value); } -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot public virtual void WriteString(XmlWriterDelegator xmlWriter, string value) #else internal virtual void WriteString(XmlWriterDelegator xmlWriter, string value) @@ -321,7 +321,7 @@ namespace System.Runtime.Serialization { xmlWriter.WriteString(value); } -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot public virtual void WriteString(XmlWriterDelegator xmlWriter, string value, XmlDictionaryString name, XmlDictionaryString ns) #else internal virtual void WriteString(XmlWriterDelegator xmlWriter, string value, XmlDictionaryString name, XmlDictionaryString ns) @@ -337,7 +337,7 @@ namespace System.Runtime.Serialization } } -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot public virtual void WriteBase64(XmlWriterDelegator xmlWriter, byte[] value) #else internal virtual void WriteBase64(XmlWriterDelegator xmlWriter, byte[] value) @@ -345,7 +345,7 @@ namespace System.Runtime.Serialization { xmlWriter.WriteBase64(value); } -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot public virtual void WriteBase64(XmlWriterDelegator xmlWriter, byte[] value, XmlDictionaryString name, XmlDictionaryString ns) #else internal virtual void WriteBase64(XmlWriterDelegator xmlWriter, byte[] value, XmlDictionaryString name, XmlDictionaryString ns) @@ -361,7 +361,7 @@ namespace System.Runtime.Serialization } } -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot public virtual void WriteUri(XmlWriterDelegator xmlWriter, Uri value) #else internal virtual void WriteUri(XmlWriterDelegator xmlWriter, Uri value) @@ -369,7 +369,7 @@ namespace System.Runtime.Serialization { xmlWriter.WriteUri(value); } -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot public virtual void WriteUri(XmlWriterDelegator xmlWriter, Uri value, XmlDictionaryString name, XmlDictionaryString ns) #else internal virtual void WriteUri(XmlWriterDelegator xmlWriter, Uri value, XmlDictionaryString name, XmlDictionaryString ns) @@ -385,7 +385,7 @@ namespace System.Runtime.Serialization } } -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot public virtual void WriteQName(XmlWriterDelegator xmlWriter, XmlQualifiedName value) #else internal virtual void WriteQName(XmlWriterDelegator xmlWriter, XmlQualifiedName value) @@ -393,7 +393,7 @@ namespace System.Runtime.Serialization { xmlWriter.WriteQName(value); } -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot public virtual void WriteQName(XmlWriterDelegator xmlWriter, XmlQualifiedName value, XmlDictionaryString name, XmlDictionaryString ns) #else internal virtual void WriteQName(XmlWriterDelegator xmlWriter, XmlQualifiedName value, XmlDictionaryString name, XmlDictionaryString ns) diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlObjectSerializerWriteContextComplex.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlObjectSerializerWriteContextComplex.cs index 2d98774571..9db31b0689 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlObjectSerializerWriteContextComplex.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlObjectSerializerWriteContextComplex.cs @@ -16,7 +16,7 @@ using System.Runtime.CompilerServices; namespace System.Runtime.Serialization { -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot public class XmlObjectSerializerWriteContextComplex : XmlObjectSerializerWriteContext #else internal class XmlObjectSerializerWriteContextComplex : XmlObjectSerializerWriteContext @@ -53,7 +53,7 @@ namespace System.Runtime.Serialization return false; } -#if NET_NATIVE +#if uapaot public override void WriteAnyType(XmlWriterDelegator xmlWriter, object value) #else internal override void WriteAnyType(XmlWriterDelegator xmlWriter, object value) @@ -63,7 +63,7 @@ namespace System.Runtime.Serialization xmlWriter.WriteAnyType(value); } -#if NET_NATIVE +#if uapaot public override void WriteString(XmlWriterDelegator xmlWriter, string value) #else internal override void WriteString(XmlWriterDelegator xmlWriter, string value) @@ -73,7 +73,7 @@ namespace System.Runtime.Serialization xmlWriter.WriteString(value); } -#if NET_NATIVE +#if uapaot public override void WriteString(XmlWriterDelegator xmlWriter, string value, XmlDictionaryString name, XmlDictionaryString ns) #else internal override void WriteString(XmlWriterDelegator xmlWriter, string value, XmlDictionaryString name, XmlDictionaryString ns) @@ -90,7 +90,7 @@ namespace System.Runtime.Serialization } } -#if NET_NATIVE +#if uapaot public override void WriteBase64(XmlWriterDelegator xmlWriter, byte[] value) #else internal override void WriteBase64(XmlWriterDelegator xmlWriter, byte[] value) @@ -100,7 +100,7 @@ namespace System.Runtime.Serialization xmlWriter.WriteBase64(value); } -#if NET_NATIVE +#if uapaot public override void WriteBase64(XmlWriterDelegator xmlWriter, byte[] value, XmlDictionaryString name, XmlDictionaryString ns) #else internal override void WriteBase64(XmlWriterDelegator xmlWriter, byte[] value, XmlDictionaryString name, XmlDictionaryString ns) @@ -117,7 +117,7 @@ namespace System.Runtime.Serialization } } -#if NET_NATIVE +#if uapaot public override void WriteUri(XmlWriterDelegator xmlWriter, Uri value) #else internal override void WriteUri(XmlWriterDelegator xmlWriter, Uri value) @@ -127,7 +127,7 @@ namespace System.Runtime.Serialization xmlWriter.WriteUri(value); } -#if NET_NATIVE +#if uapaot public override void WriteUri(XmlWriterDelegator xmlWriter, Uri value, XmlDictionaryString name, XmlDictionaryString ns) #else internal override void WriteUri(XmlWriterDelegator xmlWriter, Uri value, XmlDictionaryString name, XmlDictionaryString ns) @@ -144,7 +144,7 @@ namespace System.Runtime.Serialization } } -#if NET_NATIVE +#if uapaot public override void WriteQName(XmlWriterDelegator xmlWriter, XmlQualifiedName value) #else internal override void WriteQName(XmlWriterDelegator xmlWriter, XmlQualifiedName value) @@ -154,7 +154,7 @@ namespace System.Runtime.Serialization xmlWriter.WriteQName(value); } -#if NET_NATIVE +#if uapaot public override void WriteQName(XmlWriterDelegator xmlWriter, XmlQualifiedName value, XmlDictionaryString name, XmlDictionaryString ns) #else internal override void WriteQName(XmlWriterDelegator xmlWriter, XmlQualifiedName value, XmlDictionaryString name, XmlDictionaryString ns) diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlReaderDelegator.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlReaderDelegator.cs index 2d049facd4..6acfc8c0f0 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlReaderDelegator.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlReaderDelegator.cs @@ -10,7 +10,7 @@ using System.Xml.Serialization; namespace System.Runtime.Serialization { -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot public class XmlReaderDelegator #else internal class XmlReaderDelegator diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlWriterDelegator.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlWriterDelegator.cs index ce5264445e..94ca7278a1 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlWriterDelegator.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlWriterDelegator.cs @@ -8,7 +8,7 @@ using System.Globalization; namespace System.Runtime.Serialization { -#if USE_REFEMIT || NET_NATIVE +#if USE_REFEMIT || uapaot public class XmlWriterDelegator #else internal class XmlWriterDelegator diff --git a/src/System.Private.Xml/src/System.Private.Xml.csproj b/src/System.Private.Xml/src/System.Private.Xml.csproj index 499baa62da..5f6c457593 100644 --- a/src/System.Private.Xml/src/System.Private.Xml.csproj +++ b/src/System.Private.Xml/src/System.Private.Xml.csproj @@ -7,7 +7,7 @@ <RootNamespace>System.Xml</RootNamespace> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> <NoWarn>$(NoWarn),649</NoWarn> - <!--<DefineConstants Condition="'$(TargetGroup)' == 'uap101aot'">$(DefineConstants);NET_NATIVE</DefineConstants> TODO: Bring this back when uap101aot support is added --> + <DefineConstants Condition="'$(TargetGroup)' == 'uap'">$(DefineConstants);uap</DefineConstants> </PropertyGroup> <!-- Default configurations to help VS understand the configurations --> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Debug|AnyCPU'" /> diff --git a/src/System.Private.Xml/src/System/Xml/Serialization/CodeGenerator.cs b/src/System.Private.Xml/src/System/Xml/Serialization/CodeGenerator.cs index ee897ac2c8..0a2beb5b5b 100644 --- a/src/System.Private.Xml/src/System/Xml/Serialization/CodeGenerator.cs +++ b/src/System.Private.Xml/src/System/Xml/Serialization/CodeGenerator.cs @@ -7,7 +7,7 @@ using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; -#if !NET_NATIVE +#if !uapaot namespace System.Xml.Serialization { using System; diff --git a/src/System.Private.Xml/src/System/Xml/Serialization/Compilation.cs b/src/System.Private.Xml/src/System/Xml/Serialization/Compilation.cs index 78ecf23dca..2d6370866d 100644 --- a/src/System.Private.Xml/src/System/Xml/Serialization/Compilation.cs +++ b/src/System.Private.Xml/src/System/Xml/Serialization/Compilation.cs @@ -49,7 +49,7 @@ namespace System.Xml.Serialization internal TempAssembly(XmlMapping[] xmlMappings, Type[] types, string defaultNamespace, string location) { -#if !NET_NATIVE +#if !uapaot bool containsSoapMapping = false; for (int i = 0; i < xmlMappings.Length; i++) { @@ -232,7 +232,7 @@ namespace System.Xml.Serialization return null; } -#if !NET_NATIVE +#if !uapaot [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2106:SecureAsserts", Justification = "It is safe because the serialization assembly is generated by the framework code, not by the user.")] internal static Assembly GenerateRefEmitAssembly(XmlMapping[] xmlMappings, Type[] types, string defaultNamespace) { diff --git a/src/System.Private.Xml/src/System/Xml/Serialization/SourceInfo.cs b/src/System.Private.Xml/src/System/Xml/Serialization/SourceInfo.cs index 4a25c32b51..87111845ce 100644 --- a/src/System.Private.Xml/src/System/Xml/Serialization/SourceInfo.cs +++ b/src/System.Private.Xml/src/System/Xml/Serialization/SourceInfo.cs @@ -10,7 +10,7 @@ using System.Reflection.Emit; using System.Text.RegularExpressions; using System.Xml.Extensions; -#if !NET_NATIVE +#if !uapaot namespace System.Xml.Serialization { internal class SourceInfo diff --git a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationILGen.cs b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationILGen.cs index 90ebcef915..262a182ca4 100644 --- a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationILGen.cs +++ b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationILGen.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#if !NET_NATIVE +#if !uapaot namespace System.Xml.Serialization { using System; diff --git a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReaderILGen.cs b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReaderILGen.cs index 9e1d88e85e..e53a50925b 100644 --- a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReaderILGen.cs +++ b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReaderILGen.cs @@ -3,7 +3,7 @@ // See the LICENSE file in the project root for more information. -#if !NET_NATIVE +#if !uapaot namespace System.Xml.Serialization { using System; diff --git a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationWriterILGen.cs b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationWriterILGen.cs index c19d75157f..6f86507a40 100644 --- a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationWriterILGen.cs +++ b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationWriterILGen.cs @@ -13,7 +13,7 @@ using System.Text; using System.Xml.Schema; using System.Xml.Extensions; -#if !NET_NATIVE +#if !uapaot namespace System.Xml.Serialization { internal class XmlSerializationWriterILGen : XmlSerializationILGen diff --git a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializer.cs b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializer.cs index 4e07e7cd32..b088cfa547 100644 --- a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializer.cs +++ b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializer.cs @@ -137,7 +137,7 @@ namespace System.Xml.Serialization private Type _primitiveType; private XmlMapping _mapping; private XmlDeserializationEvents _events = new XmlDeserializationEvents(); -#if NET_NATIVE +#if uapaot private XmlSerializer innerSerializer; #endif public string DefaultNamespace = null; @@ -192,7 +192,7 @@ namespace System.Xml.Serialization /// <devdoc> /// <para>[To be supplied.]</para> /// </devdoc> -#if !NET_NATIVE +#if !uapaot public XmlSerializer(Type type, Type[] extraTypes) : this(type, null, extraTypes, null, null, null) #else public XmlSerializer(Type type, Type[] extraTypes) : this(type) @@ -217,7 +217,7 @@ namespace System.Xml.Serialization if (xmlTypeMapping == null) throw new ArgumentNullException(nameof(xmlTypeMapping)); -#if !NET_NATIVE +#if !uapaot _tempAssembly = GenerateTempAssembly(xmlTypeMapping); #endif _mapping = xmlTypeMapping; @@ -249,7 +249,7 @@ namespace System.Xml.Serialization _primitiveType = type; return; } -#if !NET_NATIVE +#if !uapaot _tempAssembly = s_cache[defaultNamespace, type]; if (_tempAssembly == null) { @@ -315,7 +315,7 @@ namespace System.Xml.Serialization DemandForUserLocationOrEvidence(); } -#if !NET_NATIVE +#if !uapaot _tempAssembly = GenerateTempAssembly(_mapping, type, defaultNamespace, location); #endif } @@ -429,7 +429,7 @@ namespace System.Xml.Serialization } SerializePrimitive(xmlWriter, o, namespaces); } -#if !NET_NATIVE +#if !uapaot else if (ShouldUseReflectionBasedSerialization()) { XmlMapping mapping; @@ -576,7 +576,7 @@ namespace System.Xml.Serialization } return DeserializePrimitive(xmlReader, events); } -#if !NET_NATIVE +#if !uapaot else if (ShouldUseReflectionBasedSerialization()) { XmlMapping mapping; @@ -689,7 +689,7 @@ namespace System.Xml.Serialization TypeDesc typeDesc = (TypeDesc)TypeScope.PrimtiveTypes[_primitiveType]; return xmlReader.IsStartElement(typeDesc.DataType.Name, string.Empty); } -#if !NET_NATIVE +#if !uapaot else if (_tempAssembly != null) { return _tempAssembly.CanRead(_mapping, xmlReader); @@ -727,7 +727,7 @@ namespace System.Xml.Serialization { if (mappings == null || mappings.Length == 0) return Array.Empty<XmlSerializer>(); -#if NET_NATIVE +#if uapaot var serializers = new XmlSerializer[mappings.Length]; for(int i=0;i<mappings.Length;i++) { @@ -842,7 +842,7 @@ namespace System.Xml.Serialization if (types == null) return Array.Empty<XmlSerializer>(); -#if NET_NATIVE +#if uapaot var serializers = new XmlSerializer[types.Length]; for (int i = 0; i < types.Length; i++) { @@ -860,7 +860,7 @@ namespace System.Xml.Serialization #endif } -#if NET_NATIVE +#if uapaot // this the global XML serializer contract introduced for multi-file private static XmlSerializerImplementation xmlSerializerContract; diff --git a/src/System.Private.Xml/tests/XmlSerializer/ReflectionOnly/System.Xml.XmlSerializer.ReflectionOnly.Tests.csproj b/src/System.Private.Xml/tests/XmlSerializer/ReflectionOnly/System.Xml.XmlSerializer.ReflectionOnly.Tests.csproj index e00fccadbe..919c472d90 100644 --- a/src/System.Private.Xml/tests/XmlSerializer/ReflectionOnly/System.Xml.XmlSerializer.ReflectionOnly.Tests.csproj +++ b/src/System.Private.Xml/tests/XmlSerializer/ReflectionOnly/System.Xml.XmlSerializer.ReflectionOnly.Tests.csproj @@ -14,7 +14,7 @@ <Compile Include="$(TestSourceFolder)..\XmlSerializerTests.cs" /> <Compile Include="$(TestSourceFolder)..\Performance\XsPerformanceTest.cs" /> </ItemGroup> - <ItemGroup Condition="'$(TargetGroup)' != 'netcore50' AND '$(TargetGroup)' != 'netcore50aot'"> + <ItemGroup Condition="'$(TargetGroup)' != 'uap'"> <Compile Include="$(TestSourceFolder)..\XmlSerializerTests.Internal.cs" Condition="'$(UseContractReferences)' == ''" /> </ItemGroup> <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> diff --git a/src/System.Private.Xml/tests/XmlSerializer/System.Xml.XmlSerializer.Tests.csproj b/src/System.Private.Xml/tests/XmlSerializer/System.Xml.XmlSerializer.Tests.csproj index 3a8200254e..01c3f59c39 100644 --- a/src/System.Private.Xml/tests/XmlSerializer/System.Xml.XmlSerializer.Tests.csproj +++ b/src/System.Private.Xml/tests/XmlSerializer/System.Xml.XmlSerializer.Tests.csproj @@ -4,7 +4,6 @@ <PropertyGroup> <AppDesignerFolder>Properties</AppDesignerFolder> <ProjectGuid>{4050F1D1-1DD2-4B48-A17B-E3F90DD18C4B}</ProjectGuid> - <DefineConstants Condition="'$(TargetGroup)' == 'netcore50' OR '$(TargetGroup)' == 'netcore50aot'">$(DefineConstants);NET_NATIVE</DefineConstants> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Debug|AnyCPU'" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Release|AnyCPU'" /> @@ -17,7 +16,7 @@ <Compile Include="$(TestSourceFolder)XmlSerializerTests.cs" /> <Compile Include="$(TestSourceFolder)Performance\XsPerformanceTest.cs" /> </ItemGroup> - <ItemGroup Condition="'$(TargetGroup)' != 'netcore50' AND '$(TargetGroup)' != 'netcore50aot'"> + <ItemGroup Condition="'$(TargetGroup)' != 'uap'"> <Compile Include="$(TestSourceFolder)XmlSerializerTests.Internal.cs" Condition="'$(UseContractReferences)' == ''" /> </ItemGroup> <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> diff --git a/src/System.Private.Xml/tests/XmlSerializer/System.Xml.XmlSerializer.Tests.settings.targets b/src/System.Private.Xml/tests/XmlSerializer/System.Xml.XmlSerializer.Tests.settings.targets deleted file mode 100644 index a4c547ebfb..0000000000 --- a/src/System.Private.Xml/tests/XmlSerializer/System.Xml.XmlSerializer.Tests.settings.targets +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup> - <MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <OutputType>Library</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <DefineConstants Condition="'$(TargetGroup)' == 'netcore50' OR '$(TargetGroup)' == 'netcore50aot'">$(DefineConstants);NET_NATIVE</DefineConstants> - <NugetTargetMoniker Condition="'$(TargetGroup)' == ''">.NETStandard,Version=v1.7</NugetTargetMoniker> - <NugetTargetMoniker>.NETStandard,Version=v1.7</NugetTargetMoniker> - <TestSourceFolder>$(MSBuildThisFileDirectory)\</TestSourceFolder> - </PropertyGroup> - <PropertyGroup Condition="'$(UseContractReferences)' == 'true'"> - <ProjectJson>Performance/project.json</ProjectJson> - <ProjectLockJson>Performance/project.lock.json</ProjectLockJson> - </PropertyGroup> - <ItemGroup> - <ProjectReference Include="$(TestSourceFolder)..\..\..\System.Private.Xml\pkg\System.Private.Xml.pkgproj" /> - <ProjectReference Include="$(TestSourceFolder)..\..\..\System.Xml.XmlSerializer\pkg\System.Xml.XmlSerializer.pkgproj" /> - </ItemGroup> - <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> -</Project> diff --git a/src/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs b/src/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs index a9b3d279db..6d73660ab8 100644 --- a/src/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs +++ b/src/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs @@ -12,9 +12,6 @@ using System.Text; using System.Threading; using System.Xml; using System.Xml.Linq; -#if !NET_NATIVE -using System.Xml.Schema; -#endif using System.Xml.Serialization; using Xunit; @@ -1524,8 +1521,6 @@ string.Format(@"<?xml version=""1.0"" encoding=""utf-8""?> Assert.Equal(0, serializers.Length); } -#if NET_NATIVE -#endif [Fact] public static void Xml_ConstructorWithXmlRootAttr() { @@ -1541,8 +1536,6 @@ string.Format(@"<?xml version=""1.0"" encoding=""utf-8""?> Assert.True(expected.SequenceEqual(actual)); } -#if NET_NATIVE -#endif [Fact] public static void Xml_ConstructorWithXmlAttributeOverrides() { diff --git a/src/System.Private.Xml/tests/XmlWriter/WriteWithInvalidSurrogate.cs b/src/System.Private.Xml/tests/XmlWriter/WriteWithInvalidSurrogate.cs index 0f5f6104bc..ab9f21a365 100644 --- a/src/System.Private.Xml/tests/XmlWriter/WriteWithInvalidSurrogate.cs +++ b/src/System.Private.Xml/tests/XmlWriter/WriteWithInvalidSurrogate.cs @@ -37,7 +37,7 @@ namespace System.Xml.Tests } [Fact] - [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework | TargetFrameworkMonikers.Netcore50)] // Switch to throw exception was introduced in NetStandard1.7 + [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] // Switch to throw exception was introduced in NetStandard1.7 public static void XmlWriterChecksUpperBoundOfLowerSurrogate_newBehavior() { // Turn the switch off to get the new behavior in case the platform has it on by default diff --git a/src/System.Runtime.Extensions/src/PinvokeAnalyzerExceptionList.analyzerdata b/src/System.Runtime.Extensions/src/PinvokeAnalyzerExceptionList.analyzerdata new file mode 100644 index 0000000000..8af6246000 --- /dev/null +++ b/src/System.Runtime.Extensions/src/PinvokeAnalyzerExceptionList.analyzerdata @@ -0,0 +1,12 @@ +kernel32.dll!ExpandEnvironmentStringsW +kernel32.dll!FreeEnvironmentStringsW +kernel32.dll!GetComputerNameW +kernel32.dll!GetEnvironmentStringsW +kernel32.dll!GetEnvironmentVariableW +kernel32.dll!GetLogicalDrives +kernel32.dll!GetSystemDirectoryW +kernel32.dll!GetVersionExW +kernel32.dll!IsWow64Process +kernel32.dll!SetEnvironmentVariableW +secur32.dll!GetUserNameExW +shell32.dll!SHGetKnownFolderPath
\ No newline at end of file diff --git a/src/System.Runtime.InteropServices.RuntimeInformation/src/Configurations.props b/src/System.Runtime.InteropServices.RuntimeInformation/src/Configurations.props index 2233e1979c..32cab04b83 100644 --- a/src/System.Runtime.InteropServices.RuntimeInformation/src/Configurations.props +++ b/src/System.Runtime.InteropServices.RuntimeInformation/src/Configurations.props @@ -7,7 +7,6 @@ net45-Windows_NT; netfx-Windows_NT; uap-Windows_NT; - uapaot-Windows_NT; netstandard1.1-AnyOS; netstandard1.1-Unix; netstandard1.1-Windows_NT; diff --git a/src/System.Runtime.InteropServices.RuntimeInformation/src/PinvokeAnalyzerExceptionList.analyzerdata b/src/System.Runtime.InteropServices.RuntimeInformation/src/PinvokeAnalyzerExceptionList.analyzerdata new file mode 100644 index 0000000000..98ae555040 --- /dev/null +++ b/src/System.Runtime.InteropServices.RuntimeInformation/src/PinvokeAnalyzerExceptionList.analyzerdata @@ -0,0 +1 @@ +ntdll.dll!RtlGetVersion diff --git a/src/System.Runtime.InteropServices.RuntimeInformation/src/System.Runtime.InteropServices.RuntimeInformation.csproj b/src/System.Runtime.InteropServices.RuntimeInformation/src/System.Runtime.InteropServices.RuntimeInformation.csproj index 29dfa4a3fd..6c1e985635 100644 --- a/src/System.Runtime.InteropServices.RuntimeInformation/src/System.Runtime.InteropServices.RuntimeInformation.csproj +++ b/src/System.Runtime.InteropServices.RuntimeInformation/src/System.Runtime.InteropServices.RuntimeInformation.csproj @@ -6,18 +6,17 @@ <RootNamespace>System.Runtime.InteropServices</RootNamespace> <AssemblyName>System.Runtime.InteropServices.RuntimeInformation</AssemblyName> <ProjectGuid>{1CBC030D-B5D3-4AB5-A9FD-24EC5F6F38D2}</ProjectGuid> - <DefineConstants Condition="'$(TargetGroup)'=='net45' OR '$(TargetGroup)'=='netfx'">netfx</DefineConstants> - <DefineConstants Condition="'$(TargetGroup)'=='wpa81'">wpa81</DefineConstants> - <DefineConstants Condition="'$(TargetGroup)'=='win8'">win8</DefineConstants> - <DefineConstants Condition="'$(TargetGroup)'=='uap'">uap</DefineConstants> - <DefineConstants Condition="'$(TargetGroup)'=='uapaot'">uap;uapaot;netcore50</DefineConstants> + <DefineConstants Condition="'$(TargetGroup)'=='net45' OR '$(TargetGroup)'=='netfx'">$(DefineConstants);netfx</DefineConstants> + <DefineConstants Condition="'$(TargetGroup)'=='wpa81'">$(DefineConstants);wpa81</DefineConstants> + <DefineConstants Condition="'$(TargetGroup)'=='win8'">$(DefineConstants);win8</DefineConstants> + <DefineConstants Condition="'$(TargetGroup)'=='uap'">$(DefineConstants);uap</DefineConstants> <GeneratePlatformNotSupportedAssembly Condition="'$(TargetGroup)'=='netstandard1.1' AND '$(OSGroup)'=='AnyOS'">true</GeneratePlatformNotSupportedAssembly> <!-- use netstandard1.1 refs for win8 and wpa81 --> <RefPath Condition="'$(TargetGroup)'=='wpa81' OR '$(TargetGroup)'=='win8'">$(RefRootPath)/netstandard1.1</RefPath> <!-- Clear runtime for wpa81 & win8: these project types don't use project.json and need to resolve without a runtime --> <PackageTargetRuntime Condition="'$(TargetGroup)'=='wpa81' OR '$(TargetGroup)'=='win8'"> </PackageTargetRuntime> - <ValidPinvokeMappings Condition="'$(TargetGroup)'=='wpa81' OR '$(TargetGroup)'=='win8'">$(MSBuildThisFileDirectory)PinvokeAnalyzer_win8-wpa81-APIs.txt</ValidPinvokeMappings> + <ValidPInvokeMappings Condition="'$(TargetGroup)'=='wpa81' OR '$(TargetGroup)'=='win8'">$(MSBuildThisFileDirectory)PInvokeAnalyzer_win8-wpa81-APIs.txt</ValidPInvokeMappings> </PropertyGroup> <!-- Help VS understand available configurations --> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net45-Windows_NT-Debug|AnyCPU'" /> @@ -36,8 +35,6 @@ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard1.1-Windows_NT-Release|AnyCPU'" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Debug|AnyCPU'" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Release|AnyCPU'" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uapaot-Windows_NT-Debug|AnyCPU'" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uapaot-Windows_NT-Release|AnyCPU'" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'win8-Windows_NT-Debug|AnyCPU'" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'win8-Windows_NT-Release|AnyCPU'" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'wpa81-Windows_NT-Debug|AnyCPU'" /> diff --git a/src/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/RuntimeInformation.Windows.cs b/src/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/RuntimeInformation.Windows.cs index 5dc67a2efa..e07cbbdd64 100644 --- a/src/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/RuntimeInformation.Windows.cs +++ b/src/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/RuntimeInformation.Windows.cs @@ -25,7 +25,7 @@ namespace System.Runtime.InteropServices { if (null == s_osDescription) { -#if netcore50 || win8 +#if uap || win8 s_osDescription = "Microsoft Windows"; #elif wpa81 s_osDescription = "Microsoft Windows Phone"; diff --git a/src/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/RuntimeInformation.cs b/src/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/RuntimeInformation.cs index 9c0779bf4d..c6280b805d 100644 --- a/src/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/RuntimeInformation.cs +++ b/src/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/RuntimeInformation.cs @@ -9,11 +9,11 @@ namespace System.Runtime.InteropServices { public static partial class RuntimeInformation { -#if netcore50aot +#if uap private const string FrameworkName = ".NET Native"; #elif netfx || win8 private const string FrameworkName = ".NET Framework"; -#else // netcore50 || wpa81 || other +#else // uap || wpa81 || other private const string FrameworkName = ".NET Core"; #endif diff --git a/src/System.Runtime.InteropServices.WindowsRuntime/src/System.Runtime.InteropServices.WindowsRuntime.csproj b/src/System.Runtime.InteropServices.WindowsRuntime/src/System.Runtime.InteropServices.WindowsRuntime.csproj index 848e1d3e56..a620e7f8dd 100644 --- a/src/System.Runtime.InteropServices.WindowsRuntime/src/System.Runtime.InteropServices.WindowsRuntime.csproj +++ b/src/System.Runtime.InteropServices.WindowsRuntime/src/System.Runtime.InteropServices.WindowsRuntime.csproj @@ -17,11 +17,8 @@ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uapaot-Windows_NT-Release|AnyCPU'" /> <ItemGroup> <ReferenceFromRuntime Include="System.Private.Interop" Condition="'$(TargetGroup)' == 'uapaot'" /> - </ItemGroup> - <ItemGroup> <ReferenceFromRuntime Include="System.Private.CoreLib" Condition="'$(TargetsWindows)'=='true'" /> <Reference Include="System.Runtime" Condition="'$(TargetsWindows)'!='true'" /> - <ReferenceFromRuntime Include="System.Private.Interop" Condition="'$(TargetGroup)' == 'netcore50aot'" /> </ItemGroup> <PropertyGroup Condition="'$(TargetsWindows)'!='true'"> <GeneratePlatformNotSupportedAssembly>true</GeneratePlatformNotSupportedAssembly> diff --git a/src/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs b/src/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs index 4a8e1c8fef..e6039c4bb0 100644 --- a/src/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs +++ b/src/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs @@ -1680,7 +1680,7 @@ public static partial class DataContractSerializerTests Assert.StrictEqual<TypeWithCommonTypeProperties>(value, deserializedValue); } -#if NET_NATIVE +#if uapaot [Fact] public static void DCS_TypeWithTypeProperty() { diff --git a/src/System.Runtime.Serialization.Xml/tests/SerializationTypes.cs b/src/System.Runtime.Serialization.Xml/tests/SerializationTypes.cs index 32913464b3..e58283e069 100644 --- a/src/System.Runtime.Serialization.Xml/tests/SerializationTypes.cs +++ b/src/System.Runtime.Serialization.Xml/tests/SerializationTypes.cs @@ -1885,7 +1885,7 @@ namespace SerializationTypes public ICollection<int> Member1; } -#if NET_NATIVE +#if uapaot public class TypeWithTypeProperty { public int Id { get; set; } diff --git a/src/System.Runtime.Serialization.Xml/tests/System.Runtime.Serialization.Xml.Tests.settings.targets b/src/System.Runtime.Serialization.Xml/tests/System.Runtime.Serialization.Xml.Tests.settings.targets index 4c28988103..5f81a491c8 100644 --- a/src/System.Runtime.Serialization.Xml/tests/System.Runtime.Serialization.Xml.Tests.settings.targets +++ b/src/System.Runtime.Serialization.Xml/tests/System.Runtime.Serialization.Xml.Tests.settings.targets @@ -8,7 +8,7 @@ <AppDesignerFolder>Properties</AppDesignerFolder> <NugetTargetMoniker>.NETStandard,Version=v1.7</NugetTargetMoniker> <TestSourceFolder>$(MSBuildThisFileDirectory)\</TestSourceFolder> - <DefineConstants Condition="'$(TargetGroup)'=='uapaot'">$(DefineConstants);NET_NATIVE</DefineConstants> + <DefineConstants Condition="'$(TargetGroup)' == 'uapaot'">$(DefineConstants);uapaot</DefineConstants> </PropertyGroup> <ItemGroup> <ProjectReference Include="$(TestSourceFolder)..\..\System.Private.DataContractSerialization\pkg\System.Private.DataContractSerialization.pkgproj"> diff --git a/src/System.Security.Cryptography.Algorithms/src/ApiCompatBaseline.uap.txt b/src/System.Security.Cryptography.Algorithms/src/ApiCompatBaseline.uap.txt new file mode 100644 index 0000000000..6b1a944565 --- /dev/null +++ b/src/System.Security.Cryptography.Algorithms/src/ApiCompatBaseline.uap.txt @@ -0,0 +1,3 @@ +Compat issues with assembly System.Security.Cryptography.Algorithms: +MembersMustExist : Member 'System.Security.Cryptography.ECDsa.Create(System.Security.Cryptography.ECCurve)' does not exist in the implementation but it does exist in the contract. +Total Issues: 1 diff --git a/src/System.Security.Cryptography.Algorithms/src/System.Security.Cryptography.Algorithms.csproj b/src/System.Security.Cryptography.Algorithms/src/System.Security.Cryptography.Algorithms.csproj index 8f12f3e7f6..e78bf79eb3 100644 --- a/src/System.Security.Cryptography.Algorithms/src/System.Security.Cryptography.Algorithms.csproj +++ b/src/System.Security.Cryptography.Algorithms/src/System.Security.Cryptography.Algorithms.csproj @@ -8,6 +8,7 @@ <AllowUnsafeBlocks>true</AllowUnsafeBlocks> <DefineConstants>INTERNAL_ASYMMETRIC_IMPLEMENTATIONS</DefineConstants> <NoWarn>CA5351;$(NoWarn)</NoWarn> + <DefineConstants Condition="'$(TargetGroup)' == 'uap'">$(DefineConstants);uap</DefineConstants> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-OSX-Debug|AnyCPU'" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-OSX-Release|AnyCPU'" /> diff --git a/src/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsaCng.cs b/src/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsaCng.cs index e2f6bf17b4..5cb7fb9124 100644 --- a/src/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsaCng.cs +++ b/src/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsaCng.cs @@ -19,6 +19,7 @@ namespace System.Security.Cryptography return new ECDsaImplementation.ECDsaCng(); } +#if !uap /// <summary> /// Creates an instance of the platform specific implementation of the cref="ECDsa" algorithm. /// </summary> @@ -29,6 +30,7 @@ namespace System.Security.Cryptography { return new ECDsaImplementation.ECDsaCng(curve); } +#endif // uap /// <summary> /// Creates an instance of the platform specific implementation of the cref="ECDsa" algorithm. diff --git a/src/System.Security.Cryptography.Cng/src/ApiCompatBaseline.uap.txt b/src/System.Security.Cryptography.Cng/src/ApiCompatBaseline.uap.txt new file mode 100644 index 0000000000..98cb2054ea --- /dev/null +++ b/src/System.Security.Cryptography.Cng/src/ApiCompatBaseline.uap.txt @@ -0,0 +1,3 @@ +Compat issues with assembly System.Security.Cryptography.Cng: +MembersMustExist : Member 'System.Security.Cryptography.ECDsaCng..ctor(System.Security.Cryptography.ECCurve)' does not exist in the implementation but it does exist in the contract. +Total Issues: 1 diff --git a/src/System.Security.Cryptography.Cng/src/Internal/Cryptography/CngAlgorithmCore.cs b/src/System.Security.Cryptography.Cng/src/Internal/Cryptography/CngAlgorithmCore.cs index 381d2b8237..c14fe21374 100644 --- a/src/System.Security.Cryptography.Cng/src/Internal/Cryptography/CngAlgorithmCore.cs +++ b/src/System.Security.Cryptography.Cng/src/Internal/Cryptography/CngAlgorithmCore.cs @@ -71,7 +71,7 @@ namespace Internal.Cryptography return _lazyKey; } -#if !NETNATIVE +#if !uap public CngKey GetOrGenerateKey(ECCurve? curve) { if (_lazyKey != null) @@ -125,7 +125,7 @@ namespace Internal.Cryptography return _lazyKey; } -#endif //!NETNATIVE +#endif // !uap public void SetKey(CngKey key) { diff --git a/src/System.Security.Cryptography.Cng/src/System.Security.Cryptography.Cng.csproj b/src/System.Security.Cryptography.Cng/src/System.Security.Cryptography.Cng.csproj index 16f3c56221..0eb826ef60 100644 --- a/src/System.Security.Cryptography.Cng/src/System.Security.Cryptography.Cng.csproj +++ b/src/System.Security.Cryptography.Cng/src/System.Security.Cryptography.Cng.csproj @@ -10,6 +10,7 @@ <ResourcesSourceOutputDirectory Condition="'$(IsPartialFacadeAssembly)' == 'true'">None</ResourcesSourceOutputDirectory> <GeneratePlatformNotSupportedAssembly Condition="'$(TargetsUnix)' == 'true'">true</GeneratePlatformNotSupportedAssembly> <GenFacadesIgnoreMissingTypes Condition="'$(TargetGroup)'=='netfx'">true</GenFacadesIgnoreMissingTypes> + <DefineConstants Condition="'$(TargetGroup)' == 'uap'">$(DefineConstants);uap</DefineConstants> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Windows_NT-Debug|AnyCPU'" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Windows_NT-Release|AnyCPU'" /> diff --git a/src/System.Security.Cryptography.Cng/src/System/Security/Cryptography/CngKey.EC.cs b/src/System.Security.Cryptography.Cng/src/System/Security/Cryptography/CngKey.EC.cs index 0098906bc7..273302e789 100644 --- a/src/System.Security.Cryptography.Cng/src/System/Security/Cryptography/CngKey.EC.cs +++ b/src/System.Security.Cryptography.Cng/src/System/Security/Cryptography/CngKey.EC.cs @@ -37,12 +37,12 @@ namespace System.Security.Cryptography internal string GetCurveName() { -#if !NETNATIVE +#if !uap if (IsECNamedCurve()) { return _keyHandle.GetPropertyAsString(KeyPropertyName.ECCCurveName, CngPropertyOptions.None); } -#endif //!NETNATIVE +#endif // !uap // Use hard-coded values (for use with pre-Win10 APIs) return GetECSpecificCurveName(); @@ -74,7 +74,7 @@ namespace System.Security.Cryptography throw new PlatformNotSupportedException(string.Format(SR.Cryptography_CurveNotSupported, algorithm)); } -#if !NETNATIVE +#if !uap /// <summary> /// Return a CngProperty representing a named curve. /// </summary> @@ -88,7 +88,7 @@ namespace System.Security.Cryptography return new CngProperty(KeyPropertyName.ECCCurveName, curveNameBytes, CngPropertyOptions.None); } } -#endif //!NETNATIVE +#endif // !uap /// <summary> /// Map a curve name to algorithm. This enables curves that worked pre-Win10 diff --git a/src/System.Security.Cryptography.Cng/src/System/Security/Cryptography/CngKey.Import.cs b/src/System.Security.Cryptography.Cng/src/System/Security/Cryptography/CngKey.Import.cs index c26ead40a7..07eb401e12 100644 --- a/src/System.Security.Cryptography.Cng/src/System/Security/Cryptography/CngKey.Import.cs +++ b/src/System.Security.Cryptography.Cng/src/System/Security/Cryptography/CngKey.Import.cs @@ -59,9 +59,9 @@ namespace System.Security.Cryptography } else { -#if !NETNATIVE +#if !uap keyHandle = ECCng.ImportKeyBlob(format.Format, keyBlob, curveName, providerHandle); -#endif //!NETNATIVE +#endif // !uap } CngKey key = new CngKey(providerHandle, keyHandle); diff --git a/src/System.Security.Cryptography.Cng/src/System/Security/Cryptography/ECDsaCng.Key.cs b/src/System.Security.Cryptography.Cng/src/System/Security/Cryptography/ECDsaCng.Key.cs index 44ce33f1fd..e9c9f708f1 100644 --- a/src/System.Security.Cryptography.Cng/src/System/Security/Cryptography/ECDsaCng.Key.cs +++ b/src/System.Security.Cryptography.Cng/src/System/Security/Cryptography/ECDsaCng.Key.cs @@ -39,7 +39,7 @@ namespace System.Security.Cryptography } } -#if !NETNATIVE +#if !uap public override void GenerateKey(ECCurve curve) { curve.Validate(); @@ -82,7 +82,7 @@ namespace System.Security.Cryptography throw new PlatformNotSupportedException(string.Format(SR.Cryptography_CurveNotSupported, curve.CurveType.ToString())); } } -#endif //!NETNATIVE +#endif // !uap private CngKey GetKey() { @@ -90,10 +90,10 @@ namespace System.Security.Cryptography if (_core.IsKeyGeneratedNamedCurve()) { -#if !NETNATIVE +#if !uap // Curve was previously created, so use that key = _core.GetOrGenerateKey(null); -#endif //!NETNATIVE +#endif // !uap } else { diff --git a/src/System.Security.Cryptography.Cng/src/System/Security/Cryptography/ECDsaCng.cs b/src/System.Security.Cryptography.Cng/src/System/Security/Cryptography/ECDsaCng.cs index d6a89bc54f..f8e59a02d9 100644 --- a/src/System.Security.Cryptography.Cng/src/System/Security/Cryptography/ECDsaCng.cs +++ b/src/System.Security.Cryptography.Cng/src/System/Security/Cryptography/ECDsaCng.cs @@ -57,34 +57,34 @@ namespace System.Security.Cryptography private void ImportFullKeyBlob(byte[] ecfullKeyBlob, bool includePrivateParameters) { -#if !NETNATIVE +#if !uap Key = ECCng.ImportFullKeyBlob(ecfullKeyBlob, includePrivateParameters); -#endif //!NETNATIVE +#endif // !uap } private void ImportKeyBlob(byte[] ecfullKeyBlob, string curveName, bool includePrivateParameters) { -#if !NETNATIVE +#if !uap Key = ECCng.ImportKeyBlob(ecfullKeyBlob, curveName, includePrivateParameters); -#endif //!NETNATIVE +#endif // !uap } private byte[] ExportKeyBlob(bool includePrivateParameters) { -#if NETNATIVE +#if uap return null; #else return ECCng.ExportKeyBlob(Key, includePrivateParameters); -#endif //NETNATIVE +#endif // uap } private byte[] ExportFullKeyBlob(bool includePrivateParameters) { -#if NETNATIVE +#if uap return null; #else return ECCng.ExportFullKeyBlob(Key, includePrivateParameters); -#endif //NETNATIVE +#endif // uap } } } diff --git a/src/System.Security.Cryptography.Csp/src/PinvokeAnalyzerExceptionList.analyzerdata b/src/System.Security.Cryptography.Csp/src/PinvokeAnalyzerExceptionList.analyzerdata new file mode 100644 index 0000000000..31cd158b19 --- /dev/null +++ b/src/System.Security.Cryptography.Csp/src/PinvokeAnalyzerExceptionList.analyzerdata @@ -0,0 +1,21 @@ +advapi32.dll!CryptAcquireContextW +advapi32.dll!CryptCreateHash +advapi32.dll!CryptDecrypt +advapi32.dll!CryptDeriveKey +advapi32.dll!CryptDestroyHash +advapi32.dll!CryptDestroyKey +advapi32.dll!CryptEncrypt +advapi32.dll!CryptExportKey +advapi32.dll!CryptGenKey +advapi32.dll!CryptGetDefaultProviderW +advapi32.dll!CryptGetHashParam +advapi32.dll!CryptGetKeyParam +advapi32.dll!CryptGetProvParam +advapi32.dll!CryptGetUserKey +advapi32.dll!CryptHashData +advapi32.dll!CryptImportKey +advapi32.dll!CryptSetHashParam +advapi32.dll!CryptSetKeyParam +advapi32.dll!CryptSetProvParam +advapi32.dll!CryptSignHashW +advapi32.dll!CryptVerifySignatureW diff --git a/src/System.Security.Cryptography.X509Certificates/src/ApiCompatBaseline.uap.txt b/src/System.Security.Cryptography.X509Certificates/src/ApiCompatBaseline.uap.txt new file mode 100644 index 0000000000..fcc74cf864 --- /dev/null +++ b/src/System.Security.Cryptography.X509Certificates/src/ApiCompatBaseline.uap.txt @@ -0,0 +1 @@ +Total Issues: 0 diff --git a/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.CspParametersStub.cs b/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.CspParametersStub.cs index 9f77bc7b85..8953d211c8 100644 --- a/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.CspParametersStub.cs +++ b/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.CspParametersStub.cs @@ -6,7 +6,7 @@ // assembly. So these type definitions allow the code to continue to use the same data transport structure // that it has for quite a while. -#if NETNATIVE +#if uap using System; namespace Internal.Cryptography.Pal @@ -68,4 +68,4 @@ namespace Internal.Cryptography.Pal } } -#endif // #if NETNATIVE +#endif // #if uap diff --git a/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.Import.cs b/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.Import.cs index 2046aeb99d..6d7c8064b3 100644 --- a/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.Import.cs +++ b/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.Import.cs @@ -234,7 +234,7 @@ namespace Internal.Cryptography.Pal // For .NET Native (UWP) the API used to delete the private key (if it wasn't added to a store) is not // allowed to be called if the key is stored in CAPI. So for UWP force the key to be stored in the // CNG Key Storage Provider, then deleting the key with CngKey.Delete will clean up the file on disk, too. -#if NETNATIVE +#if uap pfxCertStoreFlags |= PfxCertStoreFlags.PKCS12_ALWAYS_CNG_KSP; #endif diff --git a/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.PrivateKey.cs b/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.PrivateKey.cs index 07a883c670..ec4e2ab602 100644 --- a/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.PrivateKey.cs +++ b/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.PrivateKey.cs @@ -27,7 +27,7 @@ namespace Internal.Cryptography.Pal return GetPrivateKey<RSA>( delegate (CspParameters csp) { -#if NETNATIVE +#if uap // In .NET Native (UWP) we don't have access to CAPI, so it's CNG-or-nothing. // But we don't expect to get here, so it shouldn't be a problem. @@ -49,7 +49,7 @@ namespace Internal.Cryptography.Pal return GetPrivateKey<DSA>( delegate (CspParameters csp) { -#if NETNATIVE +#if uap // In .NET Native (UWP) we don't have access to CAPI, so it's CNG-or-nothing. // But we don't expect to get here, so it shouldn't be a problem. @@ -107,7 +107,7 @@ namespace Internal.Cryptography.Pal else { // ProviderType being non-zero signifies that this is a CAPI key. -#if NETNATIVE +#if uap // In .NET Native (UWP) we don't have access to CAPI, so it's CNG-or-nothing. // But we don't expect to get here, so it shouldn't be a problem. diff --git a/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.cs b/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.cs index 5ca8bc47d5..3af1ce4a07 100644 --- a/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.cs +++ b/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.cs @@ -413,7 +413,7 @@ namespace Internal.Cryptography.Pal sb.AppendLine("[Private Key]"); } -#if NETNATIVE +#if uap // Similar to the Unix implementation, in UWP merely acknowledge that there -is- a private key. #else CspKeyContainerInfo cspKeyContainerInfo = null; @@ -477,7 +477,7 @@ namespace Internal.Cryptography.Pal } catch (CryptographicException) { } catch (NotSupportedException) { } -#endif // #if NETNATIVE / #else +#endif // #if uap / #else } public void Dispose() diff --git a/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Interop.crypt32.cs b/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Interop.crypt32.cs index 0aa61e8ab3..80a6a75ec0 100644 --- a/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Interop.crypt32.cs +++ b/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Interop.crypt32.cs @@ -295,7 +295,7 @@ internal static partial class Interop [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] public static extern bool CryptMsgClose(IntPtr hCryptMsg); -#if !NETNATIVE +#if !uap [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] public static extern unsafe bool CryptImportPublicKeyInfoEx2(CertEncodingType dwCertEncodingType, CERT_PUBLIC_KEY_INFO* pInfo, int dwFlags, void* pvAuxInfo, out SafeBCryptKeyHandle phKey); #endif diff --git a/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Interop.cryptoapi.cs b/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Interop.cryptoapi.cs index a42a58fdbd..5ea7a05c02 100644 --- a/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Interop.cryptoapi.cs +++ b/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Interop.cryptoapi.cs @@ -15,7 +15,7 @@ internal static partial class Interop { public static partial class cryptoapi { -#if !NETNATIVE +#if !uap [DllImport(Libraries.Advapi32, SetLastError = true, CharSet = CharSet.Unicode, EntryPoint = "CryptAcquireContextW")] [return: MarshalAs(UnmanagedType.Bool)] public static extern unsafe bool CryptAcquireContext(out IntPtr psafeProvHandle, char* pszContainer, char* pszProvider, int dwProvType, CryptAcquireContextFlags dwFlags); diff --git a/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/SafeHandles.cs b/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/SafeHandles.cs index cc1705b181..2c76c50d8b 100644 --- a/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/SafeHandles.cs +++ b/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/SafeHandles.cs @@ -183,7 +183,7 @@ namespace Internal.Cryptography.Pal.Native } else { -#if !NETNATIVE // For UWP, CryptAcquireContext() is a disallowed api, even when being used for cleanup. CAPI keys should not exist on that platform, however... +#if !uap // For UWP, CryptAcquireContext() is a disallowed api, even when being used for cleanup. CAPI keys should not exist on that platform, however... CryptAcquireContextFlags flags = (pProvInfo->dwFlags & CryptAcquireContextFlags.CRYPT_MACHINE_KEYSET) | CryptAcquireContextFlags.CRYPT_DELETEKEYSET; IntPtr hProv; bool success = Interop.cryptoapi.CryptAcquireContext(out hProv, pProvInfo->pwszContainerName, pProvInfo->pwszProvName, pProvInfo->dwProvType, flags); diff --git a/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/X509Pal.PublicKey.cs b/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/X509Pal.PublicKey.cs index 38318b0e89..103d7aea70 100644 --- a/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/X509Pal.PublicKey.cs +++ b/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/X509Pal.PublicKey.cs @@ -43,7 +43,7 @@ namespace Internal.Cryptography.Pal return new RSACng(cngKey); } -#if !NETNATIVE +#if !uap case AlgId.CALG_DSS_SIGN: { byte[] keyBlob = ConstructDSSPublicKeyCspBlob(encodedKeyValue, encodedParameters); @@ -65,7 +65,7 @@ namespace Internal.Cryptography.Pal { CngKeyBlobFormat blobFormat; byte[] keyBlob; -#if NETNATIVE +#if uap blobFormat = CngKeyBlobFormat.EccPublicBlob; keyBlob = ExportKeyBlob(bCryptKeyHandle, blobFormat); using (CngKey cngKey = CngKey.Import(keyBlob, blobFormat)) @@ -110,7 +110,7 @@ namespace Internal.Cryptography.Pal private static SafeBCryptKeyHandle ImportPublicKeyInfo(SafeCertContextHandle certContext) { -#if NETNATIVE +#if uap // CryptImportPublicKeyInfoEx2() not in the UWP api list. throw new PlatformNotSupportedException(); #else @@ -135,12 +135,12 @@ namespace Internal.Cryptography.Pal certContext.DangerousRelease(); } } -#endif //NETNATIVE +#endif // uap } private static byte[] ExportKeyBlob(SafeBCryptKeyHandle bCryptKeyHandle, CngKeyBlobFormat blobFormat) { -#if NETNATIVE +#if uap // BCryptExportKey() not in the UWP api list. throw new PlatformNotSupportedException(); #else @@ -158,10 +158,10 @@ namespace Internal.Cryptography.Pal Array.Resize(ref keyBlob, numBytesNeeded); return keyBlob; -#endif //NETNATIVE +#endif // uap } -#if !NETNATIVE +#if !uap private static void ExportNamedCurveParameters(ref ECParameters ecParams, byte[] ecBlob, bool includePrivateParameters) { // We now have a buffer laid out as follows: diff --git a/src/System.Security.Cryptography.X509Certificates/src/System.Security.Cryptography.X509Certificates.csproj b/src/System.Security.Cryptography.X509Certificates/src/System.Security.Cryptography.X509Certificates.csproj index b853fb4592..7dc296bc14 100644 --- a/src/System.Security.Cryptography.X509Certificates/src/System.Security.Cryptography.X509Certificates.csproj +++ b/src/System.Security.Cryptography.X509Certificates/src/System.Security.Cryptography.X509Certificates.csproj @@ -6,6 +6,7 @@ <OutputType>Library</OutputType> <AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + <DefineConstants Condition="'$(TargetGroup)' == 'uap'">$(DefineConstants);uap</DefineConstants> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Debug|AnyCPU'" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Release|AnyCPU'" /> diff --git a/src/System.Security.Cryptography.X509Certificates/tests/PfxTests.cs b/src/System.Security.Cryptography.X509Certificates/tests/PfxTests.cs index 4103ad7c1f..595a8b347b 100644 --- a/src/System.Security.Cryptography.X509Certificates/tests/PfxTests.cs +++ b/src/System.Security.Cryptography.X509Certificates/tests/PfxTests.cs @@ -15,7 +15,7 @@ namespace System.Security.Cryptography.X509Certificates.Tests { get { -#if NETNATIVE +#if uap yield break; #else yield return new object[] { TestData.ECDsabrainpoolP160r1_Pfx }; diff --git a/src/System.Security.Cryptography.X509Certificates/tests/PublicKeyTests.cs b/src/System.Security.Cryptography.X509Certificates/tests/PublicKeyTests.cs index e6961dc448..237577ee2c 100644 --- a/src/System.Security.Cryptography.X509Certificates/tests/PublicKeyTests.cs +++ b/src/System.Security.Cryptography.X509Certificates/tests/PublicKeyTests.cs @@ -44,7 +44,7 @@ namespace System.Security.Cryptography.X509Certificates.Tests { get { -#if NETNATIVE +#if uap yield break; #else yield return new object[] { @@ -521,7 +521,7 @@ namespace System.Security.Cryptography.X509Certificates.Tests private static void TestKey_ECDsaCng(byte[] certBytes, TestData.ECDsaCngKeyValues expected) { -#if !NETNATIVE +#if !uap using (X509Certificate2 cert = new X509Certificate2(certBytes)) { ECDsaCng e = (ECDsaCng)(cert.GetECDsaPublicKey()); @@ -539,7 +539,7 @@ namespace System.Security.Cryptography.X509Certificates.Tests Assert.Equal<byte>(expected.QY, qy); } } -#endif //!NETNATIVE +#endif // !uap } } } diff --git a/src/System.Security.Principal.Windows/src/PinvokeAnalyzerExceptionList.analyzerdata b/src/System.Security.Principal.Windows/src/PinvokeAnalyzerExceptionList.analyzerdata new file mode 100644 index 0000000000..f3f83f0173 --- /dev/null +++ b/src/System.Security.Principal.Windows/src/PinvokeAnalyzerExceptionList.analyzerdata @@ -0,0 +1,16 @@ +advapi32.dll!ImpersonateLoggedOnUser +advapi32.dll!LsaClose +advapi32.dll!LsaFreeMemory +advapi32.dll!LsaLookupNames2 +advapi32.dll!LsaLookupSids +advapi32.dll!LsaOpenPolicy +advapi32.dll!OpenProcessToken +advapi32.dll!OpenThreadToken +advapi32.dll!RevertToSelf +ntdll.dll!RtlNtStatusToDosError +sspicli.dll!LsaConnectUntrusted +sspicli.dll!LsaDeregisterLogonProcess +sspicli.dll!LsaFreeReturnBuffer +sspicli.dll!LsaGetLogonSessionData +sspicli.dll!LsaLogonUser +sspicli.dll!LsaLookupAuthenticationPackage diff --git a/src/System.ServiceProcess.ServiceController/src/System.ServiceProcess.ServiceController.csproj b/src/System.ServiceProcess.ServiceController/src/System.ServiceProcess.ServiceController.csproj index c25f862b9b..4e0b11f085 100644 --- a/src/System.ServiceProcess.ServiceController/src/System.ServiceProcess.ServiceController.csproj +++ b/src/System.ServiceProcess.ServiceController/src/System.ServiceProcess.ServiceController.csproj @@ -9,6 +9,8 @@ <IsPartialFacadeAssembly Condition="'$(TargetGroup)' == 'netfx'">true</IsPartialFacadeAssembly> <ResourcesSourceOutputDirectory Condition="'$(TargetGroup)' == 'netfx'">None</ResourcesSourceOutputDirectory> <GeneratePlatformNotSupportedAssembly Condition="'$(TargetsUnix)' == 'true'">true</GeneratePlatformNotSupportedAssembly> + <!-- Although we have a netstandard configuration, we know we are not currently UAP compatible--> + <UWPCompatible>false</UWPCompatible> </PropertyGroup> <!-- Help VS understand available configurations --> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netstandard-Windows_NT-Debug|AnyCPU'" /> diff --git a/src/System.Threading.Thread/src/ApiCompatBaseline.uap.txt b/src/System.Threading.Thread/src/ApiCompatBaseline.uap.txt new file mode 100644 index 0000000000..29e756858a --- /dev/null +++ b/src/System.Threading.Thread/src/ApiCompatBaseline.uap.txt @@ -0,0 +1,6 @@ +Compat issues with assembly System.Threading.Thread: +MembersMustExist : Member 'System.Threading.Thread.CurrentPrincipal.get()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Threading.Thread.CurrentPrincipal.set(System.Security.Principal.IPrincipal)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Threading.Thread.GetDomain()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Threading.Thread.GetDomainID()' does not exist in the implementation but it does exist in the contract. +Total Issues: 4 diff --git a/src/System.Threading.Thread/src/ApiCompatBaseline.uapaot.txt b/src/System.Threading.Thread/src/ApiCompatBaseline.uapaot.txt index 9863b189a2..29e756858a 100644 --- a/src/System.Threading.Thread/src/ApiCompatBaseline.uapaot.txt +++ b/src/System.Threading.Thread/src/ApiCompatBaseline.uapaot.txt @@ -1,4 +1,6 @@ +Compat issues with assembly System.Threading.Thread: MembersMustExist : Member 'System.Threading.Thread.CurrentPrincipal.get()' does not exist in the implementation but it does exist in the contract. MembersMustExist : Member 'System.Threading.Thread.CurrentPrincipal.set(System.Security.Principal.IPrincipal)' does not exist in the implementation but it does exist in the contract. MembersMustExist : Member 'System.Threading.Thread.GetDomain()' does not exist in the implementation but it does exist in the contract. MembersMustExist : Member 'System.Threading.Thread.GetDomainID()' does not exist in the implementation but it does exist in the contract. +Total Issues: 4 diff --git a/src/System.Threading.Thread/src/System.Threading.Thread.csproj b/src/System.Threading.Thread/src/System.Threading.Thread.csproj index 7861f03d98..ae1c3ffda1 100644 --- a/src/System.Threading.Thread/src/System.Threading.Thread.csproj +++ b/src/System.Threading.Thread/src/System.Threading.Thread.csproj @@ -8,6 +8,7 @@ <!-- Type being defined conflicts with imported type from dependency assembly --> <NoWarn>436</NoWarn> <ProjectGuid>{06197EED-FF48-43F3-976D-463839D43E8C}</ProjectGuid> + <DefineConstants Condition="'$(TargetGroup)' == 'uapaot'">$(DefineConstants);uapaot</DefineConstants> </PropertyGroup> <!-- Help VS understand available configurations --> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Debug|AnyCPU'" /> @@ -18,9 +19,6 @@ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Release|AnyCPU'" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uapaot-Windows_NT-Debug|AnyCPU'" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uapaot-Windows_NT-Release|AnyCPU'" /> - <PropertyGroup Condition="'$(TargetGroup)' == 'uapaot'"> - <DefineConstants>$(DefineConstants);NETNATIVE</DefineConstants> - </PropertyGroup> <ItemGroup> <Compile Include="System\LocalDataStoreSlot.cs" /> <Compile Include="System\Threading\CompressedStack.cs" /> diff --git a/src/System.Threading.Thread/src/System/Threading/Thread.cs b/src/System.Threading.Thread/src/System/Threading/Thread.cs index f2e45b8409..6243a68f01 100644 --- a/src/System.Threading.Thread/src/System/Threading/Thread.cs +++ b/src/System.Threading.Thread/src/System/Threading/Thread.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#if !NETNATIVE +#if !uapaot extern alias System_Runtime_Extensions; extern alias System_Security_Principal; #endif @@ -15,7 +15,7 @@ using Internal.Runtime.Augments; namespace System.Threading { -#if !NETNATIVE +#if !uapaot using AppDomain = System_Runtime_Extensions::System.AppDomain; using IPrincipal = System_Security_Principal::System.Security.Principal.IPrincipal; #endif @@ -27,7 +27,7 @@ namespace System.Threading private readonly RuntimeThread _runtimeThread; private Delegate _start; -#if !NETNATIVE +#if !uapaot private IPrincipal _principal; #endif @@ -162,7 +162,7 @@ namespace System.Threading } } -#if !NETNATIVE +#if !uapaot public static IPrincipal CurrentPrincipal { get @@ -285,7 +285,7 @@ namespace System.Threading throw new InvalidOperationException(SR.Thread_GetSetCompressedStack_NotSupported); } -#if !NETNATIVE +#if !uapaot public static AppDomain GetDomain() => AppDomain.CurrentDomain; public static int GetDomainID() => GetDomain().Id; #endif diff --git a/src/System.Threading/src/ApiCompatBaseline.uapaot.txt b/src/System.Threading/src/ApiCompatBaseline.uapaot.txt index 007aa587b3..cc04d33637 100644 --- a/src/System.Threading/src/ApiCompatBaseline.uapaot.txt +++ b/src/System.Threading/src/ApiCompatBaseline.uapaot.txt @@ -1,6 +1,9 @@ +Compat issues with assembly System.Threading: CannotRemoveBaseTypeOrInterface : Type 'System.Threading.AbandonedMutexException' does not inherit from base type 'System.SystemException' in the implementation but it does in the contract. TypesMustExist : Type 'System.Threading.AsyncFlowControl' does not exist in the implementation but it does exist in the contract. CannotRemoveBaseTypeOrInterface : Type 'System.Threading.AutoResetEvent' does not inherit from base type 'System.MarshalByRefObject' in the implementation but it does in the contract. +TypesMustExist : Type 'System.Threading.Barrier' does not exist in the implementation but it does exist in the contract. +TypesMustExist : Type 'System.Threading.BarrierPostPhaseException' does not exist in the implementation but it does exist in the contract. CannotRemoveBaseTypeOrInterface : Type 'System.Threading.EventWaitHandle' does not inherit from base type 'System.MarshalByRefObject' in the implementation but it does in the contract. CannotRemoveBaseTypeOrInterface : Type 'System.Threading.ExecutionContext' does not implement interface 'System.IDisposable' in the implementation but it does in the contract. MembersMustExist : Member 'System.Threading.ExecutionContext.CreateCopy()' does not exist in the implementation but it does exist in the contract. @@ -9,10 +12,13 @@ MembersMustExist : Member 'System.Threading.ExecutionContext.GetObjectData(Syste MembersMustExist : Member 'System.Threading.ExecutionContext.IsFlowSuppressed()' does not exist in the implementation but it does exist in the contract. MembersMustExist : Member 'System.Threading.ExecutionContext.RestoreFlow()' does not exist in the implementation but it does exist in the contract. MembersMustExist : Member 'System.Threading.ExecutionContext.SuppressFlow()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Threading.LazyInitializer.EnsureInitialized<T>(T, System.Object, System.Func<T>)' does not exist in the implementation but it does exist in the contract. +TypesMustExist : Type 'System.Threading.LockCookie' does not exist in the implementation but it does exist in the contract. CannotRemoveBaseTypeOrInterface : Type 'System.Threading.ManualResetEvent' does not inherit from base type 'System.MarshalByRefObject' in the implementation but it does in the contract. MembersMustExist : Member 'System.Threading.Monitor.Wait(System.Object, System.Int32, System.Boolean)' does not exist in the implementation but it does exist in the contract. MembersMustExist : Member 'System.Threading.Monitor.Wait(System.Object, System.TimeSpan, System.Boolean)' does not exist in the implementation but it does exist in the contract. CannotRemoveBaseTypeOrInterface : Type 'System.Threading.Mutex' does not inherit from base type 'System.MarshalByRefObject' in the implementation but it does in the contract. +TypesMustExist : Type 'System.Threading.ReaderWriterLock' does not exist in the implementation but it does exist in the contract. CannotRemoveBaseTypeOrInterface : Type 'System.Threading.Semaphore' does not inherit from base type 'System.MarshalByRefObject' in the implementation but it does in the contract. MembersMustExist : Member 'System.Threading.SynchronizationContext.IsWaitNotificationRequired()' does not exist in the implementation but it does exist in the contract. MembersMustExist : Member 'System.Threading.SynchronizationContext.SetWaitNotificationRequired()' does not exist in the implementation but it does exist in the contract. @@ -20,3 +26,4 @@ MembersMustExist : Member 'System.Threading.SynchronizationContext.Wait(System.I MembersMustExist : Member 'System.Threading.SynchronizationContext.WaitHelper(System.IntPtr[], System.Boolean, System.Int32)' does not exist in the implementation but it does exist in the contract. CannotRemoveBaseTypeOrInterface : Type 'System.Threading.SynchronizationLockException' does not inherit from base type 'System.SystemException' in the implementation but it does in the contract. CannotRemoveBaseTypeOrInterface : Type 'System.Threading.WaitHandleCannotBeOpenedException' does not inherit from base type 'System.ApplicationException' in the implementation but it does in the contract. +Total Issues: 27 diff --git a/src/System.Xml.XmlSerializer/src/System.Xml.XmlSerializer.csproj b/src/System.Xml.XmlSerializer/src/System.Xml.XmlSerializer.csproj index 4728ea12db..d4104c4a42 100644 --- a/src/System.Xml.XmlSerializer/src/System.Xml.XmlSerializer.csproj +++ b/src/System.Xml.XmlSerializer/src/System.Xml.XmlSerializer.csproj @@ -17,7 +17,7 @@ <ItemGroup> <ProjectReference Include="..\..\System.Private.Xml\src\System.Private.Xml.csproj" /> </ItemGroup> - <ItemGroup Condition="'$(TargetGroup)' == 'uap101aot'"> + <ItemGroup Condition="'$(TargetGroup)' == 'uapaot'"> <EmbeddedResource Include="..\..\System.Private.Xml\src\Resources\System.Private.Xml.rd.xml" /> </ItemGroup> <ItemGroup> diff --git a/src/Tools/GenerateProps/targetgroups.props b/src/Tools/GenerateProps/targetgroups.props index 627c825e9d..0ca9e0fbcb 100644 --- a/src/Tools/GenerateProps/targetgroups.props +++ b/src/Tools/GenerateProps/targetgroups.props @@ -4,76 +4,103 @@ <TargetGroups Include="netcore50"> <TargetingPackNugetPackageId>Microsoft.TargetingPack.Private.NetNative</TargetingPackNugetPackageId> <NuGetTargetMoniker>.NETCore,Version=v5.0</NuGetTargetMoniker> - <EnableWinRT>true</EnableWinRT> + <UWPCompatible>true</UWPCompatible> <CompatibleWith>netstandard1.4</CompatibleWith> </TargetGroups> <TargetGroups Include="netcore50aot"> <PackageTargetRuntimeSuffix>aot</PackageTargetRuntimeSuffix> <TargetingPackNugetPackageId>Microsoft.TargetingPack.Private.NetNative</TargetingPackNugetPackageId> <NuGetTargetMoniker>.NETCore,Version=v5.0</NuGetTargetMoniker> - <EnableWinRT>true</EnableWinRT> + <UWPCompatible>true</UWPCompatible> <Imports>netcore50</Imports> <CompatibleWith>netstandard1.4</CompatibleWith> </TargetGroups> <TargetGroups Include="uap101aot"> <PackageTargetRuntimeSuffix>aot</PackageTargetRuntimeSuffix> <NuGetTargetMoniker>UAP,Version=v10.1</NuGetTargetMoniker> - <EnableWinRT>true</EnableWinRT> + <UWPCompatible>true</UWPCompatible> <Imports>netcore50aot</Imports> <CompatibleWith>uap101;netstandard2.0</CompatibleWith> </TargetGroups> <TargetGroups Include="uap101"> <NuGetTargetMoniker>UAP,Version=v10.1</NuGetTargetMoniker> - <EnableWinRT>true</EnableWinRT> + <UWPCompatible>true</UWPCompatible> <Imports>netcore50</Imports> <CompatibleWith>netstandard2.0</CompatibleWith> </TargetGroups> <TargetGroups Include="uap"> <NuGetTargetMoniker>UAP,Version=v10.1</NuGetTargetMoniker> - <EnableWinRT>true</EnableWinRT> + <UWPCompatible>true</UWPCompatible> <Imports>uap101</Imports> <CompatibleWith>netstandard</CompatibleWith> </TargetGroups> <TargetGroups Include="uapaot"> <PackageTargetRuntimeSuffix>aot</PackageTargetRuntimeSuffix> <NuGetTargetMoniker>UAP,Version=v10.1</NuGetTargetMoniker> - <EnableWinRT>true</EnableWinRT> + <UWPCompatible>true</UWPCompatible> <Imports>uap101aot</Imports> <CompatibleWith>uap;netstandard</CompatibleWith> </TargetGroups> <TargetGroups Include="netstandard1.0"> <NuGetTargetMoniker>.NETStandard,Version=v1.0</NuGetTargetMoniker> + <!-- By default, netstandard libraries will be held to the UWP compatibility bar; + set this to false in the project to force otherwise. --> + <UWPCompatible>true</UWPCompatible> </TargetGroups> <TargetGroups Include="netstandard1.1"> <NuGetTargetMoniker>.NETStandard,Version=v1.1</NuGetTargetMoniker> + <!-- By default, netstandard libraries will be held to the UWP compatibility bar; + set this to false in the project to force otherwise. --> + <UWPCompatible>true</UWPCompatible> <Imports>netstandard1.0</Imports> </TargetGroups> <TargetGroups Include="netstandard1.2"> <NuGetTargetMoniker>.NETStandard,Version=v1.2</NuGetTargetMoniker> + <!-- By default, netstandard libraries will be held to the UWP compatibility bar; + set this to false in the project to force otherwise. --> + <UWPCompatible>true</UWPCompatible> <Imports>netstandard1.1</Imports> </TargetGroups> <TargetGroups Include="netstandard1.3"> <NuGetTargetMoniker>.NETStandard,Version=v1.3</NuGetTargetMoniker> + <!-- By default, netstandard libraries will be held to the UWP compatibility bar; + set this to false in the project to force otherwise. --> + <UWPCompatible>true</UWPCompatible> <Imports>netstandard1.2</Imports> </TargetGroups> <TargetGroups Include="netstandard1.4"> <NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker> + <!-- By default, netstandard libraries will be held to the UWP compatibility bar; + set this to false in the project to force otherwise. --> + <UWPCompatible>true</UWPCompatible> <Imports>netstandard1.3</Imports> </TargetGroups> <TargetGroups Include="netstandard1.5"> <NuGetTargetMoniker>.NETStandard,Version=v1.5</NuGetTargetMoniker> + <!-- By default, netstandard libraries will be held to the UWP compatibility bar; + set this to false in the project to force otherwise. --> + <UWPCompatible>true</UWPCompatible> <Imports>netstandard1.4</Imports> </TargetGroups> <TargetGroups Include="netstandard1.6"> <NuGetTargetMoniker>.NETStandard,Version=v1.6</NuGetTargetMoniker> + <!-- By default, netstandard libraries will be held to the UWP compatibility bar; + set this to false in the project to force otherwise. --> + <UWPCompatible>true</UWPCompatible> <Imports>netstandard1.5</Imports> </TargetGroups> <TargetGroups Include="netstandard2.0"> <NuGetTargetMoniker>.NETStandard,Version=v2.0</NuGetTargetMoniker> + <!-- By default, netstandard libraries will be held to the UWP compatibility bar; + set this to false in the project to force otherwise. --> + <UWPCompatible>true</UWPCompatible> <Imports>netstandard1.6</Imports> </TargetGroups> <TargetGroups Include="netstandard"> <NuGetTargetMoniker>.NETStandard,Version=v2.0</NuGetTargetMoniker> + <!-- By default, netstandard libraries will be held to the UWP compatibility bar; + set this to false in the project to force otherwise. --> + <UWPCompatible>true</UWPCompatible> <Imports>netstandard2.0</Imports> </TargetGroups> <TargetGroups Include="netcoreapp1.0"> diff --git a/src/shims/ApiCompatBaseline.uap.netstandard20.txt b/src/shims/ApiCompatBaseline.uap.netstandard20.txt index 0215090b4a..c1a1189358 100644 --- a/src/shims/ApiCompatBaseline.uap.netstandard20.txt +++ b/src/shims/ApiCompatBaseline.uap.netstandard20.txt @@ -18,6 +18,14 @@ CannotRemoveBaseTypeOrInterface : Type 'System.Security.AccessControl.RegistryAu CannotRemoveBaseTypeOrInterface : Type 'System.Security.AccessControl.RegistrySecurity' does not inherit from base type 'System.Security.AccessControl.NativeObjectSecurity' in the implementation but it does in the contract. Compat issues with assembly netstandard: TypesMustExist : Type 'System.Net.AuthenticationSchemeSelector' does not exist in the implementation but it does exist in the contract. +TypesMustExist : Type 'System.Net.Cookie' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Net.CookieCollection.Add(System.Net.Cookie)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Net.CookieCollection.CopyTo(System.Net.Cookie[], System.Int32)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Net.CookieCollection.Item.get(System.Int32)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Net.CookieCollection.Item.get(System.String)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Net.CookieContainer.Add(System.Net.Cookie)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Net.CookieContainer.Add(System.Uri, System.Net.Cookie)' does not exist in the implementation but it does exist in the contract. +TypesMustExist : Type 'System.Net.CookieException' does not exist in the implementation but it does exist in the contract. TypesMustExist : Type 'System.Net.HttpListener' does not exist in the implementation but it does exist in the contract. TypesMustExist : Type 'System.Net.HttpListenerBasicIdentity' does not exist in the implementation but it does exist in the contract. TypesMustExist : Type 'System.Net.HttpListenerContext' does not exist in the implementation but it does exist in the contract. @@ -53,8 +61,18 @@ TypesMustExist : Type 'System.Net.Mime.DispositionTypeNames' does not exist in t TypesMustExist : Type 'System.Net.Mime.MediaTypeNames' does not exist in the implementation but it does exist in the contract. TypesMustExist : Type 'System.Net.Mime.TransferEncoding' does not exist in the implementation but it does exist in the contract. TypesMustExist : Type 'System.Net.WebSockets.HttpListenerWebSocketContext' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Security.Cryptography.ECDsa.Create(System.Security.Cryptography.ECCurve)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Security.Cryptography.ECDsaCng..ctor(System.Security.Cryptography.ECCurve)' does not exist in the implementation but it does exist in the contract. Compat issues with assembly System: TypesMustExist : Type 'System.Net.AuthenticationSchemeSelector' does not exist in the implementation but it does exist in the contract. +TypesMustExist : Type 'System.Net.Cookie' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Net.CookieCollection.Add(System.Net.Cookie)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Net.CookieCollection.CopyTo(System.Net.Cookie[], System.Int32)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Net.CookieCollection.Item.get(System.Int32)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Net.CookieCollection.Item.get(System.String)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Net.CookieContainer.Add(System.Net.Cookie)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Net.CookieContainer.Add(System.Uri, System.Net.Cookie)' does not exist in the implementation but it does exist in the contract. +TypesMustExist : Type 'System.Net.CookieException' does not exist in the implementation but it does exist in the contract. TypesMustExist : Type 'System.Net.HttpListener' does not exist in the implementation but it does exist in the contract. TypesMustExist : Type 'System.Net.HttpListenerBasicIdentity' does not exist in the implementation but it does exist in the contract. TypesMustExist : Type 'System.Net.HttpListenerContext' does not exist in the implementation but it does exist in the contract. @@ -90,6 +108,8 @@ TypesMustExist : Type 'System.Net.Mime.DispositionTypeNames' does not exist in t TypesMustExist : Type 'System.Net.Mime.MediaTypeNames' does not exist in the implementation but it does exist in the contract. TypesMustExist : Type 'System.Net.Mime.TransferEncoding' does not exist in the implementation but it does exist in the contract. TypesMustExist : Type 'System.Net.WebSockets.HttpListenerWebSocketContext' does not exist in the implementation but it does exist in the contract. +Compat issues with assembly System.Core: +MembersMustExist : Member 'System.Security.Cryptography.ECDsa.Create(System.Security.Cryptography.ECCurve)' does not exist in the implementation but it does exist in the contract. Compat issues with assembly System.IO.FileSystem.AccessControl: TypesMustExist : Type 'System.IO.FileSystemAclExtensions' does not exist in the implementation but it does exist in the contract. TypesMustExist : Type 'System.Security.AccessControl.DirectoryObjectSecurity' does not exist in the implementation but it does exist in the contract. @@ -103,6 +123,15 @@ Compat issues with assembly System.IO.Pipes.AccessControl: CannotRemoveBaseTypeOrInterface : Type 'System.IO.Pipes.PipeAccessRule' does not inherit from base type 'System.Security.AccessControl.AccessRule' in the implementation but it does in the contract. CannotRemoveBaseTypeOrInterface : Type 'System.IO.Pipes.PipeAuditRule' does not inherit from base type 'System.Security.AccessControl.AuditRule' in the implementation but it does in the contract. CannotRemoveBaseTypeOrInterface : Type 'System.IO.Pipes.PipeSecurity' does not inherit from base type 'System.Security.AccessControl.NativeObjectSecurity' in the implementation but it does in the contract. +Compat issues with assembly System.Net.Primitives: +TypesMustExist : Type 'System.Net.Cookie' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Net.CookieCollection.Add(System.Net.Cookie)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Net.CookieCollection.CopyTo(System.Net.Cookie[], System.Int32)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Net.CookieCollection.Item.get(System.Int32)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Net.CookieCollection.Item.get(System.String)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Net.CookieContainer.Add(System.Net.Cookie)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Net.CookieContainer.Add(System.Uri, System.Net.Cookie)' does not exist in the implementation but it does exist in the contract. +TypesMustExist : Type 'System.Net.CookieException' does not exist in the implementation but it does exist in the contract. Compat issues with assembly System.Security.AccessControl: TypesMustExist : Type 'System.Security.AccessControl.AccessControlActions' does not exist in the implementation but it does exist in the contract. TypesMustExist : Type 'System.Security.AccessControl.AccessControlModification' does not exist in the implementation but it does exist in the contract. @@ -148,6 +177,10 @@ TypesMustExist : Type 'System.Security.AccessControl.RawSecurityDescriptor' does TypesMustExist : Type 'System.Security.AccessControl.ResourceType' does not exist in the implementation but it does exist in the contract. TypesMustExist : Type 'System.Security.AccessControl.SecurityInfos' does not exist in the implementation but it does exist in the contract. TypesMustExist : Type 'System.Security.AccessControl.SystemAcl' does not exist in the implementation but it does exist in the contract. +Compat issues with assembly System.Security.Cryptography.Algorithms: +MembersMustExist : Member 'System.Security.Cryptography.ECDsa.Create(System.Security.Cryptography.ECCurve)' does not exist in the implementation but it does exist in the contract. +Compat issues with assembly System.Security.Cryptography.Cng: +MembersMustExist : Member 'System.Security.Cryptography.ECDsaCng..ctor(System.Security.Cryptography.ECCurve)' does not exist in the implementation but it does exist in the contract. Compat issues with assembly System.Security.Permissions: TypesMustExist : Type 'System.Net.NetworkInformation.NetworkInformationAccess' does not exist in the implementation but it does exist in the contract. TypesMustExist : Type 'System.Net.NetworkInformation.NetworkInformationPermission' does not exist in the implementation but it does exist in the contract. @@ -265,4 +298,4 @@ CannotRemoveBaseTypeOrInterface : Type 'System.Security.AccessControl.MutexSecur CannotRemoveBaseTypeOrInterface : Type 'System.Security.AccessControl.SemaphoreAccessRule' does not inherit from base type 'System.Security.AccessControl.AccessRule' in the implementation but it does in the contract. CannotRemoveBaseTypeOrInterface : Type 'System.Security.AccessControl.SemaphoreAuditRule' does not inherit from base type 'System.Security.AccessControl.AuditRule' in the implementation but it does in the contract. CannotRemoveBaseTypeOrInterface : Type 'System.Security.AccessControl.SemaphoreSecurity' does not inherit from base type 'System.Security.AccessControl.NativeObjectSecurity' in the implementation but it does in the contract. -Total Issues: 248 +Total Issues: 277 |