Fix compilation with VS16.10 and later (#10208)

## Summary of the Pull Request

VS16.10 and later contain two regressions:
* Marking the use of `pshpack*.h` in system headers with C4103
* The newly included, builtin `AssemblyReference.xaml` is missing the `AssemblyReferences` project capability

## PR Checklist
* [x] I work here

## Validation Steps Performed

Built the project with VS16.10 and VS17.0.
This commit is contained in:
Leonard Hecker 2021-05-26 22:11:38 +02:00 committed by GitHub
parent 43d5713a02
commit 5d6eec6cde
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 13 deletions

View file

@ -7,6 +7,7 @@ appx
appxbundle appxbundle
appxerror appxerror
appxmanifest appxmanifest
ATL
backplating backplating
bitmaps bitmaps
BOMs BOMs

View file

@ -2,10 +2,7 @@ AAAa
AAAAA AAAAA
AAAAAAAAAAAAA AAAAAAAAAAAAA
AAAAAABBBBBBCCC AAAAAABBBBBBCCC
AAAAABBBBBBBCCC
AAAAABBBBBBCCC AAAAABBBBBBCCC
AAAAABCCCCCCCCC
AAAAADCCCCCCCCC
abcd abcd
abcd abcd
abcde abcde

View file

@ -183,7 +183,6 @@ bytebuffer
cac cac
cacafire cacafire
callee callee
cang
capslock capslock
CARETBLINKINGENABLED CARETBLINKINGENABLED
CARRIAGERETURN CARRIAGERETURN
@ -1368,7 +1367,6 @@ MEASUREITEM
megamix megamix
memallocator memallocator
memcmp memcmp
memcopy
memcpy memcpy
memmove memmove
memset memset
@ -1968,7 +1966,6 @@ rftp
rgb rgb
rgba rgba
rgbi rgbi
rgch
rgci rgci
rgfae rgfae
rgfte rgfte
@ -2044,8 +2041,6 @@ scriptload
Scrollable Scrollable
scrollback scrollback
scrollbar scrollbar
Scrolldown
Scrolldownpage
Scroller Scroller
SCROLLFORWARD SCROLLFORWARD
SCROLLINFO SCROLLINFO
@ -2053,8 +2048,6 @@ scrolllock
scrolloffset scrolloffset
SCROLLSCALE SCROLLSCALE
SCROLLSCREENBUFFER SCROLLSCREENBUFFER
Scrollup
Scrolluppage
scursor scursor
sddl sddl
sdeleted sdeleted
@ -2069,7 +2062,6 @@ selectany
SELECTEDFONT SELECTEDFONT
SELECTSTRING SELECTSTRING
Selfhosters Selfhosters
serializer
serializers serializers
SERVERDLL SERVERDLL
SETACTIVE SETACTIVE

View file

@ -96,8 +96,17 @@
<TreatSpecificWarningsAsErrors>4189;4100;4242;4389;4244</TreatSpecificWarningsAsErrors> <TreatSpecificWarningsAsErrors>4189;4100;4242;4389;4244</TreatSpecificWarningsAsErrors>
<!--<WarningLevel>EnableAllWarnings</WarningLevel>--> <!--<WarningLevel>EnableAllWarnings</WarningLevel>-->
<TreatWarningAsError>true</TreatWarningAsError> <TreatWarningAsError>true</TreatWarningAsError>
<!-- disable warning on nameless structs (4201) --> <!--
<DisableSpecificWarnings>4201;4312;4467;%(DisableSpecificWarnings)</DisableSpecificWarnings> C4103: alignment changed after including header, may be due to missing #pragma pack(pop)
Caused by a regression in VS 16.10, it detects the use of /pshpack[1248].h/ in system headers.
C4201: nonstandard extension used: nameless struct/union
Conhost code uses a lot of nameless structs/unions.
C4312: 'type cast': conversion from 'A' to 'B' of greater size
Conhost code converts DWORDs to HANDLEs for instance.
C4467: usage of ATL attributes is deprecated
Conhost code still uses ATL.
-->
<DisableSpecificWarnings>4103;4201;4312;4467;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<PreprocessorDefinitions>_WINDOWS;EXTERNAL_BUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_WINDOWS;EXTERNAL_BUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<PrecompiledHeaderFile>precomp.h</PrecompiledHeaderFile> <PrecompiledHeaderFile>precomp.h</PrecompiledHeaderFile>

View file

@ -31,6 +31,26 @@
</ProjectConfiguration> </ProjectConfiguration>
</ItemGroup> </ItemGroup>
<!--
VS 16.10 contains a regression, which causes our solution to fail loading.
In Visual Studio you'll see:
Visual Studio ran into an unexpected problem with one or more projects.
You may need to reload affected projects or the solution to prevent further problems.
[Open log file] [Reload faulted project(s)]
The log file points to the following error:
System.InvalidOperationException: There is no project properties provider for "Persistence = AssemblyReference".
This error is caused by the following lines in our Microsoft.UI.Xaml dependency:
https://github.com/microsoft/microsoft-ui-xaml/blob/v2.5.0/build/NuSpecs/MUXControls-Nuget-Native.targets#L9-L11
See _DevDiv_ work item MSFT:1328040.
-->
<ItemGroup>
<ProjectCapability Include="AssemblyReferences" />
</ItemGroup>
<PropertyGroup> <PropertyGroup>
<WapProjPath Condition="'$(WapProjPath)'==''">$(MSBuildExtensionsPath)\Microsoft\DesktopBridge\</WapProjPath> <WapProjPath Condition="'$(WapProjPath)'==''">$(MSBuildExtensionsPath)\Microsoft\DesktopBridge\</WapProjPath>
<!-- Turn off the 6+MB Windows.winmd that's emitted into our package <!-- Turn off the 6+MB Windows.winmd that's emitted into our package