Open mattleibow opened 3 years ago
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
Tagging subscribers to this area: @vitek-karas, @agocke, @vsadov See info in area-owners.md if you want to be subscribed.
Author: | mattleibow |
---|---|
Assignees: | - |
Labels: | `area-AssemblyLoader-coreclr`, `untriaged` |
Milestone: | - |
The reason why this fails at runtime is that the generated .deps.json
is wrong - it doesn't contain ClassLib.dll
:
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v3.1",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v3.1": {
"WpfApp2/1.0.0": {
"dependencies": {
"ClassLibrary": "1.0.0",
"SharedThings": "1.0.0"
},
"runtime": {
"WpfApp2.dll": {}
}
},
"SharedThings/1.0.0": {
"dependencies": {
"ClassLibrary": "1.0.0" << Reference to non existing target - the .deps.json is effectively invalid
},
"runtime": {
"SharedThings.dll": {}
}
}
}
},
"libraries": {
"WpfApp2/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
},
"SharedThings/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}
I honestly don't know how the SDK is supposed to work in this case (if it should work at all).
In my mind: The solution builds two different instances of ClassLibrary.dll
both of which should make it to the output. I think this should cause a failure since there's no way for the SDK to figure out which one should win.
Description
I just noticed that my "bait and switch" projects are no longer happy in .net core. Not sure when things changed, but it used to work because this is a project format that I have always used with cross-platform apps. And it works with netfx.
I do have a
ClassLibrary.dll
in the bin directory, so it is there to be found. Also, if I switch to a<Reference>
directly to the output dll ofSharedLibrary.Platform
, the app works.And, if I do that, run the app, and then switch back to
<ProjectReference>
without rebuilding (just hit F5), it suddenly starts usingSharedLibrary
instead ofSharedLibrary.Platform
.I have a solution with 4 projects:
Effectively, I have a way to write shared code and a shared app, then swap out the shared implementation with a real implementation.
Configuration
I tried using
3.1.411
,5.0.400
and6.0.100-rc.1.21408.2
Regression?
I think so...
Other information
Sample project: SharedThings.zip