dotnet run passing ` --additionalprobingpath` to standalone app
Steps to reproduce
dotnet run standalone app
Expected behavior
It get executed only with arguments passed to dotnet run command
Actual behavior
--additionalprobingpath gets passed to standalone app
xiaota-mac:Microsoft.AspNetCore.Server.Kestrel.GeneratedCode asplab$ ~/.dotnet/dotnet -v run
Project Microsoft.AspNetCore.Server.Kestrel.GeneratedCode (.NETStandardApp,Version=v1.5) was previously compiled. Skipping compilation.
Running /Users/asplab/Documents/buildAgent/work/169923259d6dcfec/Universe/KestrelHttpServer/tools/Microsoft.AspNetCore.Server.Kestrel.GeneratedCode/bin/Debug/netstandardapp1.5/osx.10.10x64/Microsoft.AspNetCore.Server.Kestrel.GeneratedCode --additionalprobingpath /Users/asplab/.nuget/packages
Process ID: 82740
Could not resolve SDK directory from [/Users/asplab/Documents/buildAgent/work/169923259d6dcfec/Universe/KestrelHttpServer/tools/Microsoft.AspNetCore.Server.Kestrel.GeneratedCode/bin/Debg/netstandardapp1.5/osx.10.10-x64]
Environment data
dotnet --version output:
~/.dotnet/dotnet --version
1.0.0-beta-002113
/cc @piotrpMSFT @davidfowl
will break any tool that uses dotnet run and arguments
Why would this break?
Wouldn't additionalProbingPath be used for any packages which can't be found app local? Which is all of them in the dev scenario of standalone apps?
cc @schellap @Sridhar-MS
Wouldn't app get additionalProbingPath in args?
Okay I see, so the ordering of additionalProbingPath is the issue here?
I'm not too clear what the bug is here. That additionalProbingPath is passed at all or that it is passed to the app binary rather than stopped at the host?
No, their presence. Lets take Standalone app on windows, which will produce Standalone.exe, corehost in standalone mode should forward app arguments to app itself and now you get additionalProbingPath in public static void Man(string[] args)
After doing a dotnet build, how could dependencies be resolved without --additionalProbingPath?
@schellap @gkhanna79 we talked about this at length yesterday
Via new devruntimecontig.json?
Sure, the plan is to move additionalProbingPath there, but we still need that information available somehow was the point I was making. I understand what you're saying now.
Can we track this bug in the devruntimeconfig.json bug?
now you get additionalProbingPath in public static void Man(string[] args)
This shouldnt happen. The argument is only for the host and not passed to the application.
@gkhanna79 isn't corehost in standalone mode just passing all arguments to manages app without reading/filtering anything?
dotnet run is using the muxer, not corehost. Not sure if that affects your expectations @pakrym
@brthor no, it runs executable directly. https://github.com/dotnet/cli/blob/rel/1.0.0/src/dotnet/commands/dotnet-run/RunCommand.cs#L165
The fact that you are executing an exe directly is not apparent from your example.
I'm somewhat confused actually, what invocation of dotnet run is failing?
dotnet run should be invoking the muxer with --additionalProbingPath. The muxer should be taking data out of --additionalProbingPath and stripping the parameter from the args which get passed along to the app. Like --depsfile, this is an option that is passed to the muxer for its own use and should not get passed along to the app.
@pakrym, is your concern that dotnet.exe is passing along the --additionalprobingpath` to the muxer? Or you're concerned about this due to inspection of the invocation site?
ping
First, it looks like the standalone app.exe is run with --additionalprobingpath and not using the muxer.
/Users/asplab/Documents/buildAgent/work/169923259d6dcfec/Universe/KestrelHttpServer/tools/Microsoft.AspNetCore.Server.Kestrel.GeneratedCode/bin/Debug/netstandardapp1.5/osx.10.10x64/Microsoft.AspNetCore.Server.Kestrel.GeneratedCode --additionalprobingpath /Users/asplab/.nuget/packages
That's expected right? It is standalone...
@gkhanna79 had it clear in his spec that --additionalprobingpath is only for dev scenarios and the muxer will be used to activate the build dll using the dotnet exec keyword.
Why would you expect it to be standalone when it isn't published yet, with its dependencies next to it?
Secondly, how and why did you get the native app.exe if you just did build? Isn't build supposed to just produce the entry.dll and its project dependency dlls?