Behavior of ``<Private>false</Private>`` project refs in single-file publish
I have an executable project with the following constraints:
and I would like to publish it as a single file to avoid the clutter of many, many package dependencies. This works fine at first.
However,
I would like not to embed
When the wider solution is built, a copy of
Thus I figured I can rewrite the ProjectReference as:
Doing so removes the embedded
Why is that? How can I inspect the
and I would like to publish it as a single file to avoid the clutter of many, many package dependencies. This works fine at first.
However,
Project1.csproj is a very large library and a shared dependency with every other project in the solution. Embedding it within the single file makes no sense. I would like not to embed
Project1 within the single file (because it is shared with every other project), while embedding all of the PackageReferences (because they are private to this executable).When the wider solution is built, a copy of
Project1.dll (with all of its dependencies) will be placed in the same folder as the single-file binary. So the dependency can be met at runtime.Thus I figured I can rewrite the ProjectReference as:
Doing so removes the embedded
Project1 from the single-file binary. But now, after publishing for Release, Project1.dll 'cannot be found' despite being placed in the same folder as the single-file binary. Why is that? How can I inspect the
.deps.json of the resulting single-file binary? Is there a way to achieve what I want? (private dependencies are packed; shared dependencies are not)