-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Closed
Labels
area-Hostin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
Milestone
Description
The .deps.json
can specify relative path for any asset. The directory portion of that path is ignored for normal assemblies which are part of the app though.
Repro:
dotnet new console
dotnet add package Newtonsoft.Json
dotnet build
Now in the bin/Debug/netcoreapp3.0
create a sub
directory and move the Newtonsoft.Json.dll
into it.
Edit the app.deps.json
to point to sub/Newtonsoft.Json.dll
like this:
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v3.0",
"signature": "6596ed3d155c0211dab1fd90ba9d71b725c973ba"
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v3.0": {
"Newtonsoft.Json/12.0.1": {
"runtime": {
"sub/Newtonsoft.Json.dll": {
}
Run the app via dotnet app.dll
.
Expected:
The host should be able to find the Newtonsoft.Json.dll
since it exists in the right relative path.
Actual:
The host fails to find the file, and it fails with error like this:
Error:
An assembly specified in the application dependencies manifest (app.deps.json) was not found:
package: 'Newtonsoft.Json', version: '12.0.1'
path: 'sub/Newtonsoft.Json.dll'
Which is very misleading, as the path contains the subdirectory, but the host doesn't use it to look up the file. This can be observed in the trace:
Processing TPA for deps entry [Newtonsoft.Json, 12.0.1, sub/Newtonsoft.Json.dll]
Considering entry [Newtonsoft.Json/12.0.1/sub/Newtonsoft.Json.dll], probe dir [], probe fx level:0, entry fx level:0
Local path query did not exist F:\AppModel\repro\DepsJsonRelative\bin\Debug\netcoreapp3.0\Newtonsoft.Json.dll
JeremyCaney, cgytrus, jonmat, harryneufeld, hastarin and 2 more
Metadata
Metadata
Assignees
Labels
area-Hostin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
Type
Projects
Status
No status