-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Find dotnet.exe instead of <name>.exe when building out-of-proc using MSBuildLocator #6890
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,7 +27,6 @@ | |
|
|
||
| using BackendNativeMethods = Microsoft.Build.BackEnd.NativeMethods; | ||
| using Task = System.Threading.Tasks.Task; | ||
| using DotNetFrameworkArchitecture = Microsoft.Build.Shared.DotNetFrameworkArchitecture; | ||
| using Microsoft.Build.Framework; | ||
| using Microsoft.Build.BackEnd.Logging; | ||
|
|
||
|
|
@@ -434,9 +433,9 @@ private Process LaunchNode(string msbuildLocation, string commandLineArgs) | |
|
|
||
| // Repeat the executable name as the first token of the command line because the command line | ||
| // parser logic expects it and will otherwise skip the first argument | ||
| commandLineArgs = msbuildLocation + " " + commandLineArgs; | ||
| commandLineArgs = $"\"{msbuildLocation}\" {commandLineArgs}"; | ||
|
|
||
| BackendNativeMethods.STARTUP_INFO startInfo = new BackendNativeMethods.STARTUP_INFO(); | ||
| BackendNativeMethods.STARTUP_INFO startInfo = new(); | ||
| startInfo.cb = Marshal.SizeOf<BackendNativeMethods.STARTUP_INFO>(); | ||
|
|
||
| // Null out the process handles so that the parent process does not wait for the child process | ||
|
|
@@ -466,8 +465,8 @@ private Process LaunchNode(string msbuildLocation, string commandLineArgs) | |
| creationFlags |= BackendNativeMethods.CREATE_NEW_CONSOLE; | ||
| } | ||
|
|
||
| BackendNativeMethods.SECURITY_ATTRIBUTES processSecurityAttributes = new BackendNativeMethods.SECURITY_ATTRIBUTES(); | ||
| BackendNativeMethods.SECURITY_ATTRIBUTES threadSecurityAttributes = new BackendNativeMethods.SECURITY_ATTRIBUTES(); | ||
| BackendNativeMethods.SECURITY_ATTRIBUTES processSecurityAttributes = new(); | ||
| BackendNativeMethods.SECURITY_ATTRIBUTES threadSecurityAttributes = new(); | ||
| processSecurityAttributes.nLength = Marshal.SizeOf<BackendNativeMethods.SECURITY_ATTRIBUTES>(); | ||
| threadSecurityAttributes.nLength = Marshal.SizeOf<BackendNativeMethods.SECURITY_ATTRIBUTES>(); | ||
|
|
||
|
|
@@ -480,8 +479,8 @@ private Process LaunchNode(string msbuildLocation, string commandLineArgs) | |
| if (!NativeMethodsShared.IsMono) | ||
| { | ||
| // Run the child process with the same host as the currently-running process. | ||
| exeName = GetCurrentHost(); | ||
| commandLineArgs = "\"" + msbuildLocation + "\" " + commandLineArgs; | ||
| string dotnetExe = Path.Combine(FileUtilities.GetFolderAbove(exeName, 2), "dotnet.exe"); | ||
|
||
| exeName = File.Exists(dotnetExe) ? dotnetExe : GetCurrentHost(); | ||
|
||
| } | ||
| #endif | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These could be moved into the
elseblock below where its actually used, unless we get rid of the different ways of launching the process in which case this can just go away.