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] Debug for Windows App Fails Deployment: Need recipe file #2493

Closed
MichaelPeter opened this issue Sep 15, 2021 · 16 comments
Closed

[Bug] Debug for Windows App Fails Deployment: Need recipe file #2493

MichaelPeter opened this issue Sep 15, 2021 · 16 comments
Labels
area-setup Installation, setup, requirements, maui-check, workloads, platform support area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint s/needs-info Issue needs more info from the author t/bug Something isn't working

Comments

@MichaelPeter
Copy link

MichaelPeter commented Sep 15, 2021

Description

Steps to Reproduce

  1. Install the MSI Packaging Tools (https://marketplace.visualstudio.com/items?itemName=ProjectReunion.MicrosoftSingleProjectMSIXPackagingToolsDev17)
  2. Create a new MAUI Project
  3. Goto the configuration manager and activate Deploy since it is not activated by default

grafik

  1. Inline the Windows project type in the .csproj
  2. Switch start configuration to Windows Maschine

I also tried to install Project Reunion but did not fix the problem.

Expected Behavior

The Windows App Starts

Actual Behavior

A Error appears that Deployment Failed and the output only says Need recipe file

grafik

Basic Information

  • Version with issue:
  • Last known good version:
  • IDE: VS 2022 Preview 4
  • Platform Target Frameworks:
  • Windows Maschine
  • Affected Devices: Windows 10 PC
@doggyde
Copy link

doggyde commented Sep 15, 2021

Same issue here - tried everything, nothing worked so far

@MartyIX
Copy link
Contributor

MartyIX commented Sep 15, 2021

I experience the same issue. Also I can see this in error log:

image

@markrendle
Copy link

markrendle commented Sep 15, 2021

Oddly, if you comment out both the TargetFrameworks elements from the template and add a single TargetFramework element for Windows the Deploy works correctly and you can debug happily.

<PropertyGroup>
    <TargetFramework>net6.0-windows10.0.19041</TargetFramework>
    <!-- <TargetFrameworks>net6.0-ios;net6.0-android;net6.0-maccatalyst</TargetFrameworks> -->
    <!-- <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows')) and '$(MSBuildRuntimeType)' == 'Full'">$(TargetFrameworks);net6.0-windows10.0.19041</TargetFrameworks> -->
    <OutputType>Exe</OutputType>
    <RootNamespace>MauiArgh3</RootNamespace>
    <UseMaui>true</UseMaui>
    <SingleProject>true</SingleProject>
    <EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>

    <!-- Display name -->
    <ApplicationTitle>MauiArgh3</ApplicationTitle>

    <!-- App Identifier -->
    <ApplicationId>com.companyname.MauiArgh3</ApplicationId>

    <!-- Versions -->
    <ApplicationVersion>1.0</ApplicationVersion>
    <AndroidVersionCode>1</AndroidVersionCode>

    <!-- Required for C# Hot Reload -->
    <UseInterpreter Condition="'$(Configuration)' == 'Debug'">True</UseInterpreter>
</PropertyGroup>

@MichaelPeter
Copy link
Author

@markrendle: Haha, first thought no, that is too weird, but could reproduce it, also works for me.

So maybe a bug in csproj processing?

@drasticactions
Copy link
Contributor

drasticactions commented Sep 15, 2021

This is a bug in Visual Studio. While you have either Android or iOS selected as the device to deploy to, it still has "Windows Machine" (The WinUI project) internally selected and tries to deploy to it. Since the Framework is still net6-ios or net6-android, MAUI can't generate the needed recipe files for it to deploy, hence "Need recipe file". This can happen even if you have the windows TFM added as well.

If you select "Windows Machine" and then select the Android or iOS device again, it should fix itself. You can also remove the launchProfile.json in the Properties folder as well.

The underlying bug is being tracked internally and should be fixed for the next preview of VS 2022.


The other way you can hit this is if you don't have the Windows TFM added and selected. If you select "Windows Machine" but don't select "net6.0-windows10.0.19041" as the runtime, it will throw with "Need recipe file". To fix this, uncomment the TargetFrameworks line in the csproj, select the Windows TFM, and then select "Windows Machine". It should deploy now.

@MichaelPeter
Copy link
Author

@drasticactions: Thanks for the answer, took me a bit to understand it so for others you need to select windows in two places.

grafik

Should I close this now, or when it is fixed in visual studio?

@blazorin
Copy link

Hello. I was going on with the same issue. The solution works, but in the examples templates, the EnablePreviewMsixTooling was removed, which keeps producing the "need receipt."

To fix that if it's case of anyone just add
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>

in the first property group

@BillyMartin1964
Copy link

BillyMartin1964 commented Sep 23, 2021

My csproj didn't have net6 for windows, so I added it to target frameworks and everything works fine.

<TargetFrameworks>net6.0-ios;net6.0-android;net6.0-maccatalyst;net6.0-windows10.0.19041</TargetFrameworks>

@Rarisma
Copy link

Rarisma commented Sep 27, 2021

As @BillyMartin1964 said this works fine, just update the target frameworks in your csproj to this
<TargetFrameworks>net6.0-ios;net6.0-android;net6.0-maccatalyst;net6.0-windows10.0.19041</TargetFrameworks>

and make sure the framework is set to windows and it should work

@Eilon Eilon added the area-setup Installation, setup, requirements, maui-check, workloads, platform support label Oct 5, 2021
@arivoir
Copy link

arivoir commented Oct 13, 2021

It's still reproducible in VisualStudio 2022 Preview5

@abhidotnet
Copy link

Yes. I am facing it as well. I am using preview 5.0

@metalblade34
Copy link

Yes. I am facing it as well. I am using preview 5.0

You have to Edit project file and Uncomment this line
net6.0-ios;net6.0-android;net6.0-maccatalyst1
$(TargetFrameworks);net6.0-windows10.0.19041

it's working for me (Dont forgot to activate Developper Mode)

@mattleibow
Copy link
Member

Have you installed this extension yet? https://marketplace.visualstudio.com/items?itemName=ProjectReunion.MicrosoftSingleProjectMSIXPackagingToolsDev17

In Preview 5 this is still a separate extension, but will eventually be in the box and automatically installed.

@nameofSEOKWONHONG
Copy link

If the emulator does not appear after launching as a desktop app, reload the project.

@jsuarezruiz jsuarezruiz added area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging t/bug Something isn't working labels Oct 22, 2021
@hartez hartez changed the title [Bug] Debug for Windows App Fails Deploment: Need recipe file [Bug] Debug for Windows App Fails Deployment: Need recipe file Jan 5, 2022
@Redth
Copy link
Member

Redth commented Jan 19, 2022

Could anyone please confirm if they are still able to reproduce this with the latest VS 17.1 Preview 2.0 or 3.0 and MAUI Preview 11 or Preview 12?

We believe this is fixed.

@Redth Redth added the s/needs-info Issue needs more info from the author label Jan 19, 2022
@Eilon
Copy link
Member

Eilon commented Feb 10, 2022

Hi, we think this issue has been fixed in more recent previews of .NET MAUI and Visual Studio. Please try installing the latest preview per the instructions at https://docs.microsoft.com/dotnet/maui/get-started/installation. If you are still experiencing an issue, please file a new issue with updated details.

@Eilon Eilon closed this as completed Feb 10, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Mar 13, 2022
@samhouts samhouts added the p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint label Jul 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-setup Installation, setup, requirements, maui-check, workloads, platform support area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint s/needs-info Issue needs more info from the author t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests