Skip to content

Commit

Permalink
Fix compilation with VS16.10 and later (#10208)
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
lhecker committed May 26, 2021
1 parent 43d5713 commit 5d6eec6
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 13 deletions.
1 change: 1 addition & 0 deletions .github/actions/spelling/allow/microsoft.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ appx
appxbundle
appxerror
appxmanifest
ATL
backplating
bitmaps
BOMs
Expand Down
3 changes: 0 additions & 3 deletions .github/actions/spelling/expect/alphabet.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ AAAa
AAAAA
AAAAAAAAAAAAA
AAAAAABBBBBBCCC
AAAAABBBBBBBCCC
AAAAABBBBBBCCC
AAAAABCCCCCCCCC
AAAAADCCCCCCCCC
abcd
abcd
abcde
Expand Down
8 changes: 0 additions & 8 deletions .github/actions/spelling/expect/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ bytebuffer
cac
cacafire
callee
cang
capslock
CARETBLINKINGENABLED
CARRIAGERETURN
Expand Down Expand Up @@ -1368,7 +1367,6 @@ MEASUREITEM
megamix
memallocator
memcmp
memcopy
memcpy
memmove
memset
Expand Down Expand Up @@ -1968,7 +1966,6 @@ rftp
rgb
rgba
rgbi
rgch
rgci
rgfae
rgfte
Expand Down Expand Up @@ -2044,17 +2041,13 @@ scriptload
Scrollable
scrollback
scrollbar
Scrolldown
Scrolldownpage
Scroller
SCROLLFORWARD
SCROLLINFO
scrolllock
scrolloffset
SCROLLSCALE
SCROLLSCREENBUFFER
Scrollup
Scrolluppage
scursor
sddl
sdeleted
Expand All @@ -2069,7 +2062,6 @@ selectany
SELECTEDFONT
SELECTSTRING
Selfhosters
serializer
serializers
SERVERDLL
SETACTIVE
Expand Down
13 changes: 11 additions & 2 deletions src/common.build.pre.props
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,17 @@
<TreatSpecificWarningsAsErrors>4189;4100;4242;4389;4244</TreatSpecificWarningsAsErrors>
<!--<WarningLevel>EnableAllWarnings</WarningLevel>-->
<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>
<SDLCheck>true</SDLCheck>
<PrecompiledHeaderFile>precomp.h</PrecompiledHeaderFile>
Expand Down
20 changes: 20 additions & 0 deletions src/wap-common.build.pre.props
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,26 @@
</ProjectConfiguration>
</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>
<WapProjPath Condition="'$(WapProjPath)'==''">$(MSBuildExtensionsPath)\Microsoft\DesktopBridge\</WapProjPath>
<!-- Turn off the 6+MB Windows.winmd that's emitted into our package
Expand Down

0 comments on commit 5d6eec6

Please sign in to comment.