Skip to content
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

Please re-include msdia140typelib_clr0200.dll in the NuGet package Microsoft.TestPlatform.17.4.x #3922

Closed
arvindshmicrosoft opened this issue Aug 3, 2022 · 8 comments

Comments

@arvindshmicrosoft
Copy link
Member

Description

Microsoft.TestPlatform.17.4.0-preview-20220707-01 is missing msdia140typelib_clr0200.dll. In past releases of this NuGet (the latest prior one I can see is 17.3.0-preview-20220612-01), this typelib is present in tools/net451/Common7/IDE/Extensions/TestPlatform/msdia140typelib_clr0200.dll.

Please bring back the msdia140typelib_clr0200.dll as it breaks existing app and test code which uses the DIA SDK from C# and needs this typelib.

Steps to reproduce

N/A

Expected behavior

The Microsoft.TestPlatform will include msdia140typelib_clr0200.dll under tools/net451/Common7/IDE/Extensions/TestPlatform/msdia140typelib_clr0200.dll

Actual behavior

Microsoft.TestPlatform.17.4.0-preview-20220707-01 is missing msdia140typelib_clr0200.dll.

Diagnostic logs

N/A

Environment

N/A

@Evangelink
Copy link
Member

cc @MarcoRossignoli and @nohwnd

@Evangelink
Copy link
Member

Evangelink commented Aug 3, 2022

@arvindshmicrosoft Would you mind sharing with us the scenario in which you are using it? Ideally if you have a repro that would be awesome. Is it that you were relying on the fact this dll was shipped with test platform?

We removed this dependency because it's not used anywhere in our code.

EDIT: The old dll was actually deprecated but we are shipping the new one that is recommended and called msdia140.dll (see #3822 (comment)). You would need to update your code to use this new dll.

@arvindshmicrosoft
Copy link
Member Author

arvindshmicrosoft commented Aug 3, 2022

Thanks @Evangelink for sharing the reason behind this change. Let me share the scenario behind this issue:

  • msdia140.dll is part of the DIA SDK within Visual Studio and is a COM library.
  • In order to use DIA from within managed applications we need a typelib, which can typically by running midl and typelib against the %VSINSTALLDIR%\DIA SDK\idl\dia2.idl provided by the DIA SDK.
  • However, at least since VS 2015, msdia140typelib_clr0200.dll is shipped with Visual Studio (the exact location has changed, initially I remember it used to be under Common7\IDE\CommonExtensions\Microsoft\TestWindow, now of course in 2022 it is under Common7\IDE\Extensions\TestPlatform) has provided a ready-to-use typelib.
  • The ready-to-use msdia140typelib_clr0200.dll eliminates the need for the developer to manually running midl and typelib to generate the "wrapper" needed to use msdia140.dll from within managed apps.

I can work around by now proceeding to run midl and typelib to generate the equivalent of msdia140typelib_clr0200.dll but having msdia140typelib_clr0200.dll as part VS 2022 and in the VSTest NuGet saves some steps for devs trying to use DIA from managed code.

Though - I totally understand and respect if you stay with the change and do not choose to include msdia140typelib_clr0200.dll anymore in this NuGet. Feel free to close the issue with that note, if the decision is final.

@nohwnd
Copy link
Member

nohwnd commented Aug 4, 2022

@arvindshmicrosoft Thanks for the context, we are not going to ship that library anymore, because it was made to support .NET Framework 2.0 and we don't have any use for it anymore because we replaced it with p/Invoke.

I've added you to the original thread that explains the details and motivated the removal of this library, hopefully there is alternative library already shipped with VS. Or you can add additional nuget to their build pipeline to create and ship it for you.

I admittedly don't know enough about how this works. From what I understand we moved to using PInvoke with msdia140, to consume it from our C# code. Is not generating a typelib for it, and using that a lost opportunity for us?

@arvindshmicrosoft
Copy link
Member Author

@nohwnd - the explanations on this Issue are clear and I will close this issue. I understand why the typelib was removed from VSTest. We will generate the typelib using MIDL and tlbimp for now. Hopefully in the future we will have some other cleaner way for MSDIA interop for all.

@Evangelink
Copy link
Member

Suggestion from @MarcoRossignoli: depending on your needs, you could update your code to rely on https://github.com/dotnet/symreader-portable.

@arvindshmicrosoft
Copy link
Member Author

Thank you @Evangelink - unfortunately my requirement is solely for native PDBs, so DIA is the only way out.

@Evangelink
Copy link
Member

Just in case this could help, according to their readme:

The implementation of these interfaces for Windows PDBs is provided by Microsoft.DiaSymReader.Native package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants