VSCT not loaded

Rudolf Meier 271 Reputation points
2021-11-12T14:54:29.973+00:00

Visual Studio 2019 doesn't allow synchronous addins anymore (no idea why, since some tools are so tiny, that it's way faster to execute what they do than to launch the async initialization process, but hey... who am I to talk about this? ... they're the "experts").

So, that's why I tried to convert our tools from sync to async... those addins are written in C++ and work in VS 2017 (sync) ... but when I modify them to load async, the system seems not to find or not to process the VSCT resources (or the resources that have been built by compiling the VSCT file).

The question is why. What process is involved here? I called IVsShell::LoadUILibrary in the IVsPackage::SetSite implementation to load the localized resources. Now in the async world I tried to do this in the
IAsyncLoadablePackageInitialize::Initialize implementation (or, in the task that I'm starting in this function). This doesn't work. That's why I went back and did it again in the IVsPackage::SetSite implementation (which is still called even for async modules... who knows why and what we should do there or return or... well, let's say it like this "the documentation is very detailed in this point"). ... but this still doesn't work.

So, here's the question: What do I have to do/provide that Visual Studio 2017/19/22 is loading and processing the VSCT resources in an async extension?

Rudolf

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
23,791 questions
No comments
{count} votes

Accepted answer
  1. Rudolf Meier 271 Reputation points
    2021-11-14T22:21:45.567+00:00

    Oh no... it's not true that it's not loaded. But the module behind is not called in the correct way (or to be precise "some functions") and that's why the visibility is incorrectly set. And I think it is, because all modules are loaded in an STA? ... or the marshalling class for STA is used? ... well, whatever, for this time I'm not interested in the details... normally yes, this time not. In the end the trick is to use custom marshalling... something like this https://github.com/tyoma/micro-profiler/commit/2f58342af3738a1294d4abb63d190290ee6844d4#diff-1a96824ec443086b6b1080a2ccc38245

    No comments

0 additional answers

Sort by: Most helpful