I have started a new console project in VS2015. I only have this code :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text
After adding a project reference 'MyProjectReference' to my app, then removing it, I was also getting the same error :
Unable to start debugging . The startup project could not be launched. Verify debug settings for the startup project.
Deleting configuration, running as admin, restarting VS, rebooting machine all had no effect.
After running my web app without debugging (Right-Click Project -> View In Browser (Google Chrome) I got a much more useful error:
Could not load file or assembly 'MyProjectReference' or one of its dependencies. An attempt was made to load a program with an incorrect format.
My Solution was then to re-add back to the solution, then remove it again. After that rebuild and debug worked.
Simply updated visual studio which then prompted PC restart. This is what fixed the problem for me.
Note: I tried some of the above / below but to no avail.
I get this running as non-Adminsitrator in Visual Studio 2019 16.2.5, with two .NET Core projects.
The solution I found is to set at least one of the projects as "Start" (in Solution's Property Page). If both are set to "Start without Debugging" it fails. This happens even if I want to start the entire project without any debugging (Ctrl+F5).
Bug. Still unaddressed by Microsoft and their bug page issue report it is closed as unreproducible.
I found this problem too. But after restart the Visual Studio Community 2015 as an administrator I found new problem :
And then I try to open another solution, close the another solution, and open the solution which the problem occur, then the problem solved.
VS 2019, two Core 3.1 projects (an MVC and an API), brand new projects created, no other changes to the solution or projects.
I kept getting the referenced error when trying to start both projects within the IDE, despite having checked all the things already mentioned in this SO.
However, I finally realized, I forgot to specify the "Action" after switching the solution to "Multiple startup projects" (they were both still set to "None"). Right-click solution in "Solution Explorer", choose "Properties" (at very bottom).
Such a ridiculously simple thing. Hope it helps someone else.
"Broken"
Working
For me solution was to run testapp.csproj
instead of testapp.sln
. This can be selected from drop down next to green play button.