Open vitek-karas opened 5 years ago
@peterhuene this is around the same area that you are looking at. Could you take a look/comment?
I think a warning with SelfContained
set for a lib project would make sense. I have concerns over project references, though. Right now the global SelfContained
property is propagating to project references, which would cause a warning from every referenced lib project from an exe project that one would want to publish in a self-contained manner.
There's other issues to address in this area, so I think it might be worth doing.
Please also consider currently broken behavior:
dotnet new classlib -f netcoreapp2.1
dotnet publish --self-contained -r win-x64
Will actually produce what looks like a self-contained app (with the copy of the runtime and so on).
It will also include apphost.exe
(always with that name), which fails to launch with a rather weird error message. (SDK copied over the original prebuilt apphost.exe
but didn't customize it in any way).
Repro (.NET SDK 2.1.500):
The
--self-contained
parameter does nothing for a publish on a classlib. This issue is not about the fact that SDK doesn't support self-contained class libs. This is about the fact that asking for self-contained doesn't fail. SDK will simply ignore the parameter.It's probably not OK to start failing, but maybe issuing a warning about usage of a parameter which will not have any effect should be possible.