Visual Studio target Deploy does not exist - visual-studio

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.

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.
You can also check if anything is defined under custom build steps.

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.

This worked for me :
GOTO "Project Property Page"
click "Project Dependencies"
Select your main project in "Project:"
Add the dependency on the project that gives you the deploy error.
Save ALL
Recompile

Related

Visual Studio online build failing with 0 warnings and 0 errors

I am just setting up a basic build with a very bare bones WebApi App, and I am getting a failed build, but without any errors or warnings... how can i figure out what is going wrong?
Project "d:\a\1\s\My.Project.Api.sln" (1) is building "d:\a\1\s\My.Project.Api\My.Project.Api.csproj" (2) on node 1 (default targets).
_CleanRecordFileWrites:
Creating directory "obj\Release\".
Done Building Project "d:\a\1\s\My.Project.Api\My.Project.Api.csproj" (default targets) -- FAILED.
Done Building Project "d:\a\1\s\My.Project.Api.sln" (default targets) -- FAILED.
Build FAILED.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:00.15
##[error]Process 'msbuild.exe' exited with code '1'.
Even any way I can get a useful log or error message would be great!
Edit:
I added /v:diag for the build arguments for verbose logging, but it really isn't seeming to help.
Before Visual Studio build task, you should use nuget restore to download packages your project is referring.
So please add a Nuget task before Visual Studio build task. Detail setting for NuGet task as below:
Command: restore
Path to solution, packages.config, or project.json: **/*.sln or select relative path for My.Project.Api.sln
Feeds to use: Feeds in my NuGet.config
In your build definition, there is a variable called system.debug which is set to false. Change this to true at the template or at the time of triggering and you will get the debug lines written by the build tasks. Inspect the debug lines and you might find the issue.

Visual studio installer project - build platform configuration is N/A .. how to change?

I m using VSTS build task for building msi files from installer projects.
I get below log message and no msi file is generated(project is being skipped always from build) . I don't see platform option dropdown to select "Any CPU " from build configuration manager.
Please help. Click on the below links to see screen shot of build configuration and build task
build configuration
Build tasks
------ Skipped Build: Project: Setup4, Configuration: Release ------
Project not selected to build for this solution configuration
However msi file is generating fine when I do manual build on setup project. Not sure why platform option is missing for setup project..?????
From the build log, TFS is using Release Configuration. And from the log, it seems that your project doesn't select build configuration for Release configuration.
So, in the configuration manager of Visual Studio, select build for release configuration. Then check in to TFS.
You should pay attention that, both project and solution has configuration settings. If you want to build solution in TFS, change the solution settings. If you want to build project in TFS, change the project configuration settings.

Build fails in vs2015 with no errors

I have an ASP.NET core 1.0 project I created in Visual Studio 2015 (update 3). If I try to build the project within VS I get the following in my output window and there are no errors in the Error List:
1>------ Build started: Project: QuickStartIdentiyServer4, Configuration: Debug Any CPU ------
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
However, if I build the project using the dotnet CLI command (dotnet build) it builds and runs just fine.
UPDATE:
Apparently, .net core does not work properly when running Visual Studio as Admin. You would think everything should work as Admin, I guess not... go figure.
There are simply too many reasons why this type of thing might happen. The easiest way to diagnose the problem is to change the build output verbosity under options to verbose. This might help put you on the trail:
With regards to this type of thing happening with .Net Core and ASP Core. I have noticed that the project.json dependencies json fragment is a bit buggy especially if you start renaming projects and changing their file system location.
If you see in the diagnostic below you know there is some dangling reference issue:
Done building target "_GetDependencyFragmentFiles" in project "<<?YOUR_CORE_PROJECT?>>.xproj" -- FAILED
May be you are not seeing build errors. Go to Error List window and change 'Show Issues generated' box from 'Build + Intellisense' to 'Build Only' and try to build again.
See if this helps.

Continuous Integration on VSTS - Build Definition: No Files - System.AggregateException

I am using Visual Studio Team Services. I created a Simple ASP.NET website and created my Build definition which contains default settings.
After committing changes, the build is triggered using CI. The "Build Solution" Step works fine, however no files are found in the Copy Files Step:
I have created the same build definition for a simple console app, and the build and release are working.
When Creating a release from this build, it fails to deploy (i guess because no files are found in (Build process)) and gives the following error:
When you build Asp.Net project with a default VSBuild definition, the folder bin\$(BuildConfiguration)\ does not exist. So "Copy Files" task cannot find any files with the default settings. A simple way to fix your issue is add /p:outdir=$(build.artifactstagingdirectory) in "MSBuild Arguments" for VSBuild task as following:
And you can also remove "Copy Files" task since "Publish Build Artifacts" task publishes the files in $(build.artifactstagingdirectory) folder by default and you have set the build output to that folder with the argument added in VSBuild task.
Update:
You can add a "Copy Files" task with the following settings to copy "roslyn" folder to "bin" folder:

Any clever way to launch a makefile in Visual Studio only if build succeeded?

We have a makefile that is built last in our build process using Visual Studio to launch our unit tests. Unfortunately if the build fails the makefile is still processed and we have extra (annoying) errors. Any way to prevent that?
Example
Project A : build dummy.exe
Project B (makefile) : build command is : run dummy.exe /unittest
We want Project B to skip its build command when Project A has build errors. Thanks!
Set Project B (your makefile project) to be dependant on Project A. This way Project B will always try to build Project A before it builds.
Go to Project Properties. I assume you already have something in the "Post-Build event command line" box? There is a "Run the post-build event" combobox, set it to "On successful build".
Is that what you're looking for?

Resources