Open bryaan opened 2 years ago
@evelynwu-msft FYI
I also encountered this problem, when I checked the Deploy option of the Project contexts in Configuration Manager, it was solved~
I have the same problem although the checkbox is already cheched as you can see in the attached screenshot.
OK, after testing further, this happens when my app directory is located on a local network drive mapped onto my PC. How to overcome this issue please ?
On the other hand, if my app directory is on the local PC, it works fine.
OK, after testing further, this happens when my app directory is located on a local network drive mapped onto my PC. How to overcome this issue please ?
@Jay-G-HK As you've discovered, packaged apps can't be run from a network drive.
I can confirm this is an issue. My project was fine until the latest update of VS. Then it does not work. After starting a new maui project, I see the same issue. My guess is that a nuget conflict is causing it. My file is on C so no remote or removable.
Weird things I have seen.
deleting obj, .vs and bin folder can help, but not always.
I have
<WindowsPackageType>None</WindowsPackageType>
<UseWinUI>true</UseWinUI>
<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.3.2"/>
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>
without them I can deploy and run in release and debug from VS but can not run the .exe file
With them I can not deploy. Haha
If I first deploy and build and then add them, and build the build will fail due to deployment issue but .. now the app runs via the executable.
@eschoker Setting <WindowsPackageType>None</WindowsPackageType>
in your project file configures it as unpackaged which means that the Deploy
action has no meaning. Make sure that in that particular scenario your launchSettings.json
lists Project
as the profile name if you wish to be able to F5
in VS.
The same issue happens if you create your WinUI3 project on an encrypted drive - and then try to debug/launch it. Visual Studio shows error like this one: DEP0700: Registration of the app failed. [0x80070005] error 0x80070005: Opening file from location: AppxManifest.xml failed with error: Access is denied Simultaneously a "The project needs to be deployed before we can debug" dialog appears - and "Deploy" checkbox is selected.
Issue disappears after moving project directory to disk drive without encryption.
In my case, the issue started happening after I renamed my .NET MAUI project even though the deploy checkbox was checked in the Configuration Manger.
What worked for me:
Removing obj
and bin
folders
Thing I tried that didn't work: I tried many things including
For me that was even more strange. In the end it was related to an invalid appxmanifest. The publisher was not following a certain pattern. No idea how that error should lead to that but this was the only fix I did.
I recently faced the same issue and error message with a new MAUI project due to spaces in my project names. It's a simple and very stupid mistake, but nevertheless. For future reference, avoid spaces in project names.
I had the exact same problem, but on a local drive that was encrypted using bitlocker. The solution was to decrypt the project folder.
This message can show up when you have any sort of deployment error. Open the Output tab and set Show output from:
to Build
. Deployment errors will show up there, but not in the Error List tab or, as far as I can tell, anywhere else in Visual Studio. As an example, here's an error caused by a typo in an appxmanifest:
I have the same problem although the checkbox is already cheched as you can see in the attached screenshot.
Jay, Under project properties/build output change the Platform Target to x64, and confirm that Build and Deploy are checked for x64. It worked for me.
Same issue here. I can't run my MAUI app from Visual Studio. However I noticed something interesting: I can run my MAUI .exe outside file outside Visual Studio despite the open issue https://github.com/dotnet/maui/issues/15067 On the other hand, the same code, on another pc, run under Visual Studio but not outside, as per open issue above. Not sure if this can help.
Also running into this issue. Any word on a fix or workaround?
Looking with interest at the comment @IcEiE regarding "Spaces in Project Names", my own related problem turned out to be "hyphens-in-project-names" which is something I've done routinely up to this point. Pascal-Case now seems to work fine.
Not sure why this issue is still not resolved, i consider it pretty bad if an out-of-the-box generated project pops up this error. It is not very inviting to attempt write WinUI 3 apps this way if this is the first bug you run into. I tried many of the suggestions here but the error box keeps popping up in spite. I'll return to Win UI3 if the maturity is up to par.
I had underscores in the project/solution name. Created a new project without the underscores and it worked.
I think it has to do with whether there is an internet connection or not when the program is created or when we first build the project.
For me, this occurred when selecting .NET 8.0 LTS. Switched to .NET 7.0 Standard Service and the issue went away
For me, this occurred when selecting .NET 8.0 LTS. Switched to .NET 7.0 Standard Service and the issue went away
Same problem here, and the only way that fix my problem is by switching to .NET 7.0.
This fixed it for me:
get-appxpackage -name NameFromErrorMessage -AllUsers remove-appxpackage -package PackageFullName -AllUsers
I had underscores in the project/solution name. Created a new project without the underscores and it worked.
This worked for me. I had spaces in a project name (e.g. "Project Name Here") and it resulted in this error. Removing the spaces eliminated the error.
I tried a number of the solutions described here. The only thing that allowed the Windows version to deploy and debug was to recreate the project using a project name that included no spaces in it.
I just faced this issue right after updating Microsoft.WindowsAppSDK (v1.5.240428000 ->v1.5.240802000).
In my case, downloading Microsoft.WindowsAppSDK helped once but not every time. Restarting Visual Studio helped once I guess.
I had underscores in the project/solution name. Created a new project without the underscores and it worked.
As silly as it sounds, making it pascalCase works XD
i did a clean of my project and recompiled and it seems to work fine.
Im trying to build a WinUI3 project created with default templates. I created a WINUI3 class library and connected it to a Blank App. I am getting a dialog on build that says The project needs to be deployed before we can debug. Please enable Deploy in the Configuration Manager.
But when I go to Configuration Manager, the Blank App's Build and Deploy checkboxes are already checked. Deploy checkbox is disabled for the class library.