-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VS 2022 VSIX support #960
Comments
FYI @BenJKuhn |
I'm taking a look at this. |
Note that with the transition to a 64-bit only IDE, there a few potential issues here you should be aware of. See Microsoft Docs for details. |
@DefaultRyan you fixed this already right? |
I couldn't get this to work at the end of last week, not even just placing the natvis file and dll in the appropriate directories, so I'm guessing it's not fixed, or at least not released. |
I've made the needed code changes, but an updated VSIX hasn't been pushed yet. |
I've downloaded and tried to install it, but the latest vsix never finishes installing successfully into 17 preview:
For some reason, it also doesn't even notice the VS2019 Community that's also installed. I have tried doing a "repair" of both VS installs, but the error persists. |
@DefaultRyan we've since shipped VSIX updates. Is there still a problem here? |
This continue to fail to install for Dev17 P3. |
I haven't been able to reproduce this problem on my end. I'll ask the Visual Studio folks about this. |
Don't know if this is related.
|
Same issue, attaching install log Relevant section:
|
The cyclic dependency issue is being tracked here and somebody on the VS team is testing the fix. We'll also make a tweak to the cppwinrt VSIX in conjunction with their fix. For @rpavlik's issue, had you already updated the VSIX to version 210505 previously? Have you tried uninstalling and reinstalling the extension? |
I hadn't ever successfully installed the vsix, I thought, but apparently I had gotten it installed somehow well enough to have updates suggested. Since I first chimed in, I (semi-accidetnally) ran the setup cleanpu program and have thus re-installed all my visual studios (thinking I had broken something that was preventing the upgrade to Preview 2.0), and now I can try to install the vsix thru extension manager at which point I get the cyclic dependency error now. So, the other one may have been from a weird slightly mangled install. |
Thanks for letting us know. The cyclic dependency fix will be in some future update of Visual Studio 2022. I'll be making a related fix to our VSIX to help prevent this going forward. |
Many developers are hitting this issue and Visual Studio seems to think its not their issue. I've closed a few other issues as duplicates of this one. |
It looks like the new Windows App SDK / WinUI projects have their own VSIX with similar project templates: https://marketplace.visualstudio.com/items?itemName=ProjectReunion.MicrosoftProjectReunion I expect those to be well supported. The cppwinrt repo will likely remain focused on the C++/WinRT library and code generator (that WinUI depends on) while the C++/WinRT VSIX will eventually be removed. I don't see any value in maintaining redundant project templates and we clearly don't have the resources to maintain the C++/WinRT VSIX support. Thoughts? Is there anything that would be missing with a switch to the Windows App SDK VSIX? |
@kennykerr the Windows App SDK VSIX does not enable devs to write apps against system xaml, the C++/WinRT VSIX is the only option, so we should keep both. |
Sounds good. Why doesn't the WinUI / WindowsAppSDK VSIX just provide a template for that? Then it can be the one-stop-shop for Windows app development. |
with WindowsAppSDK, you'd normally use WinUI 3 instead of system xaml. The two are incompatible. |
Sure, hence different project templates. 😉 |
This problem was not resolved in Preview 4.0 for my VS 2022 install. |
I couldn't agree more! |
when I type |
I was eagerly waiting for preview 4, installed it, BOOM! Disappointment ;-( |
We'll continue to investigate and work with VS on the issue. I'm not sure this is a C++ /WinRT issue though, per se. I was able to repro the crash, and it happens when VS is suggesting files for auto-completion when you type "#include <winr" Specifically, typing the "r" in that line triggers the crash. "#include <wina" will trigger the same crash but "#include <wind" will not. If I paste in "#include <winrt/" and start typing from there, I can get file suggestions, complete the include line, and start using the types that were included without issue. It also only repro's with <>, not with "". There are various other ways to "dodge" the crash. I tried playing with a few Intellisense settings in options to try to isolate further, but wasn't getting anywhere. In any case, that's a horrible workaround to have to live with, but hopefully it's enough to get you all unblocked from going a bit further in exploring 2022 preview 4 while we continue to work the issue. Ben |
Thanks @ByronAP, @DefaultRyan and I talked this morning. I'd lost track of the fact that there are now two separate issues, one with Intellisense and one with a dependency graph issue in updating from marketplace. Ryan will communicate the Intellisense issue to VS, and we'll continue to use this issue to track the dependency graph problems. |
I made a test build of the VSIX by removing the prerequisite on Instead of the cyclic dependency error, I hit a new error. I've uploaded the log, and here are some of the relevant snippets:
|
The issue is still there for me on Visual Studio 2022 Preview 4.1. |
Same |
For the intellisense issue, it's clearly a Visual Studio bug, and I filed a feedback item at https://developercommunity.visualstudio.com/t/ideintellisense-crash-when-including-cwinrt-header/1532185. Feel free to upvote that issue. Their system recently closed it as a duplicate of https://developercommunity.visualstudio.com/t/VS-Crashes-when-adding-include-tcharh-f/1519874, but I believe that's incorrect. Our issue appeared in Preview 4, while the duplicate says it was fixed in Preview 4. |
As far as I understand you should ask to reopen the issue as author. |
On the "closed as duplicate" comment, I was able to react "No: This is a different issue". I was unable to directly reopen as the author. Is it possible for people to vote on that reaction? I'm also going to follow up directly with the folks that currently own the feedback item. |
I tried to but my comment does not appear. Don't know if this is a glitch in the reporting system or it does not accept that. |
Update: I just upgraded from VS2022 Preview 4 to VS2022 Preview 4.1. The Intellisense bug appears to be resolved in 4.1. Does that track with others experience? |
@DefaultRyan The scenario described by Ben in an earlier comment does not crash the IDE for me with Preview 4.1. |
Still failing to install, version 2.0.210922.5 on Dev 17 Preview 5 |
Feel like the component in the dialog is the source of this problem. |
Couple of updates, and a clarification. First, the clarification: The bulk of C++/WinRT's functionality is provided by the CppWinRT NuGet package. This includes the cppwinrt compiler and the MSBuild logic to wire things up. The only functionality provided by the VSIX is the project templates and the debug visualizer. Those project templates create a project with a reference to the CppWinRT NuGet package. Both the project templates and debug visualizer are largely stable, rarely receiving updates. So even when using an older VSIX, you can easily upgrade to the latest and greatest C++/WinRT support by simply upgrading your project(s) NuGet references to the latest version. In fact, the long term intention is for developers to migrate from the C++/WinRT project templates, to the C++ project templates in the Windows App SDK. |
Regarding the current state of the VSIX: We'll continue to support the C++/WinRT marketplace extension for now, but just for VS2019. For VS2022, you get the same functionality right out of the box from the Visual Studio Installer. If/when we update the project templates or visualizer in the future, we'll ensure those updates appear in the next Visual Studio update. So there's no need to download and install the marketplace extension for VS2022. I'm still working with the Visual Studio folks to root cause the source of the errors we're seeing when trying to install the marketplace VSIX to a VS2022 instance. I performed an experiment with the VSIX to remove some prerequisites, and hit another roadblock with the VSIX installer not able to reconcile the C++/WinRT files included by Visual Studio with the C++/WinRT files coming from the marketplace VSIX. I've been told that this can be worked around by downloading the VSIX, opening an admin command prompt, and using the -force option to bypass some of the errors ( Once we solve those issues, and if the need arises for a VS2022-compatible standalone VSIX in the marketplace, I'll get one uploaded. But in the meantime, VS2022 users should continue using the C++/WinRT extension supplied by the VS Installer, and update their NuGet references as needed. I'll also be updating the marketplace VSIX to target only VS2019, to help prevent further confusion. |
I've had issues with the built-in templates of VS 2022 using a version of cppwinrt that didn't exist on NuGet, but apparently existed locally. This prevented even upgrading the NuGet without going in the vcxproj and packages.config file. |
That was a problem in the initial attempt at VS integration, where the inbox VSIX mistakenly didn't have a matching public release, so the NuGet restore failed in weird ways. That's no longer the case, and I'm ensuring that every update to the VS-integrated C++/WinRT will use a publicly available release. In fact, just now, I successfully updated a project from the 2.0.210806.1 NuGet included in VS2022 Preview 4 to the latest public available 2.0.210930.14. |
one thing to note is that the winappsdk templates will bind the app or component to winappsdk and therefore to winui3. I think it is reasonable to assume that a dev should be able to use VS 2022 to write apps and runtime components that use system xaml / WinUI 2.x. |
Yes, I think that's a good point. I'll reiterate that I'm not aware of any plans to remove the existing C++/WinRT templates. I was speaking more of the long-term aspirations that devs would gradually migrate to winappsdk (ideally because it becomes the new hotness). |
I'm hitting the same issue with VS2022,
looking through it, this is what I have there: ```
``` so I did something terrible, and commented the import out :) - it... works now... |
I now have pull request #1045 up, which splits the VSIX into VS2019 and VS2022 specific flavors. We'll continue updating the marketplace extension for VS2019 in the same way as before. For VS2022, we'll update the extension via Visual Studio updates. |
Now that VS 2022 is out in preview, the cppwinrt extension won't install on it since it explicitly excludes version 17.0.
The manifest should be updated and we also need to update the project to use the NuGet package for the Visual Studio SDK since it isn't included directly in VS anymore.
#918 already uses a NuGet package for the SDK, and if somebody has to spend the time to make a new version compatible with VS 2022, we might as well merge enhancements like that PR and #924.
The text was updated successfully, but these errors were encountered: