Closed mayankkrjain closed 4 years ago
Hello mayankkrjain, thank you for opening an issue with us!
I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌
I think the issue is not just related to AttachedProperties. It affects all the use-cases where we are defining just a class (either based on DepenendencyObjct or on XamlCompositionBrushBase) and using it in XAML. I feel I am missing an extra step here that needs to be done to make the WAP project aware of such definitions.
FYI @marb2000 @ocalvo, any thoughts here?
FYI @marb2000 @ocalvo, any thoughts here?
This may have been fixed by in 6.1.1
@mayankkrjain, could you upgrade to version 6.1.1 and see if the issue still repro?
@mayankkrjain, could you upgrade to version 6.1.1 and see if the issue still repro?
I did that here. Unfortunately, I am still seeing the crash.
@ocalvo I tested it and this is still failing. Any idea why?
@ocalvo I tested it and this is still failing. Any idea why?
Yes, this is an issue with .Net 3. The fix is expected in version 3.1.7 schedule to release this month.
Waiting for the update of .NET Core 3.1.7.
I have verified that this issue is now fixed in the release version of .NET Core 3.1.7.
@ocalvo - I installed the release version. I am still seeing a crash in Xaml-Islands Sample
Below is the output for dotnet --info
.NET Core SDK (reflecting any global.json): Version: 3.1.401 Commit: 39d17847db
Runtime Environment: OS Name: Windows OS Version: 10.0.19041 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\3.1.401\
Host (useful for support): Version: 3.1.7 Commit: fcfdef8d6b
Am I missing something here?
Crash log -
Exception thrown at 0x00007FFB87103E49 (KernelBase.dll) in WinForms_XAMLIslands_v1.exe: WinRT originate error - 0x80131534 : 'System.TypeInitializationException: The type initializer for 'UILibrary.Controls.AttachedProperties' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified. at UILibrary.Controls.AttachedProperties..cctor() --- End of inner exception stack trace --- at System.Runtime.CompilerServices.RuntimeHelpers._Ru'. onecore\com\combase\winrt\error\restrictederror.cpp(1016)\combase.dll!00007FFB8879E5C3: (caller: 00007FFB887A2A91) ReturnHr(1) tid(3364) 8007007E The specified module could not be found. 'WinForms_XAMLIslands_v1.exe' (Win32): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.7\System.Resources.ResourceManager.dll'. 'WinForms_XAMLIslands_v1.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.7\System.Resources.ResourceManager.dll'. Exception thrown: 'Windows.UI.Xaml.Markup.XamlParseException' in MyClassLibrary.dll Exception thrown: 'System.Reflection.TargetInvocationException' in System.Private.CoreLib.dll An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in System.Private.CoreLib.dll
This specific error was fixed in version 6.1.2 of the win32 toolkit. What version are you using?
This issue seems to be fixed in the sample that I had created and shared above.
However, I am still seeing a crash in another project of mine. I will try to create a similar shareable sample and post the update here. Trying to get the exact crash logs. This crash could be new or the same. BUt controls without attached props are working fine.
@ocalvo @marb2000 -I am closing this issue now as this one is definitely fixed. I am still facing a different issue. Once I am able to figure out the exact cause, will reach out to you again via a different ticket.
Describe the bug
I have a C# UI library which is a Windows Runtime Component. It has some CustomControls. I have defined a few attached properties which are being used across these controls. I am using this UI library in a separate C# class-library which is then being used in a Winforms Application. I have also created a packaging project for the same.
When I launch the packaging project in VS, I observe the below-mentioned exception in the output window. Sometimes it may work for couple of launches even with the exception logs. After that, it stops launching and simply crashes and never works which is very weird. The crash happens only If I define an attached property on it. Without it, the control works fine.
This works fine if I simply launch the Winforms application from VS instead of using the WAP. This also works fine if the same setup is consumed via a UWP application instead of a Winforms app. What am I missing here? Is there an issue with the way I have defined the properties? Or do I need to do something extra with the WAP?
I have modified the Winforms XAML-Island sample with my use-case. It reproduces the issue. It can take a couple of launches. You can see the commit here.
Steps to Reproduce
Steps to reproduce the behavior:
Expected behavior
The exception should not occur
Crash Log
Environment
Additional context
I am also seeing the following compilation failures frequently. I have to rebuild to fix this issue.
.nuget\packages\microsoft.net.uwpcoreruntimesdk\2.2.9\tools\CoreRuntime\Microsoft.Net.CoreRuntime.targets(238,5): error : CopyWin32Resources failed with exit code 500