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

[Bug] Using Maui Essentials in a non-MAUI app throws an error on launch #1779

Closed
egvijayanand opened this issue Jul 23, 2021 · 11 comments
Closed
Labels
area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@egvijayanand
Copy link
Contributor

Description

Using Maui Essentials in a non-MAUI app throws an error on launch though the build succeeded

Steps to Reproduce

  1. Create a new WPF project (non-MAUI) and set the target framework as net6.0-windows10.0.18362 (Windows 10 1903)
  2. Configure Maui Essentials with <UseMauiEssentials>true</UseMauiEssentials> in the project file
  3. Use the Essentials Connectivity feature in the main window
  4. Build and run the project, displays an error dialog on launch as in below screenshot

Maui-Essentials

Note: NuGet package source is configured with Maui Preview repo (https://aka.ms/maui-preview/index.json)

Expected Behavior

The application is expected to run without any issues.

Actual Behavior

Displays a dialog to download the .NET since Microsoft.Maui.Essentials could not be found.
The .NET 6 Preview 6 SDK itself is installed on the machine.

Basic Information

  • Version with issue: .NET 6 Preview 6
  • Last known good version: .NET 6 Preview 5 (with Microsoft.Maui.Essentials NuGet package reference ver. 6.0.100-preview.5.*)
  • IDE: VS2022 17.0.0 Preview 2.1
  • Platform Target Frameworks:
    • iOS:
    • Android:
    • UWP:
    • WPF: Target Framework net6.0-windows10.0.18362
  • Android Support Library Version:
  • Nuget Packages:
  • Affected Devices:

Screenshots

Reproduction Link

Workaround

@egvijayanand egvijayanand changed the title [Bug] Using Maui Essentials in a non-MAUI app throws an error on launch though the build succeeded [Bug] Using Maui Essentials in a non-MAUI app throws an error on launch Jul 23, 2021
@Daniellled
Copy link

I am also seeing the same type of error when running unit test.

Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Testhost process exited with error: It was not possible to find any compatible framework version
The framework 'Microsoft.Maui.Extensions', version '6.0.100-preview.6.1003+sha.5c159aabf-azdo.4977641' was not found.

  • No frameworks were found.
    You can resolve the problem by installing the specified framework and/or SDK.
    The specified framework can be found at:
  • https://aka.ms/dotnet-core-applaunch?framework=Microsoft.Maui.Extensions&framework_version=6.0.100-preview.6.1003+sha.5c159aabf-azdo.4977641&arch=x64&rid=win10-x64
    . Please check the diagnostic logs for more information.
    at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.ThrowOnTestHostExited(Boolean testHostExited)
    at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, String runSettings)
    at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.DiscoverTests(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler)

Except it is related to the Microsoft.Maui.Extensions dll.

Like you it worked on Preview 5 and now with the new WorkLoad stuff it no longer works. I am able to run MAUI applications fine.

@egvijayanand
Copy link
Contributor Author

Yes, the issue is only with a non-MAUI app in .NET 6 Preview 6. MAUI app works fine.

@egvijayanand
Copy link
Contributor Author

Issue still persists in .NET 6 Preview 7.
Maui-Essentials-1

@Eilon Eilon added the area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info label Sep 16, 2021
@jsuarezruiz jsuarezruiz added the t/bug Something isn't working label Oct 25, 2021
@jsuarezruiz
Copy link
Contributor

There is not an WPF target in Essentials: https://github.com/dotnet/maui/blob/main/src/Essentials/src/Essentials-net6.csproj#L3

We are going to review this scenario.

@egvijayanand
Copy link
Contributor Author

There is not an WPF target in Essentials: https://github.com/dotnet/maui/blob/main/src/Essentials/src/Essentials-net6.csproj#L3

We are going to review this scenario.

Same is the case with a WinForms application too. Kindly include that scenario as well.

@Eilon
Copy link
Member

Eilon commented Feb 11, 2022

@jsuarezruiz / @Redth / @davidortinau - is MAUI Essentials support for WPF something we can postpone to a later release?

@shimingsg
Copy link

verified repro with VS 17.2.0 Preview 2.0 [32302.528.main]

@shimingsg shimingsg added the s/verified Verified / Reproducible Issue ready for Engineering Triage label Mar 3, 2022
@mattleibow
Copy link
Member

This is a duplicate of #4779

@egvijayanand
Copy link
Contributor Author

Hi @mattleibow,

I'm not sure whether you've gone through the issue details or conservation pertaining to that.

@jsuarezruiz / @Redth / @davidortinau - is MAUI Essentials support for WPF something we can postpone to a later release?

But it's definitely not a duplicate of #4779, that is about referencing the Maui Essentials in a Razor Class Library (RCL) whereas this is about an issue that occurs during the launch of the application that uses Maui Essentials in other Windows Client applications like WinForms / WPF.

The issue is still simulating with the attached project, hence kindly reopen this issue.

MyApp.zip

Regards,
Vijay Anand E G

@egvijayanand
Copy link
Contributor Author

image

This is the error that is still showing on launching the application.

@Redth
Copy link
Member

Redth commented Mar 24, 2022

Essentials is not currently supported and there are no plans at this time to add support in WPF

@ghost ghost locked as resolved and limited conversation to collaborators Apr 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants