-
Notifications
You must be signed in to change notification settings - Fork 54
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
VSWhere usage currently causes dependency on Visual Studio #74
Comments
vswhere is already added via nuget package in the TestProject folder: https://github.com/reqnroll/Reqnroll/blob/main/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator.csproj#L24 |
yeah, the issue is vswhere is specifically created to locate Visual Studio or other Microsoft-related build tooling. I think this leaves out .net tooling installed through Jetbrains products, the C# Dev Kit for Visual Studio Code or even a direct install of .NET SDK |
Just adding some more notes:
|
Seems like the latest guidance for referencing MSBuild programmatically is to use nuget packages. |
@Tiberriver256 well, yes, but that would require to restructure the whole generator concept, I fear. The need for testing through MsBuild is getting less and less important, so I would not invest that much time on it. So I think we should stick to executing |
Sounds good 👍 A new method for locating MSBuild is provided from a nuget package called It supports finding MSBuild installed as part of the dotnet SDK in addition to Visual Studio. The only caveat is provided in this warning:
|
As long as Visual Studio runs on .NET Framework and uses the integrated MSBuild, this is important. Specially the assembly loading is different so every third party dependency can make problems. |
Sure. That's what I wanted to say with "less and less" - hopefully VS will also change its behavior at some point... :)
Do you mean especially generator plugins? Or have you seen problems with normal lib dependencies as well? |
Fixed by #75 |
Unfortunately this solution does not work. Now as I work on "portability" tests of system testing and want to test the build with MsBuild, it turned out:
Conclusion: I will undo this change and revert to a solution that finds |
Sounds good. Bummer on the sdk only including a dll. I'll take another stab at this but sounds like we should prioritize getting tests running in the CI first before we go again so I don't drop more broken stuff in. |
@Tiberriver256 yes, this is my plan with #82. I made the fix there and as a result now it works locally (on a machine with VS). I will try to setup the CI tomorrow. |
Next to vswhere, when it fails to locate an installation, we should probably use https://www.nuget.org/packages/JetBrains.Rider.PathLocator (which is https://github.com/JetBrains/RiderSourceCodeAccess/tree/main/Source/RiderSourceCodeAccess/Private/RiderPathLocator) to locate the installation of Rider. If one is found we can use the packaged msbuild.exe. It is in a fixed path within that folder at |
@ajeckmans I will do that. Does Rider adds this folder to the PATH maybe? (or at least for the scope of the test execution process)? |
I have no idea. |
Fixed as part of #82. The Rider heuristics are not added yet. |
Goal
Make contributing to Reqnroll codebase easier for developers who are not using Visual Studio
Additional Information
See discussion here.
Note on background from @SabotageAndi
Proposed direction from @gasparnagy
I also dug into this a bit, and it seems we technically don't need Visual Studio to get VSWhere. There are some alternative ways to install it, one of which is a nuget package.
Before that, though, I'm going to try and document in this bug discussion exactly what tests use it and why.
The text was updated successfully, but these errors were encountered: