kekyo / FlashCap

Independent video frame capture library on .NET/.NET Core and .NET Framework.
Apache License 2.0
203 stars 29 forks source link

Avalonia aot 启动失败 #136

Open yangjieshao opened 9 months ago

yangjieshao commented 9 months ago

Avalonia 11.0.9 尝试aot 启动失败

(try aot , failed)

    <PropertyGroup>
        <IlcGenerateMapFile>false</IlcGenerateMapFile>
        <PublishAot>true</PublishAot>
        <PublishTrimmed>true</PublishTrimmed>
        <PublishReadyToRun>true</PublishReadyToRun>
        <EnableTrimAnalyzer>true</EnableTrimAnalyzer>
        <EnableSingleFileAnalyzer>true</EnableSingleFileAnalyzer>
        <EnableAotAnalyzer>true</EnableAotAnalyzer>
        <MaxCpuCount Condition="'$(MaxCpuCount)' == ''">0</MaxCpuCount>
    </PropertyGroup>
<Project>
    <ItemGroup>
        <TrimmerRootAssembly Include="FlashCap" />
        <TrimmerRootAssembly Include="FlashCap.Core" />
    </ItemGroup>
</Project>

Log :

COM Interop requires ComWrapper instance registered for marshalling.
System.NotSupportedException
<unknown>
   at System.Runtime.InteropServices.ComWrappers.ComObjectForInterface(IntPtr) + 0x76
   at FlashCap.Internal.NativeMethods_DirectShow.CoCreateInstance(Guid& classId, Object outer, NativeMethods_DirectShow.CLSCTX classContext, Guid& iid, Object& created) + 0xa7
   at FlashCap.Internal.NativeMethods_DirectShow.<EnumerateDeviceMoniker>d__48.MoveNext() + 0x65
   at System.Linq.EnumerableExtension.<Collect>d__0`2.MoveNext() + 0xbf
   at System.Linq.Enumerable.ConcatIterator`1.MoveNext() + 0x5b
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext() + 0x51
   at Jgj.FrontDesk.ViewModels.UsbCameraViewModel..ctor(Int32 defaultDevcieIndex, Int32 defaultVideoResolution, Boolean autoStart) + 0x26a
   at Jgj.FrontDesk.ViewModels.RegisterViewModel..ctor() + 0xc80
   at Jgj.FrontDesk.ViewModels.MainWindowViewModel..ctor() + 0x9d
   at Jgj.FrontDesk.ViewModels.MainWindowViewModel..ctor(CancellationToken cancellationToken) + 0x36
   at Jgj.FrontDesk.App.OnFrameworkInitializationCompleted() + 0xb8
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder, String[], Action`1) + 0x2f
   at Jgj.FrontDesk.Program.Main(String[] args) + 0x547