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

MSTest.Sdk issues testing Visual studio extensions #4834

Closed
avivanoff opened this issue Jan 29, 2025 · 4 comments
Closed

MSTest.Sdk issues testing Visual studio extensions #4834

avivanoff opened this issue Jan 29, 2025 · 4 comments

Comments

@avivanoff
Copy link

We have a scenario where we need to test a Visual Studio extension. Effectively, it is a class library project that references Microsoft.VisualStudio.SDK package.

When executing tests from Visual Studio everything works as expected.

When executing the tests from command line using the executable the error occurs:

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.Interop, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

@Evangelink
Copy link
Member

Hi @avivanoff,

Would it be possible for you to share some repro so we could debug?

I assume you are using MSTest runner with the SDK, right?

@avivanoff
Copy link
Author

@Evangelink, sample project.

@Youssef1313 Youssef1313 self-assigned this Feb 17, 2025
@Youssef1313
Copy link
Member

The problem here is that VsixLib.csproj is adding ExcludeAssets="runtime" to the PackageReference of Microsoft.VisualStudio.SDK, so things doesn't flow correctly to the test project.

Either the ExcludeAssets should be removed, or alternatively, the PackageReference needs to be added to the test project as well.

From VSIX development point of view, I'm not sure what the recommendation is. But the behavior on MSTest/MTP side is expected.

@avivanoff
Copy link
Author

Removing ExcludeAssets="runtime" is definitely the wrong option. Adding Microsoft.VisualStudio.SDK to the test project should work.

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

No branches or pull requests

3 participants