Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio target Deploy does not exist

I'm getting this error when running a built project in Visual Studio 2017:

------ Deploy started: Project: myProj, Configuration: Debug Win32 ------  

C:\...\myProj.vcxproj : error MSB4057: The target "Deploy" does not exist in the project.
Done building project "myProj.vcxproj" -- FAILED.
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

I found something online saying uncheck Deploy from Build, Configuration Manager... but it is already unchecked.

If I try to run it again, it will load and run. But I'd like to be able to release code that works the first time. What else might I try? TIA.

like image 806
Topological Sort Avatar asked Jul 06 '17 03:07

Topological Sort


3 Answers

Odds are you have a post build event in your project. When you first build it the post build event fires and attempts the deploy. The second time you go to build the project is already 'up to date' so it is not built and the post build event does not fire.

You can view your post build events by right clicking your project and choosing properties, expanding build events and then expanding post build.

enter image description here

You can also check if anything is defined under custom build steps.

like image 94
Alexander Higgins Avatar answered Nov 13 '22 19:11

Alexander Higgins


Solved the problem by opening the .sln file of the problematic solution with a text editor. I've found there the following lines for different configurations:

{GUID}.Release|x86.Deploy.0 = Release|Win32

After deleting all these lines for different configurations, I didn't get the error anymore.

like image 2
macro_controller Avatar answered Nov 13 '22 18:11

macro_controller


This worked for me :

  1. GOTO "Project Property Page"
  2. click "Project Dependencies"
  3. Select your main project in "Project:"
  4. Add the dependency on the project that gives you the deploy error.
  5. Save ALL
  6. Recompile
like image 1
fveilleux Avatar answered Nov 13 '22 18:11

fveilleux