I\'ve download sample code with C#. but when I run I get this error message:
A project with an Output type of Class Library cannot be started direct
The debug settings of your Visual Studio development environment might be left blank. Please check if the following highlighted fields are missing, if they are missing then fill it up with your specific executable.
These fields are required to let the VS start the program for debugging. In the above picture, I'm developing a VSPackage so the:
Note: I can assure you the answers mentioned in here didn't help me fix the issue because my project was already set as a startup project, now I came across an MSDN blog which helped me and lead to this answer.
The currently selected startup project is a Class Library.
You need an entry point for your application. Does your solution contain multiple projects?
Are you sure you want to 'run' the Class Library?
Possibly you've downloaded a Class Library solution only. In that case there might be unit tests that you can 'debug' to step-trough the code.
Update In response to your comment, these are possibilities to run the class library:
Try to close Visual Studio and restart it by opening the file you are trying to debug from Unity
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<StartAction>Program</StartAction>
<StartProgram>C:\Program Files (x86)\Microsoft Office\Office14\excel.exe</StartProgram>
<StartArguments></StartArguments>
<StartWorkingDirectory></StartWorkingDirectory>
<EnableUnmanagedDebugging>true</EnableUnmanagedDebugging>
</PropertyGroup>
</Project>
You need to check that you have the startup project setup correctly.
If there is more than one project in the solution, right click on the one that should be run when you compile and choose Set as startup project
I was trying to run a Debug test with breakpoint in the specFlow feature.cs file instead of the Step.cs file. Put the breakpoint in the Step.cs file and it's working as expected. Thanks!