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
Add option to use a different DOTNET host than the one located in the path #1749
Comments
Have you tried setting the environment variable before invoking the devenv in cmd/shell. |
@ViktorHofer Gentle ping. |
Sorry for the late response, I was OOF for a few days.
Sure that's an option but we want to use a different host for testing than for building (in corefx we currently use a minimal dotnet host which is only used during testing). Also for an optimal inner loop dev scenario we want to avoid setting local environment variables and launching VS from bash. |
@ViktorHofer One basic principle we follow is to avoid adding new tags in Runsettings unless absolutely necessary. Reason being, adding is easy, removing is difficult. This ask is very specific to this particular scenario. And given there is already a workaround for this, I am not able to make a case. Another concern I have is if we add something on lines you suggest, we'd have to document it. Even a normal user will also be able to set the path to whatever location he/she wants and that might result in unexpected behavior. /cc: @PBoraMSFT @cltshivash |
Yes two reasons:
|
So we discussed that topic internally and it seems in fact we don't need to tell the test framework to use a different host but to use the same as the project-system does. We pass the host via the StartProgram/RunCommand (launchSettings.json) same as the usual customer does. If I'm right the test-framework currently determines the host in the specific order (https://devdiv.visualstudio.com/DevDiv/_git/DotNet-Source-Build-Tarball?path=%2Fsrc%2Fvstest%2Fsrc%2FMicrosoft.TestPlatform.TestHostProvider%2FHosting%2FDotnetTestHostManager.cs&version=GBmaster&line=172&lineEnd=183&lineStartColumn=13&lineEndColumn=14&lineStyle=plain):
I spoke with @davkean yesterday who agrees that the test-framework should just ask the project-system for it. Ideally it should also use the environment variables that are passed in from the launchSettings.json. cc @eerhardt |
@ViktorHofer Thank you for note. |
@davkean can you please assist here? How can the test framework ask the project system for the right executable and other stuff defined in the launchSettings.json / Run props? |
@ViktorHofer : Any updates here? |
I didn't yet get a response from Dave, I also contacted him offline. Let me reach out to him again as I don't know how to follow-up here. |
@ViktorHofer : Did you get a chance to follow up with Dave? |
Not yet. Unfortunately I couldn't find the right person who could help here. Can you assist here? |
@ManishJayaswal @nohwnd I want to resume the discussion for this ask. To make the ask more specific, we need the following feature: Allow specifying the path to the .NET Host For .NET Framework we don't need an additional hook as we can add the Proposed .runsettings change: <?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<RunConfiguration>
<DotNetHostPath>%absolute-path-to-muxer%\dotnet.exe</DotNetHostPath>
</RunConfiguration>
</RunSettings> Relevant code pieces to enable this feature: vstest/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs Lines 180 to 305 in 064dcc1
|
Small question on the naming: Do we use the term |
You are right, |
Follow-up on the offline discussion that we had. We (the .NET team) want to enable VS Text Explorer support for corefx.
We are building the shared framework and the runtime ourselves, we do things differently as the average user. Still we see a strong demand for enabling Test Explorer like in a regular app.
We (corefx) are the ones that build the framework itself. Therefore we can’t use the shared framework located under
%PATH%/dotnet/shared/Microsoft.NETCore.App/x.x.x/
as we want to test our live build.We don’t take a dependency on the globally installed .NET Core SDK and its dotnet.exe host and use nightly builds instead. That’s because we rely on features that aren’t yet available and because we don’t need that dependency.
We need a way to tell the VS Text Framework (Test Explorer) to use our dotnet host under corefx instead of the global one in the path. Probably via a switch in the .runsettings file that allows to set the custom path.
On the command-line we run tests in a different way by directly invoking xunit.console.dll but with Visual Studio we just want to use the Test Explorer which I'm not sure what it uses behind the scenes. For xunit we are using its test adapter: https://www.nuget.org/packages/xunit.runner.visualstudio/
Can we do that when we just use VS Test Explorer?
cc @singhsarab @danmosemsft
The text was updated successfully, but these errors were encountered: