Dinithe Pieris
Dinithe Pieris

Reputation: 1982

Visual studio the project needs to be deployed before it can be started

When starting to test the application on Windows Phone (even a blank app) on emulator or device, this error is poping out "The project needs to be deployed before it can be started". "verify the project is selected to be deployed in the solution configuration manager, or depoly it explicitly by clicking one of the deploy commands in the Build menu" The emulator will be started & run successfully, still no luck in deploying app on emulator.

enter image description here2>Error: The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Upvotes: 63

Views: 37545

Answers (10)

Daniel
Daniel

Reputation: 9521

In my case, I had something like that in my csproj

    <WindowsPackageType Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">None</WindowsPackageType>

Changing None to MSIX solved the problem

Upvotes: 0

Atti
Atti

Reputation: 11

I had the same problem and it was also with multiple startup projects.

All the Debug Targets showed that there was a target selected. I checked all of them again and one was showing a Debug Target that was not there anymore but still showed it and the correct one was not visible either.

The only way I was able to select the correct debug target for that project was to set that project as a solo startup and when I got back into the configuration manager I was able to select the correct debug target.

Hope this helps someone

Upvotes: 0

Abhay
Abhay

Reputation: 31

Go to properties of your solution and select debug target from dropdownenter image description here

Upvotes: 0

Boris
Boris

Reputation: 391

I encountered the same problem with my MAUI Blazor project after I upgraded Visual Studio from 17.11.2 to 17.11.4 . tried many things but this is what worked for me

  1. Clean the solution by going to Build > Clean Solution.
  2. Rebuild the solution by going to Build > Rebuild Solution.

Upvotes: 0

Mohamed Noordin
Mohamed Noordin

Reputation: 166

The problem for me was that I added a wrong tag to the appxmanifest file of the Windows package. Inside the Capabilities tag, I added this device capability:

<DeviceCapability Name="microphone"/>

before the <rescap:Capability Name="runFullTrust" /> tag.
After reviewing the output log in the output window, I found this:
Registering the application to run from layout... DEP0700: Registration of the app failed. [0x80080204] error 0xC00CE014: App manifest validation error: The app manifest must be valid as per schema: Line 40, Column 6, Reason: Element '{http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities}Capability' is unexpected according to content model of parent element '{http://schemas.microsoft.com/appx/manifest/foundation/windows10}Capabilities'. Expecting: {http://schemas.microsoft.com/appx/manifest/foundation/windows10}DeviceCapability.

DeploymentSucceeded = False
DeploymentError = Err_Deploy_Register
DeploymentUserError = False
DeploymentHRESULT = -2146958844
HasSharedCode = False
Target.Id = 256
ProjectGuid = {ee0f748f-d7e6-4143-b665-fc0f1c01c64b}
Project.TargetPlatformVersion = 34.0

Deleting file "vs.appxrecipe" from layout... DeployAsync: END (Failure, 0:00:01.05) Deploy: END (Failure, 0:00:01.09)
Then, I removed the tag completely and I added it through the manifest editor, which has been added after the rescap Capability tag.
This may happen with other platforms as well. Reading the boring output log can be useful sometimes.

Upvotes: 1

Sam
Sam

Reputation: 603

nothing above worked for me, and it was a reboot that finally fixed it for me -facepalm.

Upvotes: 2

Jithin Palepu
Jithin Palepu

Reputation: 803

The solution for this would possibly be either one of the following:

  1. Checking in the Debug & Build tick marks in the configuration manager (from Debug -> Config Manager -> Debug & Build) which works in most of the time.
  2. Cross checking the deployment environment with the file systems and everything (Windows/Android/ios). This can be checked from the drop down menu.

However, in some cases everything might be in the right place (having the checked in build & deploy, choosing the right managers) in my case what worked for me the naming convention. When I created the project, i was using the wrong convention. (Maybe we have to follow platform specific naming conventions). You can view it here in the following link.

Upvotes: 4

rs77can
rs77can

Reputation: 61

I had a similar error

Error       DEP0700: Registration of the app failed. [0x80073D1F] Deployment operation failed.

I added en-us as the language in Package.appxmanifest, but that did not fix the problem. Both 'Build' and 'Deploy' were already tagged by default.

I moved the app to a local drive, as opposed to a server shared drive, and then it deployed and ran OK

Upvotes: 2

Rok Rodič
Rok Rodič

Reputation: 19

One of possible errors is incomplete or partially complete Package.appxmanifest. Check the file. I had a red X next to an incomplete field.

Upvotes: 1

mindOfAi
mindOfAi

Reputation: 4602

Probably the reason for this is that your Build and Deploy configurations aren't enabled. To enable these configurations. Do these steps:

Step 1: Open the Configuration Manager by clicking the active solution configuration. The default is <Debug>:

enter image description here

Step 2: Enable the Build and Deploy configurations by checking the boxes for Any CPU. enter image description here

After this, you can try running you app. It should be working properly.

Upvotes: 141

Related Questions