Closed xperiandri closed 2 years ago
Hopefully we just need to replace the use of the DTE with DTE2 and it will work in both versions
Without any changes to the project file? Just replace that, add target to manifest and that's it?
This is the only pace where DTE
is referenced
https://github.com/madskristensen/DialToolsForVS/blob/c0f47f4dcd625dfe2c6b9b44fb8ab87d3fd8c21b/src/Helpers/VsHelpers.cs#L19
All the other places use DTE2
System.MissingMethodException: 'Method not found: 'Int32 EnvDTE.Window.get_HWnd()'.'
I tried to cast to Window2
but exception is the same System.MissingMethodException: 'Method not found: 'Int32 EnvDTE80.Window2.get_HWnd()'.'
@madskristensen any suggestions?
<Installation>
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[15.0.27130,17.0)" />
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[17.0,)">
<ProductArchitecture>amd64</ProductArchitecture>
</InstallationTarget>
</Installation>
Use Application.Current.MainWindow instead
But debugger returns a value from that property. How can this happen?
Weird COM interop stuff from the move to 64bit
https://github.com/madskristensen/DialToolsForVS/blob/c0f47f4dcd625dfe2c6b9b44fb8ab87d3fd8c21b/src/Providers/Errors/ErrorsController.cs#L21
System.MissingMethodException: 'Method not found: 'Void EnvDTE._dispWindowEvents_WindowActivatedEventHandler..ctor(System.Object, UIntPtr)'.'
Pushed WIP to my repo
@madskristensen I've just watched your video Hacking Visual Studio - DTE2 compatibility in VS 2022 and updated the extension accordingly
@madskristensen maybe it is time to publish it for Visual Studio 2022 to the store?
Fixed in #41
@madskristensen should I upgrade the existing csproj or do we need to have 2 projects in order to support the earlier versions of Visual Studio? And do we need to support them?
https://docs.microsoft.com/en-us/visualstudio/extensibility/migration/update-visual-studio-extension?view=vs-2022