-
Notifications
You must be signed in to change notification settings - Fork 1.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
Need to get the path to the dotnet.exe
host in GetRunInformation MSBuild target
#20
Comments
My 0.02c here. For .NET Core MSBuild, it should use the path to the host it was invoked with. I think the closest we can currently get to this is resolving the path relative to the current shared framework deps file like here: |
One concern is when MSBuild is running on the desktop framework, but building a .NET Core App. Say, for example, when invoked from VS. |
csc roslyn fixed embeeding a .cmd/.sh. i filled dotnet/msbuild#1669 in msbuild repo, because is not about sdk itself |
I'm seeing an issue that is possible related:
This is when trying to F5 or F11 from within VS. |
How are you invoking dotnet run? Is the version of the host that you are using a x86 host? Do you have the x86 host ahead on the PATH compared to the x64 one? dotnet run today simply shell out to the host. So, if you have a x86 project and you have an x64 host in the path (before the x86) you will hit this issue. |
I just created a netcore console app, set it to target x86 and hit F5 (I have both the x64 and x86 SDK installed). This seems like a scenario that we should have covered, regardless of how the paths are configured. |
This is something that we have been thinking about but we could not come up with the right solution yet. Strictly speaking, there is no way that we can know which dotnet in PATH is an x86 versus an x64 dotnet. So, this responsibility has been falling on the user. I agree that if the user invoked <path_to_x86_dotnet>/dotnet run, then it should work, even if the x64 dotnet is ahead on the path, and I don't think that works today because of how we shell out the dotnet invocation. That we could fix if this bug were fixed. |
Is this not something the SDK itself could expose, in a similar manner to how the SDK's are able to add new target frameworks (i.e. netcore2.0 shows in VS only after you install the 2.0 Preview SDK)? Otherwise, why not check the PE Header Metadata for all |
Use linker's example. Use DOTNET_HOST_PATH on core. And use |
Reopening as there's still a TODO in the sdk that points to this tracking issue:
|
Adding the NuGet build package source
We are currently returning
dotnet.exe
without a path in<Target Name="GenerateRunInformation">
in the Microsoft.DotNet.Core.Sdk.targets file.We should either:
dotnet.exe
to call from inside our MSBuild target.dotnet run
that this project should use its host to run the project.The text was updated successfully, but these errors were encountered: