muxer can not be used to run standalone application
In unit test case this doesn't work because muxer can not find coreclr.dll
D:\github\dotnet\cli\artifacts\win10-x64\stage2\dotnet.exe exec C:\Users\pakrym\.nuget\packages\dotnet-test-xunit\1.0.0-dev-91790-12\lib\netstandardapp1.5\dotnet-test-xunit.dll --depsfile D:\github\dotnet\cli\test\dotnet-compile.Tests\bin\Debug\netstandardapp1.5\win7-x64\dotnet-compile.Tests.deps.json --additionalprobingpath C:\Users\pakrym\.nuget\packages D:\github\dotnet\cli\test\dotnet-compile.Tests\bin\Debug\netstandardapp1.5\dotnet-compile.Tests.dll
Trace:
Tracing enabled
--- Invoked host main = {
D:\github\dotnet\cli\artifacts\win10-x64\stage2\dotnet.exe
C:\Users\pakrym\.nuget\packages\dotnet-test-xunit\1.0.0-dev-91790-12\lib\netstandardapp1.5\dotnet-test-xunit.dll
--depsfile
D:\github\dotnet\cli\test\dotnet-compile.Tests\bin\Debug\netstandardapp1.5\win7-x64\dotnet-compile.Tests.deps.json
--additionalprobingpath
C:\Users\pakrym\.nuget\packages
D:\github\dotnet\cli\test\dotnet-compile.Tests\bin\Debug\netstandardapp1.5\dotnet-compile.Tests.dll
}
Resolved fxr [D:\github\dotnet\cli\artifacts\win10-x64\stage2\hostfxr.dll]...
Loaded library from D:\github\dotnet\cli\artifacts\win10-x64\stage2\hostfxr.dll
Tracing enabled
Own DLL path=[D:\github\dotnet\cli\artifacts\win10-x64\stage2\dotnet.dll]
Checking if CoreCLR path exists=[D:\github\dotnet\cli\artifacts\win10-x64\stage2\coreclr.dll]
Host operating in Muxer mode
--- Executing in muxer mode...
Runtime config [] is valid=[1]
Executing as a standlone app as per config file []
Could not load host policy library [C:\Users\pakrym\.nuget\packages\dotnet-test-xunit\1.0.0-dev-91790-12\lib\netstandardapp1.5]
/cc @schellap @piotrpMSFT @anurse @davidfowl
Can you do dotnet exec --depsfile --add foo.dll. The way the host is invoked is the legacy way, not the shared fx supported way. This is exec mode operation.
Is there an ability to pass deps.json in shared fw scenario?
Running same command without exec does not change anything.
@pakrym @schellap
The runtimeconfig is not always guaranteed to be next to the deps json, and making this assumption will actually break project tools currently.
Having separate switches seems like the best route to add this extensibility.
I had a more detailed look at issue and it goes as follows:
I run muxer:
dotnet.exe
.nuget\packages\dotnet-test-xunit\1.0.0-dev-91790-12\lib\netstandardapp1.5\dotnet-test-xunit.dll
--depsfile test\dotnet-compile.Tests\bin\Debug\netstandardapp1.5\win7-x64\dotnet-compile.Tests.deps.json
--additionalprobingpath .nuget\packages
test\dotnet-compile.Tests\bin\Debug\netstandardapp1.5\dotnet-compile.Tests.dll
muxer fails not being able to find coreclr.dll
Tracing enabled
--- Invoked host main = {
D:\github\dotnet\cli\artifacts\win10-x64\stage2\dotnet.exe
C:\Users\pakrym\.nuget\packages\dotnet-test-xunit\1.0.0-dev-91790-12\lib\netstandardapp1.5\dotnet-test-xunit.dll
--depsfile
D:\github\dotnet\cli\test\dotnet-compile.Tests\bin\Debug\netstandardapp1.5\win7-x64\dotnet-compile.Tests.deps.json
--additionalprobingpath
C:\Users\pakrym\.nuget\packages
D:\github\dotnet\cli\test\dotnet-compile.Tests\bin\Debug\netstandardapp1.5\win7-x64\dotnet-compile.Tests.dll
}
Resolved fxr [D:\github\dotnet\cli\artifacts\win10-x64\stage2\hostfxr.dll]...
Loaded library from D:\github\dotnet\cli\artifacts\win10-x64\stage2\hostfxr.dll
Tracing enabled
Own DLL path=[D:\github\dotnet\cli\artifacts\win10-x64\stage2\dotnet.dll]
Checking if CoreCLR path exists=[D:\github\dotnet\cli\artifacts\win10-x64\stage2\coreclr.dll]
Host operating in Muxer mode
--- Executing in muxer mode...
Runtime config [] is valid=[1]
Executing as a standlone app as per config file []
Could not load host policy library [C:\Users\pakrym\.nuget\packages\dotnet-test-xunit\1.0.0-dev-91790-12\lib\netstandardapp1.5]
deps is standalone and has coreclr entry:
"runtime.win7-x64.Microsoft.NETCore.Runtime.CoreCLR/1.0.2-rc2-23924": {
"runtime": {
"runtimes/win7-x64/lib/netstandard1.0/mscorlib.dll": {}
},
"native": {
"runtimes/win7-x64/native/clretwrc.dll": {},
"runtimes/win7-x64/native/coreclr.dll": {},
"runtimes/win7-x64/native/dbgshim.dll": {},
"runtimes/win7-x64/native/mscordaccore.dll": {},
"runtimes/win7-x64/native/mscordbi.dll": {},
"runtimes/win7-x64/native/mscorlib.ni.dll": {},
"runtimes/win7-x64/native/mscorrc.debug.dll": {},
"runtimes/win7-x64/native/mscorrc.dll": {},
"runtimes/win7-x64/native/sos.dll": {}
}
},
Looping in as we need this for some EF x-plat testing.
Side note: would be nice to be able to invoke dotnet-test on published output, but that probably belongs on a different issue.
@brthor, could you please confirm if this is fixed by dotnet/cli#2083?
Full command should be like so:
dotnet.exe exec --depsfile path-to-deps.json --additionalprobingpath probe-path xunit.dll hello.dll
The order is important. Before shared FX we had the below hack that allowed this to work:
dotnet.exe xunit.dll --depsfile path-to-deps.json --additionalprobingpath probe-path hello.dll
I kept this working to help CI from not breaking, so don't use the latter order to specify these params.
Any updates?
Tested this locally with latest bits:
# cd $RepoRoot/TestAssets/TestProjects/PortableTests/StandaloneApp
# ls
StandaloneApp.deps.json
StandaloneApp.dll
StandaloneApp.pdb
StandaloneApp.runtimeconfig.dev.json
StandaloneApp.runtimeconfig.json
# dotnet exec ./StandaloneApp.dll
Could not load host policy library [.]
I did see libhostpolicy.so in the deps.json file.
@brthor How is the above a standalone app when it does not contain libhostfxr and libhostpolicy in it? Also, it appears to be missing ./StandaloneApp.
Who generated this output?
I believe this was the ridless output of build, so this would be an unpublished standalone app.
I didn't specify additionalprobingpath, so let me try that as well.
@brthor any update?
I just tested the scenario in Preview3 and did not find a repro.