Skip to content

Commit

Permalink
NativeAOT does not support TypeIdentifier apparently
Browse files Browse the repository at this point in the history
and until resolution for dotnet/runtime#79941 happens, I cannot do anything except supporting only latest WebView2
  • Loading branch information
kant2002 committed Dec 23, 2022
1 parent a3cac73 commit 3d7ac9e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
5 changes: 3 additions & 2 deletions WinFormsComInterop/WebView2/ICoreWebView2Wrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
namespace WinFormsComInterop.WebView2;

[RuntimeCallableWrapper(typeof(webview2::Microsoft.Web.WebView2.Core.Raw.ICoreWebView2))]
[RuntimeCallableWrapper(typeof(Microsoft.Web.WebView2.Core.Raw.ICoreWebView2Private))]
[RuntimeCallableWrapper(typeof(Microsoft.Web.WebView2.Core.Raw.ICoreWebView2PrivatePartial))]
//[RuntimeCallableWrapper(typeof(Microsoft.Web.WebView2.Core.Raw.ICoreWebView2Private))]
//[RuntimeCallableWrapper(typeof(Microsoft.Web.WebView2.Core.Raw.ICoreWebView2PrivatePartial))]
[RuntimeCallableWrapper(typeof(webview2::Microsoft.Web.WebView2.Core.Raw.ICoreWebView2PrivatePartial))]
internal partial class ICoreWebView2Wrapper
{
public readonly IntPtr instance;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

namespace Microsoft.Web.WebView2.Core.Raw;

[ComImport]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("2C94DD56-E252-40A1-BA7E-B19417B26A60")]
public interface ICoreWebView2PrivatePartial
{
[MethodImpl(MethodImplOptions.InternalCall)]
void AddHostObjectHelper([In][MarshalAs(UnmanagedType.Interface)] ICoreWebView2PrivateHostObjectHelper helper);
}
5 changes: 4 additions & 1 deletion samples/BlazorHybrid/BlazorHybrid.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
<ImplicitUsings>enable</ImplicitUsings>

<PublishAot>true</PublishAot>
<!--<PublishReadyToRun>true</PublishReadyToRun>
<PublishTrimmed>true</PublishTrimmed>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>-->
<_SuppressWinFormsTrimError>true</_SuppressWinFormsTrimError>
<CustomResourceTypesSupport>true</CustomResourceTypesSupport>
<MetadataUpdaterSupport>false</MetadataUpdaterSupport>
</PropertyGroup>

Expand All @@ -20,6 +22,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.WindowsForms" Version="7.0.52" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.1462.37" />
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="8.0.0-*" Condition="'$(UseNet8)' == 'True'" />
</ItemGroup>

Expand Down

0 comments on commit 3d7ac9e

Please sign in to comment.