sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Failed to initialize CoreCLR when depsfile path is relative

Open natemcmaster opened this issue 10 years ago • 6 comments

Steps to reproduce

dotnet exec --depsfile $relativePath ....

I hit this execution path in Visual Studio where build-base-path is set to a relative folder ..\..\artifacts and trying to execute the command spec created with ProjectDependenciesCommandFactory.

Specifying an absolute path for the buildBasePath constructor argument on this factory (which in turn changes the depsfile path) fixes the error.

Expected behavior

Find and load execute depspath relative to current working directory.

Actual behavior

Failed to initialize CoreCLR, HRESULT: 0x80070057

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-rc2-002485)

Product Information:
 Version:     1.0.0-rc2-002485
 Commit Sha:  d3c65aee87

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.10586
 OS Platform: Windows
 RID:         win10-x64

natemcmaster avatar Apr 25 '16 20:04 natemcmaster

going to begin investigating this,

@natemcmaster is it possible for you to share the full dotnet exec command line which is invoked but fails?

brthor avatar Apr 26 '16 00:04 brthor

@brthor here is a repro: https://github.com/natemcmaster/dotnet-sample-tool/tree/issue/2682 Run build.ps1 on the project. Here is my output:

Running C:\Users\namc\dev\dotnet-sample-tool\.dotnet\dotnet.exe exec --depsfile C:\Users\namc\.nuget\packages\.tools\dotnet-my-tool\1.0.0-tmp1461606720.19358\netcoreapp1.0\dotnet-my-tool.deps.json --additionalprobingpath C:\Users\namc\.nuget\packages C:\Users\namc\.nuget\packages\dotnet-my-tool\1.0.0-tmp1461606720.19358\lib\netcoreapp1.0\dotnet-my-tool.dll --build-base-path ..\artifacts\
Process ID: 41820
Called as a tool. Dispatching to dependency command inside project.
Running C:\Users\namc\dev\dotnet-sample-tool\.dotnet\dotnet.exe exec --runtimeconfig ..\artifacts\SamplePortableApp\bin\Debug\netcoreapp1.0\SamplePortableApp.runtimeconfig.json --depsfile ..\artifacts\SamplePortableApp\bin\Debug\netcoreapp1.0\SamplePortableApp.deps.json --additionalprobingpath C:\Users\namc\.nuget\packages C:\Users\namc\.nuget\packages\dotnet-my-tool\1.0.0-tmp1461606720.19358\lib\netcoreapp1.0\dotnet-my-tool.dll --dispatch --verbose
Process ID: 18536
Failed to initialize CoreCLR, HRESULT: 0x80070057

natemcmaster avatar Apr 26 '16 00:04 natemcmaster

thanks @natemcmaster !

brthor avatar Apr 26 '16 01:04 brthor

Yo @brthor my referenced PR above fixes it in the host. Do you want to fix it by not passing relative paths?

schellap avatar Apr 28 '16 00:04 schellap

Is this fixed @schellap ?

thesmithee avatar Jan 19 '17 18:01 thesmithee

The host fix is in, so closing.

TheRealPiotrP avatar Jan 20 '17 07:01 TheRealPiotrP