Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible with VS 2022 17.11.5 #1633

Closed
myuki opened this issue Oct 9, 2024 · 8 comments
Closed

Incompatible with VS 2022 17.11.5 #1633

myuki opened this issue Oct 9, 2024 · 8 comments
Labels
bug Something isn't working requires external features We can not fix this for now, we need a feature that is out of this library.

Comments

@myuki
Copy link

myuki commented Oct 9, 2024

Describe the bug
Code that run properly in VS 17.11.4 will not run with VS 17.11.5. After click Debugging, the app will instantly crash.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new project with Template Studio
  2. Use the default setting in template.
  3. Add following code in App1/Views/MainPage.xaml
<Page
    x:Class="App1.Views.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:lvc="using:LiveChartsCore.SkiaSharpView.WinUI"
    mc:Ignorable="d">

  <Grid x:Name="ContentArea">
    <lvc:CartesianChart x:Uid="Chart"/>
  </Grid>
</Page>

  1. Run debugging on VS 17.11.5

Expected behavior
Program run properly.

Desktop (please complete the following information):

  • OS: Windows 11 26100.2033
  • Version: 2.0.0-rc3.3

Additional context
I am not sure which part (LiveCharts2 or VS) cause the problem, since update VS change a lot of components. But I want to leave this issue, it may help someone with the same problem.

@beto-rodriguez
Copy link
Owner

Hi

This is most likely related with #1580

Can you please confirm that the new template uses WindowsAppSDK 1.6? if so, then this is already fixed, for more info see the link avobe.

@kbeatty-ascensionas
Copy link

Also seeing this. I have encountered the issue with WindowsAppSDK 1.6 previously but it worked fine if I targeted 1.4. After the upgrade this no longer works.

@beto-rodriguez
Copy link
Owner

I will close this for now as duplicate of #1580

@myuki
Copy link
Author

myuki commented Oct 10, 2024

Hi

This is most likely related with #1580

Can you please confirm that the new template uses WindowsAppSDK 1.6? if so, then this is already fixed, for more info see the link avobe.

No, the template is using WindowsAppSDK 1.4 (same as before). The following are packages using in the template.

<ItemGroup>
  <PackageReference Include="CommunityToolkit.Mvvm" Version="8.1.0" />
  <PackageReference Include="LiveChartsCore.SkiaSharpView.WinUI" Version="2.0.0-rc3.3" />
  <PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
  <PackageReference Include="Microsoft.WindowsAppSDK" Version="1.4.231008000" />
  <PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="2.0.9" />
  <PackageReference Include="WinUIEx" Version="2.3.2" />
</ItemGroup>

But it still seems related to #1580. It may relate to .NET SDK v8.0.402/v8.0.403, since WindowsAppSDK 1.6 require .NET SDK >= v8.0.402. VS 17.11.5 update .NET SDK from v8.0.400 to v8.0.403

@beto-rodriguez
Copy link
Owner

beto-rodriguez commented Oct 10, 2024

Okay, even this issue is related to #1580, I'll re open this, here is a workaround, in case it is useful for someone else:

mono/SkiaSharp#2999 (comment)

@beto-rodriguez beto-rodriguez added requires external features We can not fix this for now, we need a feature that is out of this library. bug Something isn't working labels Oct 11, 2024
@NicolasLiaoRan
Copy link

I also met this issue in vs2022 17.11.5
One nice workaround is rollback vs2022 to 17.11.3 and all components works fine

@beto-rodriguez
Copy link
Owner

This is now working using the latest version 2.0.0-rc4, I will close this for now, feel free to reply if something is not working.

@kbeatty-ascensionas
Copy link

The fix seems to work fine when I build and run from within Visual Studio but when I build a package for sideloading I get a similar error as before. From the Windows 10 Pro 22H2 machine event viewer where the app was deployed:

CoreCLR Version: 8.0.1024.46610
.NET Version: 8.0.10
Description: The process was terminated due to an unhandled exception.
Exception Info: System.MissingMethodException: Method not found: 'System.Guid ByRef ABI.Microsoft.UI.Xaml.IUIElementOverridesMethods.get_IID()'.
at WinRT.xxxGenericHelpers.GlobalVtableLookup.LookupVtableEntries(Type type)
at WinRT.ComWrappersSupport.GetComInterfaceEntriesForTypeFromLookupTable(Type type)
at WinRT.ComWrappersSupport.GetInterfaceTableEntries(Type type)
at WinRT.DefaultComWrappers.<>c.b__7_0(Type type)
at System.Runtime.CompilerServices.ConditionalWeakTable2.GetValueLocked(TKey key, CreateValueCallback createValueCallback) at System.Runtime.CompilerServices.ConditionalWeakTable2.GetValue(TKey key, CreateValueCallback createValueCallback)
at WinRT.DefaultComWrappers.ComputeVtables(Object obj, CreateComInterfaceFlags flags, Int32& count)
at System.Runtime.InteropServices.ComWrappers.TryGetOrCreateComInterfaceForObjectInternal(ObjectHandleOnStack comWrappersImpl, Int64 wrapperId, ObjectHandleOnStack instance, CreateComInterfaceFlags flags, IntPtr& retValue)
at System.Runtime.InteropServices.ComWrappers.TryGetOrCreateComInterfaceForObjectInternal(ComWrappers impl, Object instance, CreateComInterfaceFlags flags, IntPtr& retValue)
at System.Runtime.InteropServices.ComWrappers.GetOrCreateComInterfaceForObject(Object instance, CreateComInterfaceFlags flags)
at WinRT.ComWrappersSupport.CreateCCWForObjectForABI(Object obj, Guid iid)
at WinRT.ComWrappersSupport.CreateCCWForObjectForMarshaling(Object obj, Guid iid)
at WinRT.MarshalDelegate.CreateMarshaler2(Object o, Guid delegateIID, Boolean unwrapObject)
at ABI.Microsoft.UI.Xaml.ApplicationInitializationCallback.CreateMarshaler2(ApplicationInitializationCallback managedDelegate)
at ABI.Microsoft.UI.Xaml.IApplicationStaticsMethods.Start(IObjectReference _obj, ApplicationInitializationCallback callback)
at Microsoft.UI.Xaml.Application.Start(ApplicationInitializationCallback callback)
at xxx.Program.Main(String[] args)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working requires external features We can not fix this for now, we need a feature that is out of this library.
Projects
None yet
Development

No branches or pull requests

4 participants