-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Cannot use MSBuildLocator with multiple versions of Visual Studio for different projects #71197
Comments
So the fact you can't use different versions of MSBuild for different projects (at least with MSBuildLocator) would be expected, since once MSBuildLocator has loaded a VS version of MSBuild we can't unload it -- there's not AppDomain isolation or anything in the way we'd need to make that work. That said, this feels like a bit of a red herring -- I wouldn't expect a high version to not work with something that a lower version does.
But there's a good chance the work we did for those newer packages might fix this. |
Those packages are now up, so @vladimirKa002 want to give those a shot and report back? |
@vladimirKa002 Any chance you can try the new packages and report back? |
@jasonmalinowski, thank you for your response. I tried a new package, and it solved the problem. Now I can perform the analysis of both projects normally. |
Awesome, thanks for confirming! And to be clear: with the new packages you don't need MSBuildLocator at all anymore, so feel free to remove the package references and any use of the API. |
@jasonmalinowski, could you please check this issue. Seems like after upgrading the packages to a newer version, analyses stopped working in Docker environment. |
@vladimirKa002 Thanks for the ping, since that issue had gotten closed we otherwise wouldn't have seen it. |
Version Used: 4.8.0
Steps to Reproduce:
Tested C# projects (.csproj): project1 and project2.
Projects loading method:
Installed Visual Studio versions:
Dependecies:
Expected Behavior: Projects should be loaded normally with all documents from the path.
Actual Behavior:
When I run the following code snippet at the start of the analysis, the first project has zero documents. However, the second one gets loaded normally:
But when I select the second VS version
MSBuildLocator
, the first project works fine, but the second one gets stuck forever.Instead of this code, I also tried
MSBuildLocator.RegisterDefaults();
, but it behaved similarly to when the first version is selected.The text was updated successfully, but these errors were encountered: