CommunityToolkit / Graph-Controls

Set of Helpers and Controls for Windows development using the Microsoft Graph.
https://docs.microsoft.com/en-us/windows/communitytoolkit/graph/overview
Other
155 stars 39 forks source link

Crash in Release Mode #145

Closed OneFingerCodingWarrior closed 3 years ago

OneFingerCodingWarrior commented 3 years ago

Describe the bug

1、CommunityToolkit.Graph.UWP has the reference of Microsoft.Toolkit.Uwp.UI.Controls.Input (>= 7.0.2) 2、which caused exception in release mode System.MissingMethodException: 'Method 'XamlMetaDataProvider..ctor()' from assembly 'Microsoft.Toolkit.Uwp.UI.Controls.Input' was not included in compilation, but was referenced in XamlTypeInfoProvider.OtherProviders.get(). There may have been a missing assembly, or a dependency on a more recent Windows SDK release.'

Steps to Reproduce

Steps to reproduce the behavior:

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

NuGet Package(s): 

Package Version(s): 

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [ ] Insider Build (xxxxx)

Device form factor:
- [ ] Desktop
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [ ] 2019 (version: ) 
- [ ] 2019 Preview (version: )

Additional context

Add any other context about the problem here.

ghost commented 3 years ago

Hello OneFingerCodingWarrior, 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 🙌

shweaver-MSFT commented 3 years ago

@OneFingerCodingWarrior what version of the CommunityToolkit.Graph.Uwp package are you using?

I'm able to do a release build of the SampleTest app included in the solution without error. However, I did just make some notable changes to the solutions target and props files earlier today, which might resolve your issue.

There should be new nuget packages available in the preview feed. Try out the latest and let me know if you are still hitting this issue: https://github.com/CommunityToolkit/WindowsCommunityToolkit/wiki/Preview-Packages

OneFingerCodingWarrior commented 3 years ago

i create a new project, and using the latest preview build image i will try today's preview build

OneFingerCodingWarrior commented 3 years ago

looks like there is no new preview today image

OneFingerCodingWarrior commented 3 years ago

1、I download the latest main branch source code 2、UwpMsalProviderSample works fine in Release mode 3、I add the Microsoft.Toolkit.Uwp.UI.Contro(7.1.0-preview1) to the project. And add DropShadowPanel to the MainPage.xaml during the compilation, i got the following warnings 1>E:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\2.2.9-rel-29512-01\tools\Microsoft.NetNative.targets(805,5): warning : ILTransform : warning ILT0005: Type 'Microsoft.Toolkit.Uwp.UI.Controls.Input.Microsoft_Toolkit_Uwp_UI_Controls_Input_XamlTypeInfo.XamlMetaDataProvider' from assembly 'Microsoft.Toolkit.Uwp.UI.Controls.Input' was not included in compilation, but was referenced in method 'XamlTypeInfoProvider.OtherProviders.get()'. There may have been a missing assembly, or a dependency on a more recent Windows SDK release. 1>E:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\2.2.9-rel-29512-01\tools\Microsoft.NetNative.targets(805,5): warning : ILTransform : warning ILT0003: Method 'XamlTypeInfoProvider.OtherProviders.get()' will always throw an exception due to the missing method 'XamlMetaDataProvider..ctor()' in assembly 'Microsoft.Toolkit.Uwp.UI.Controls.Input'. There may have been a missing assembly, or a dependency on a more recent Windows SDK release. 4、UwpMsalProviderSample crash in Release mode

OneFingerCodingWarrior commented 3 years ago

after updating CommunityToolkit.Graph.UWP 's dependence Microsoft.Toolkit.Uwp.UI.Controls.Input from 7.0.2 to 7.1.0-preview1 app back to normal in Release mode

shweaver-MSFT commented 3 years ago

Hey @OneFingerCodingWarrior sorry for the run around, I should have been more specific. Using the MainLatest feed from WindowsCommunityToolkit, try installing the 7.1.0-build.43. That is the most recent build, which includes the build changes I mentioned.

But you are so right, I tested with the 7.1.0-preview1 nuget package and I see the same errors as you. Sorry that you ran into this.

Feed URL: https://pkgs.dev.azure.com/dotnet/CommunityToolkit/_packaging/CommunityToolkit-MainLatest/nuget/v3/index.json

image

image

OneFingerCodingWarrior commented 3 years ago

I am glad to help fixing the bug before the release ☺