The project * needs to be deployed before it can be started - visual-studio

When I starting the project the following error appears:
The project TestProject.Android needs to be deployed before it can be started. Verify the project is selected to be deployed in the Solution Configuration Manager.
In the Configuration Manager Build and Deploy configurations enabled for Any CPU.
Note: reproduce only on Visual Studio 2019. On the previous version (2017)
all works as expected.

You can simply change the settings in your Solution as:
right-click the Solution -->then go to "Configuration Manager" -->then check "deploy" for your required platform project.
Hope!! It will work..

Related

TeamCity continues to build projects that have been excluded from my Visual Studio solution configuration

My Visual Studio 2019 solution contains several projects, some of which I don't want to be built as part of continuous integration. Specifically, I'm trying to exclude tooling and unit tests.
In Visual Studio, I have created a new solution configuration and unchecked the "Build" box for each project I don't want to be built.
In TeamCity, I have specified the name of the new solution configuration to use. However, TeamCity continues to attempt to build all projects within the solution.
[I had included screenshots of my solution configuration, TeamCity build configuration, and resulting TeamCity log but I do not have enough reputation to post images apparently.]
From everything I could find so far, unchecking "Build" from the solution configuration used by TeamCity is supposed to exclude that project from building.
I figured it out by finally noticing that the TeamCity log was showing the build configuration as "ReleaseCI|Mixed Platforms" instead of "ReleaseCI|Any CPU". On other projects, I only needed to specify the configuration. For this project, I apparently have to specify the platform as well.

The active solution configuration is not configured to build or deploy the Service Fabric Application Project

I have a Service Fabric project with multiple services. When i try to deploy it, i get the following error:
The active solution configuration is not configured to build or deploy
the Service Fabric Application Project. This can happen if the
solution configuration is not configured to build/deploy the x64
platform which the project requires.
Possible cause 1:
Check in the Configuration Manager for the proper platforms to be set for the projects(x64 is required for Service Fabric). For me that was already correct.
Possible cause 2:
Still in Configuration Manager, check if you have multiple Project contexts for which you can Deploy and all check boxes are unchecked. If yes, select the project you want to deploy and then try deploying again.
Possible cause 3:
Make sure the project(s) you have set to Deploy is(are) Set As Startup Project(s). And in Configuration Manager the checkboxes Build and Deploy are ticked for this project.
The Service Fabric project has to be set as startup project and it's configuration has to look like below:
Service Fabric project(right click) >>> Properties >>> Configuration Manager
The problem is caused by an incorrect project-type GUID in the .sln file. The line stating:
Project("{guid}") = "YourCode.Tests", ...
will have the wrong guid on it.
This happened for me when upgrading MSTest projects from .NET Framework to .NET 5.0.
Easiest solution is to go into Visual Studio Configuration Manager, and change the Configuration dropdown on the affected project from Debug to Release and then back to Debug again. You will see that the project guid is changed in the SLN file to match the project type and it will start working.
Another possible cause: The name you pass to RegisterServiceAsync is already in use by another service deployed on that cluster (copy-paste-error?).

"Set as StartUp Project" not changing deploy configuration in Visual Studio

I'm working at a colleagues PC. When I right click on a .Net Gadgeteer 4.2 project in our solution and select "Set as StartUp Project" I expect Visual Studio to set the build configurations so that the new start-up project is deployed to the device on start, as it does on my PC. But instead I need to open the configuration manager and manually deselect the previous start-up project and select the new one. Why? How can I swap (back) to using Visual Studio to manage deployment without the additional step in the configuration manager?
========== EDIT ==========
#john-saunders comment below makes me think I've misworded my question.
I have a solution containing multiple projects, many of which are .Net Gadgeteer projects.
On most of my machines if I right click on Project A in the Solution Explorer and select Set as StartUp Project then when I debug the solution (i.e. hit F5) Project A and any of its required dependencies are built and deployed to the Gadgeteer device and the debugger gets attached. If I then right click on Project B in the Solution Explorer and select Set as StartUp Project then when I debug the solution Project B and any of its required dependencies are built and deployed to the Gadgeteer device.
But on one machine this is not happening. Instead when I right click on Project B in the Solution Explorer and select Set as StartUp Project when I debug the solution Project A is deployed to the Gadgeteer device. To ensure that Project B is instead deployed I have to manually edit the configuration.
Why? How do I get this one machine to behave like the others?

How to determine Visual Studio Setup and Deployment project prerequisites?

I am trying to deploy an app in C# with a Setup And Deployment project in VS2010. The main project and the deployment project are in the same solution and I have added the primary output of the main project to the deployment project. In the property pages for the deployment project, there is a button for prerequisites. How do I find out what items my app will require for successful deployment?
Thanks.. :)
Visual Studio will manage all the requisite DLL's that need to be installed for your application to run... If still you need to add more dependencies then you could create an application that will handle this process for you.
And since Microsoft has an easy solution for almost everything, there are options to the installer to do just this. Here you'll find it as per MS documentation.
Right click your project => propereties => Application => Target Framework

Web Deployment Projects, Web Application Projects and Team Build 2008

I've switched from a Website Project to a WAP (Web Application project).
The WDP (Web Deployment Project) is used to set and potentially in the future make other web.config changes.
However I notice that the team build is building everything twice, once on behalf of the solution file and then again because of the WDP. Any idea how I can stop this from happening?
Or is there a way to replace out the web deployment project altogether?
Yes and yes.
You can stop TFS Build from building everything twice by following these steps:
Open the configuration manager (open your solution and select Configuration Manager from the top-level Build menu).
Expand the drop down list for Active solution configuration and select New.
Enter a name for your new solution configuration and select an existing configuration to copy settings from and click OK.
In the Configuration Manager, uncheck the checkboxes in the Build column for all of the projects except the deployment project and click Close.
Edit your TFSBuild.proj file's ConfigurationToBuild ItemGroup by adding your new configuration:
Foo
Any CPU
Where Foo is the name of the new configuration you just defined.
For Visual Studio 2010, the ASP.NET team has partnered with the IIS team to deliver an integrated web application packaging and deployment solution built on the [Web Deployment Tool][1]. It more or less replaces web deployment projects and you can use it with VS/TFS 2008 via its [command line interface][2]. I have a blog post covering the basic scenario here:
Building a Simple Web Site with VSTS/TFS 2008.

Resources