-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 a property with path of host of msbuild #1669
Comments
?? I'm not sure what I've changed my mind "from" or "to". 😉 It would seem to me, for this specific issue, to give F# the same level of specialty as we do for C#. We are already bundling the F# SDK into the CLI. It would make sense to add the same functionality for F# as we do for C#: https://github.com/dotnet/cli/blob/rel/1.0.0/src/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs#L29 @piotrpMSFT @livarcocc - how do you guys imagine F# compiler should work when running in the CLI? Either that, or we need to generalize this so C# doesn't need to be special cased in the CLI. |
fix dotnet#65 but ref dotnet/msbuild#1669 to resolve correct dotnet host
Also, as i said before, it's not a problem specific to fsc (that's just an example), it's for normal targets who want to run dotnet from msbuild (build orchestration, scripts, etc). QUESTION: If i want to run a
So ihmo is not about sdk, cli at all. It's about msbuild. before there was only one host, now there are more, so i need to know with one.
I add my 5c. My working solution for f# (work is done, i'll send a pr really soon to update templates) is to:
Working example in this package, but is not final name, after feedback/todo from dotnet/fsharp#2250 It works really well, minimal package size (FDD) and xplat. no special invoker ( Please do not embeed f# it in CLI, no special cases. is not needed. Current packaing for f# is better than c# one ihmo:
|
@rainersigwald so no possibility to have it in .net core sdk 1.0 right? |
No, sorry.
|
FWIW I agree we need something like this as well. There are various things we need to be able to run on the same host as msbuild so it runs in the same context as msbuild. |
Team triage: We've made it this long without this, so we don't plan to do it. Hosts are changing quite a bit with apphosts now, too. |
Add a property with full path of host of msbuild
I can currently run msbuild with
msbuild.exe
(net40)dotnet msbuild.dll
(netcore)mono msbuild.exe
(too i think, for net40)It's useful in target file to know who is invoking msbuild, because maybe i need to run some commands in my target files, and i want to use same host.
For example i want to run a clitool or another command in a target file
But that will run dotnet in
PATH
(global.json cannot always be used, because i can overriden in PATH, like in CI server)that will run
mytool
with v1 dotnet, and i dont know how to be sure is executed with v2 dotnetSame for mono.
If a
$(DotnetHost)
exists, it's possibile to do$(DotnetHost) mycmd.dll
or$(DotnetHost) mycmd.exe
(netcore vs net40) and that will runmycmd.exe
on win, because $(DotnetHost) is ''/path/to/dotnet.exe mycmd.dll
on .net core win/path/to/dotnet mycmd.dll
on .net core unix/mac/path/to/mono mycmd.exe
on monoI think that property should be added from msbuild, not sdk, because i can use msbuild without sdk (for simple script automation)
that also resolve workaround like (from
dotnet run
target file in dotnet/sdk )There is
$(MSBuildSDKsPath)
but is a subdirectory inside sdk, and i dont know if i can be sure layout will be always the same, to use relative path. And anyway doesnt fix mono or msbuild.exerelated to #720 too i think, roslyn csc workaround embeddeing a .cmd/.sh inside sdk (who resolve dotnet using relative path), but that cannot be done by others.
Atm in f# (i need to run
dotnet fsc.dll
, with full path), i am usingMSBuildExtensionsPath
but i know is not future proof/hackThe text was updated successfully, but these errors were encountered: