maui: (App Name).build.appxrecipe" does not exist. You may need to build your project

Description

Unable to run the MAUI winUI app.

Always giving the error as "DEP1700: The recipe file “C:\Projects\MauiApp2\MauiApp2\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\MauiApp2.build.appxrecipe” does not exist. You may need to build your project. MauiApp2 " And my launch settings looks like this:

{
	"profiles": {
		"Windows Machine": {
			"commandName": "MsixPackage",
			"nativeDebugging": false
		},
		"Profile 1": {
			"commandName": "Executable",
			"nativeDebugging": true
		}
	}
}

And the .csproj file looks like this :

<PropertyGroup>
		<TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
		<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
		<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
		<!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> -->
		<OutputType>Exe</OutputType>
		<RootNamespace>MauiApp2</RootNamespace>
		<UseMaui>true</UseMaui>
		<SingleProject>true</SingleProject>
		<ImplicitUsings>enable</ImplicitUsings>

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

		<!-- App Identifier -->
		<ApplicationId>com.companyname.mauiapp2</ApplicationId>
		<ApplicationIdGuid>3aac4806-6dd2-4fd2-aa7f-8cdc9d9ed172</ApplicationIdGuid>

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

		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
		<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
	</PropertyGroup>

app.manifest looks like this:

<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
  <assemblyIdentity version="1.0.0.0" name="MauiApp2.WinUI.app"/>

  <application xmlns="urn:schemas-microsoft-com:asm.v3">
    <windowsSettings>
      <!-- The combination of below two tags have the following effect:
           1) Per-Monitor for >= Windows 10 Anniversary Update
           2) System < Windows 10 Anniversary Update
      -->
      <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
      <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
    </windowsSettings>
  </application>
</assembly>

Steps Followed:

  • Clean
  • Rebuild
  • Removed bin and obj
  • Changes “commandName”: “MsixPackage”, to “commandName”: “Package”, which gives the different error

I have not done any changes in the MAUI project. Just created new MAUI project and try to run with code changes. Still not working.

Steps to Reproduce

Create a new MAUI app and run targeting the Windows platform

Link to public reproduction project repository

No response

Version with bug

7.0.92

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

No response

Did you find any workaround?

Unable to find some workaround

Relevant log output

DEP1700: The recipe file "C:\Projects\MauiApp2\MauiApp2\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\MauiApp2.build.appxrecipe" does not exist. You may need to build your project.
1>Deployment of the application to the target device failed.
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
========== Elapsed 00:00.424 ==========

About this issue

  • Original URL
  • State: open
  • Created 10 months ago
  • Reactions: 1
  • Comments: 33 (1 by maintainers)

Most upvoted comments

This happened to me, as well. I’d attempted an upgrade from .NET 6 to .NET8 for my Hybrid Maui Blazor app. After a few hours of trying random stuff, I figured out I was attempting to launch the wrong framework (see screenshot): image While my app currently only targets Windows, I also have a plain net8.0 framework in the csproj file. I believe it’s used by my unit test project. After switching the Framework to the net8.0-windows10.0.19041.0 in the dropdown in the screenshot, it launched successfully again.

My guess is that the framework got switched after the .NET upgrade

@mattleibow We are also running into this with VS 17.8, .NET 8. No fixes mentioned here have worked.

This sounds like something was blocking VS for creating/reading the recipe. Are folks still hitting this?

Yes ! New to C#, .Net and MAUI; Visual Studio 17.8, .NET 8.0 . Upgraded from VS 17.6 to 17.8 and started getting it again (dont recall how it ‘vanished’ last time but I got it a few days back too)

Just moving the new solution to a new folder also doesnt seem to fix it image

image

image

image

image

@XamlTest Please find the Screenshots. I already tried in the latest preview version of Visual Studio. Still I see the issue.

This happened to me, as well. I’d attempted an upgrade from .NET 6 to .NET8 for my Hybrid Maui Blazor app. After a few hours of trying random stuff, I figured out I was attempting to launch the wrong framework (see screenshot): image While my app currently only targets Windows, I also have a plain net8.0 framework in the csproj file. I believe it’s used by my unit test project. After switching the Framework to the net8.0-windows10.0.19041.0 in the dropdown in the screenshot, it launched successfully again.

My guess is that the framework got switched after the .NET upgrade

I also have a plain net8.0 targetframework to support an xunit project. Changing the selected framework as you suggested, along with whacking bin/obj folders, clean & build, and then F5 worked like a charm.

It’d be nice to have a error that instructed me to check my target framework as well.

I’ve added <OutputType>Exe</OutputType> to the csproj and now it works again.

Seriously? there is no solution so i just redo the project? that sucks man

@achobanov its such a strange failure mode, it seems that the 3 of us all found unrelated solutions that did not work in the other cases. makes it very difficult to know what to do when the error presents … will try re cloning the repo next time i encounter this because that is much easier than what i did to fix it.