CommunityToolkit / Microsoft.Toolkit.Win32

ARCHIVE - This repository contained XAML Islands wrapper controls and tooling for XAML Islands with WinUI 2, see readme for more info about XAML Islands with WinUI 3 and the WindowsAppSDK.
https://aka.ms/windowsappsdk
Other
383 stars 89 forks source link

[Warning] The referenced component '..\uap10.0\Microsoft.Toolkit.Win32.UI.XamlHost.winmd' could not be found #240

Open sbanni opened 4 years ago

sbanni commented 4 years ago
  1. Create a C# WPF Core application and make sure package references are enabled.

  2. Use the NuGet Package Manager window to install package "Microsoft.Toolkit.Wpf.UI.Controls", version is v6.0.0 or later.

  3. Configure the target from "any cpu" to "x64".

  4. Add a UWP project to the same solution, make sure the target version and minimum version are both set to "Win10 version 1903" or later.

  5. Use the NuGet Package Manager window to install package "Microsoft.Toolkit.Win32.UI.XamlApplication", version is v6.0.0 or later.

  6. Replace the content of app.xaml with the following code, make sure to replace MyUWPApp with your UWP project name.

7. Replace the content of app.xaml.cs with the following code, make sure to replace MyUWPApp with your UWP project name. namespace MyUWPApp { sealed partial class App : Microsoft.Toolkit.Win32.UI.XamlHost.XamlApplication { public App() { this.Initialize(); } } } 8. Delete the MainPage.xaml from the UWP project. 9. Build the UWP project. 10. In your wpf project, right click the Dependecies node and add a reference to your UWP project. (you will enter bug 1054800) 11. Closed your solution, and re - open it. 12. Open the MainWindow.xaml under the WPF Core project. 13. Add the control InkCanvas from the toolbox. 14. Expand references node in UWP project The file in the warning does exist on disk: c:\Users\username\.nuget\packages\microsoft.toolkit.win32.ui.xamlapplication\6.0.0\lib\uap10.0>dir Volume in drive C is OSDisk Volume Serial Number is BE31-803E Directory of c:\Users\username\.nuget\packages\microsoft.toolkit.win32.ui.xamlapplication\6.0.0\lib\uap10.0 01/13/2020 05:21 PM . 01/13/2020 05:21 PM .. 11/13/2019 01:53 AM 11,808 Microsoft.Toolkit.Win32.UI.XamlHost.winmd 11/13/2019 01:50 AM 133 Microsoft.Toolkit.Win32.UI.XamlHost.xml 2 File(s) 11,941 bytes 2 Dir(s) 47,696,236,544 bytes free
ghost commented 4 years ago

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

michael-hawker commented 4 years ago

@marb2000

marb2000 commented 4 years ago

@sbanni does this cause build errors or it's just a warning?

rmoergeli commented 4 years ago

Same issue today trying to test https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/host-custom-control-with-xaml-islands

Severity Code Description Project File Line Suppression State Warning The referenced component 'C:\Users\username.nuget\packages\microsoft.toolkit.win32.ui.xamlapplication\6.0.1\build..\lib\uap10.0\Microsoft.Toolkit.Win32.UI.XamlHost.winmd' could not be found. App1

It's a warning, but Publish I get "An error has occured".

10.05.2020 11:38:50 System.AggregateException: One or more errors occurred. ---> System.Exception: Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details. --- End of inner exception stack trace --- ---> (Inner Exception #0) System.Exception: Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details. <---

System.Exception: Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details.

===================

hansmbakker commented 4 years ago

I have the same issue.

marb2000 commented 4 years ago

I repro it today and there is still this warning in the 6.1.1 update:

Severity    Code    Description Project File    Line    Suppression State
Warning     The referenced component 'C:\Users\xxx\.nuget\packages\microsoft.toolkit.win32.ui.xamlapplication\6.1.1\build\..\lib\uap10.0\Microsoft.Toolkit.Win32.UI.XamlHost.winmd' could not be found. UWPApplication  

@ocalvo, can you take a look?

mentorfloat commented 4 years ago

The same warning is still in Version 6.1.2, but I was able to publish with a self-signed cert, targeting x64, without errors.

DuncanStone commented 3 years ago

When I remove this entry from the references list the warning goes away and the program compiles and runs without error. Unfortunately at every restart of visual studio the reference comes back. Is this perhaps a VS issue and not an issue with the toolkit at all?

DuncanStone commented 3 years ago

Any word on this? I am getting sick of having to delete this reference multiple times a day and I don't like to just ignore warnings

michael-hawker commented 3 years ago

@marb2000 @ocalvo any updates?

Samuel12321 commented 3 years ago

@marb2000 @ocalvo any updates, this is still a problem.

LunevNF commented 1 year ago

Same problem, 2023.