Set minimum install target to match version of referenced SDK - #482
Merged
Conversation
Contributor
|
Thank you for the detailed write-up! Super helpful to have documented for future reference.
Is this an optimization we can make in the VS2017/2019 manifest as well? |
Contributor
Author
Yes - but I don't have vs2017 installed anywhere to test it |
grochocki
approved these changes
Apr 8, 2024
grochocki
left a comment
Contributor
There was a problem hiding this comment.
Change looks good, thanks!
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For #466 and #479
Description:
The VS 2022 extension had a mismatch between the minimum supported version and the referenced SDK version. This meant it was possible to install on a version of VS that contained an older version of the SDK than the one the extension uses and was compiled against.
This PR contains two changes:
1. It sets the minimum install version to match the referenced SDK version. Currently 17.8.
(It's ok only to match the major and minor parts of the version number as there is only one 17.8.* version of the SDK.)
The manifest was configured to allow installation on v17.0 or above, but the SDK the extension referenced a newer version.
When the extension (package) loads, it tries to load the reference assemblies based on the version it was compiled with. If the assembly it tries to load isn't compatible with what it expects (e.g. there has been a breaking change in the binary compatibility or APIs) the package will fail to load and throw an exception like that seen in #466.
While the above is not apparent from the error messages (nor documented--AFAIK), it makes sense once you know what's happening.
Yes, it would be nice to have an analyzer or similar build-time check to avoid inconsistencies in these two numbers that might cause errors. (I doubt MS will ever make one, and it hasn't gotten high enough up my to-do list for me to make something.)
If there's a reason to support installing on older versions of VS, the referenced SDK version should be changed to match the minimum supported version.
(I've checked the VS2019 versions, and they're the same--both 15.0)
2. It removes unnecessary install targets.
If you allow installing on the Community version of VS, this really means "Community or higher" and this includes Professional and Enterprise.
Similarly, if you allow installing on the Professional version, this also allows installing in the Enterprise version.
To allow installing on Community, Professional, and Enterprise versions, it's only necessary to specify that the extension can be installed on the Community version.
Because of this, I have removed the Professional and Enterprise specific install target entries as they're not needed.
In earlier versions of VS, it was more common to make extensions available only to some SKUs. It's now much more common to make 3rd party extensions available to all.
MS also claim that all functionality between Community and professional should be the same and it's really only licensing that the difference between the two.
There are also only a few things that the Enterprise version has that the others don't. Unless creating an extension that relies or builds upon one of these features there should be no real reason not to only target the Community version.
Checklist: