Skip to content

Commit c72b366

Browse files
FrayxRulezclaude
andcommitted
Give the modern build libvlc's plugins
UnigramUsesVcpkg is matched on project name, and Telegram.Modern was not in the list, so neither the vcpkg runtime DLLs nor UnigramAddVlcPlugins applied to it. libvlc.dll was there and its plugins were not, which is a native death with no managed error report to show for it - the crash Fela hit on video. Adding the project to that list is the whole fix; the plugin tree then arrives through the same target Telegram.csproj uses, keeping the plugins\<category>\ shape that plugins.dat records. It also means vcpkg supplies the shared runtime, which collided with the sixteen ffmpeg and libvlc DLLs copied out of x64\Release\Telegram.Native (NETSDK1152). Only Telegram.Native.dll, Telegram.Native.Calls.dll and their .pri files come from there now - the arrangement Telegram.csproj already had. Telegram.Td.dll goes with them: the shipping package does not carry it either. Published, registered and launched: the app starts and stays up. Whether video plays is Fela's to say. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 53efd5c commit c72b366

3 files changed

Lines changed: 18 additions & 8 deletions

File tree

‎Directory.Build.props‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
<PropertyGroup>
44
<UnigramRoot>$(MSBuildThisFileDirectory)</UnigramRoot>
5-
<!-- Only these three consume vcpkg: the two native components link against it, and the app
6-
needs the runtime DLLs in its output and its package. -->
7-
<UnigramUsesVcpkg Condition="'$(MSBuildProjectName)' == 'Telegram.Native' Or '$(MSBuildProjectName)' == 'Telegram.Native.Calls' Or '$(MSBuildProjectName)' == 'Telegram'">true</UnigramUsesVcpkg>
5+
<!-- Only these consume vcpkg: the two native components link against it, and the app needs
6+
the runtime DLLs in its output and its package - both builds of it, since Telegram.Modern
7+
packages the same dependencies. Without it there libvlc loads and then dies, its plugins
8+
never having been copied. -->
9+
<UnigramUsesVcpkg Condition="'$(MSBuildProjectName)' == 'Telegram.Native' Or '$(MSBuildProjectName)' == 'Telegram.Native.Calls' Or '$(MSBuildProjectName)' == 'Telegram' Or '$(MSBuildProjectName)' == 'Telegram.Modern'">true</UnigramUsesVcpkg>
810
</PropertyGroup>
911

1012
<!-- Where vcpkg lives, in order of preference: an explicit override, the VCPKG_ROOT variable,

‎Telegram/Telegram.Modern.csproj‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,11 @@
215215
Telegram.Native has to have been built by the solution first. Calls only adds its own two
216216
files; the rest of its folder is the same ffmpeg set. -->
217217
<ItemGroup>
218-
<!-- zlib1 and Win2D also arrive with tdjson and from the Win2D package respectively. The
219-
legacy build copies both copies over each other and lets the last one win; publish here
220-
calls that NETSDK1152, so the native folder's are the ones dropped. -->
221-
<ReferenceCopyLocalPaths Include="..\$(Platform)\$(Configuration)\Telegram.Native\*.dll"
222-
Exclude="..\$(Platform)\$(Configuration)\Telegram.Native\zlib1.dll;..\$(Platform)\$(Configuration)\Telegram.Native\Microsoft.Graphics.Canvas.dll" />
218+
<!-- Only the components themselves. Their folders also hold the whole ffmpeg/libvlc set, but
219+
those come from vcpkg through Directory.Build.targets, as they do for Telegram.csproj -
220+
copying both is NETSDK1152, sixteen files deep. Same for Win2D, which comes from its
221+
package, and Telegram.Td.dll, which the shipping package does not carry at all. -->
222+
<ReferenceCopyLocalPaths Include="..\$(Platform)\$(Configuration)\Telegram.Native\Telegram.Native.dll" />
223223
<ReferenceCopyLocalPaths Include="..\$(Platform)\$(Configuration)\Telegram.Native\Telegram.Native.pri" />
224224
<ReferenceCopyLocalPaths Include="..\$(Platform)\$(Configuration)\Telegram.Native.Calls\Telegram.Native.Calls.dll" />
225225
<ReferenceCopyLocalPaths Include="..\$(Platform)\$(Configuration)\Telegram.Native.Calls\Telegram.Native.Calls.pri" />

‎net10-port-todo.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,14 @@ Two more things the packaging path needed:
287287
build copies both over each other, publish calls it `NETSDK1152`.
288288
- **The downloaded tdjson binaries carry the mark of the web**, which the PRI step refuses
289289
(`MSB3821`). `Unblock-File` on `Libraries\tdjson\x64\tdjson.dll` and `.pdb` clears it.
290+
- **`UnigramUsesVcpkg` matches on project name**, so `Telegram.Modern` was invisible to it and got
291+
neither the vcpkg runtime DLLs nor libvlc's plugin tree — video died natively, with no managed
292+
error report to show for it, because libvlc loads and then finds no plugins. The project is now
293+
in that list in `Directory.Build.props`, which also means the plugins keep their
294+
`plugins\<category>\<name>.dll` shape, as `plugins.dat` records those paths.
295+
Consequence: the vcpkg runtime DLLs then collide with the same sixteen ffmpeg/libvlc files if
296+
they are also copied out of `x64\Release\Telegram.Native\`. Only the components themselves come
297+
from there now; the shared set comes from vcpkg, exactly as for `Telegram.csproj`.
290298
- **`Content` needs `CopyToOutputDirectory`.** The legacy UWP project system deployed `Content`
291299
implicitly; SDK-style does not, and nothing says so at build time. The app started, initialised
292300
TDLib, wrote its databases — and then died on

0 commit comments

Comments
 (0)