Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.

Update Analyzer and ensure latest differences data. - #2999

Closed
hermitdave wants to merge 10 commits into
masterfrom
PSAUpdate
Closed

hermitdave wants to merge 10 commits into
masterfrom
PSAUpdate

Conversation

@hermitdave

Copy link
Copy Markdown
Contributor

Updating Analyzer for latest SDK versions
Remove Differences for API Contract 6.0.0.0
Add Differences for API Contract 8.0.0.0

Issue: #
mrlacey/Rapid-XAML-Toolkit#146 (comment)

PR Type

What kind of change does this PR introduce?

  • Other... Please describe: Update Analyser and consume differences based on latest UWP SDKs

What is the current behavior?

Older SDKs being referenced

What is the new behavior?

Update SDKs being referenced

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tested code with current supported SDKs
  • Pull Request has been submitted to the documentation repository instructions. Link:
  • Sample in sample app has been added / updated (for bug fixes / features)
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Header has been added to all new source files (run build/UpdateHeaders.bat)
  • Contains NO breaking changes

Other information

Updating Analyzer for latest SDK versions
Remove Differences for API Contract 6.0.0.0
Add Differences for API Contract 8.0.0.0
@michael-hawker

Copy link
Copy Markdown
Member

Thanks @hermitdave is the analyzer only able to look at N-1? Could we have it keep the old differences in order to alert folks of what min they need to target as we'll still be supporting down to 16299 for now?

Also looks like the CI build is failing

 CSC : error CS1566: Error reading resource 'Microsoft.Toolkit.Uwp.PlatformSpecificAnalyzer.Differences-6.0.0.0.gz' -- 'Could not find file 'D:\a\1\s\Microsoft.Toolkit.Uwp.PlatformSpecificAnalyzer\Differences-6.0.0.0.gz'.' [D:\a\1\s\Microsoft.Toolkit.Uwp.PlatformSpecificAnalyzer\Microsoft.Toolkit.Uwp.PlatformSpecificAnalyzer.csproj]

@hermitdave

Copy link
Copy Markdown
Contributor Author

The N-2 logic is hard code though I can take a look at making it flexible.
Let me check what the issue is with files

@michael-hawker

Copy link
Copy Markdown
Member

Thanks @hermitdave, let us know if you want to chat and bounce ideas off. I'm not entirely familiar with how this works, but I remember there was a problem where we didn't know what the min version the application is targeting? If so, could we use this type of analyzer example to grab info from parsing the csproj manually?

@hermitdave

Copy link
Copy Markdown
Contributor Author

There is no info on how analyzer can read csproj / vbproj files. Info requested from VS / SDK tab fell on deaf ears.

The original analyzer code that this is roughly based on added dummy file reference when nuget script was run during initial reference and I want comfortable with that mechanism. When project target SDK version is updated, IMO the dummy file wouldn't be updated and old SDK versions will continue to be used by analyzer making it useless.

I personally do not know of any way.

@hermitdave

Copy link
Copy Markdown
Contributor Author

@michael-hawker I have added support for 16299 and onwards and simplified the logic. I cannot fully the code changes as I cannot compile the toolkit for a long time now having tried both VS 2017 and VS 2019.
Apologies

@@ -29,27 +29,38 @@ internal enum TypePresenceIndicator
/// <summary>
/// Embedded differences between API contract version 4 and 5.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just missing a comment update here:

Suggested change
/// Embedded differences between API contract version 4 and 5.
/// Embedded differences between API contract version 5 and 6.

5 was 16299, eh?

@michael-hawker

Copy link
Copy Markdown
Member

@hermitdave sorry about that, if you've rebased on top of the latest master, you just need to run msbuild /restore from the toolkit repo root. You should be able to build in VS at that point. We're working with the NuGet team to understand the restore issue in VS.

@michael-hawker michael-hawker added this to the 6.0 milestone Sep 16, 2019

@azchohfi azchohfi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was throwing exceptions on the analyzer for me. There seems to be a missing:

_differencesDictionary.Add(N2DifferencesRes, GetApiAdditions(N2DifferencesRes));

at line 93.
After adding that a simple file new UWP project triggers maaaany false positives, for v1 APIs. It's pretty much tagging everything now.

@michael-hawker michael-hawker modified the milestones: 6.0, 6.1 Oct 29, 2019
@michael-hawker

Copy link
Copy Markdown
Member

@hermitdave did you see @azchohfi comment? Have you been able to verify this and find a solution? Thanks!

@hermitdave

Copy link
Copy Markdown
Contributor Author

@michael-hawker i can't seem to be compile any xaml uwp projects on Surface book. I will try again on a different device but that requires dev setup. As for false positives, the code is dumb - it flags anything that is in changes in the versions supported.

@michael-hawker

Copy link
Copy Markdown
Member

@azchohfi @hermitdave realizing now that once we move to WinUI 3, it's going to support all its versions, so there's just a single API surface.

Since we're having trouble getting these to work properly, does it instead make sense just to deprecate them and move on? As once we adopt WinUI 3, by construction, it basically solves these types of issues?

Thoughts?

@azchohfi

azchohfi commented Apr 2, 2020

Copy link
Copy Markdown
Contributor

WinUI3 will be RS4+, but this is only for WUX APIs, not everything. This package checks for every WinRT API, not only WUX. I think it still makes sense.

@michael-hawker

Copy link
Copy Markdown
Member

@hermitdave @azchohfi did they recently add helpers to VS?

image

@azchohfi

Copy link
Copy Markdown
Contributor

No idea.

@michael-hawker

Copy link
Copy Markdown
Member

@hermitdave since we don't have a good way to know the target of the project and have to continually update diffs but flag everything, should we just work with the VS team to get this added to VS like the XAML analyzers and just drop support for it in the Toolkit?

@michael-hawker

Copy link
Copy Markdown
Member

@LyalinDotCom we've been at a bit of an impasse here, do you know how the analyzer I saw above works and who owns it? This is a recently added feature, eh? It'd be great to know what's going on in this space, so if anything we just deprecate our attempts here, remove it from the Toolkit, and leverage/contribute to VS efforts instead? Thanks!

@LyalinDotCom

LyalinDotCom commented Jul 22, 2020 •

Copy link
Copy Markdown

@michael-hawker I'll respond over teams

@michael-hawker

Copy link
Copy Markdown
Member

Forgot we had this discussion already just elsewhere, looping back and closing this issue based on comment from here.

@azchohfi I've filed issue #3396 for tracking for 7.0.

@Kyaa-dost
Kyaa-dost deleted the PSAUpdate branch September 15, 2020 17:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants