none
NEED HELP WITH VISUAL STUDIO ERROR MESSAGE

    Question

  • When I am on a stock trading website [NinjaTrader] i edit a ''NinjaScript'' program written in C#. The editor does not have a breakpoint feature but i am able to attach to Visual Studio to use Visual Studio's C# editor debugger breakpoint features. However, I encounter an error message displayed below. I have absolutely no idea what the message means or how to resolve the issue. Any help/suggestions will be much appreciated.


    Joe MIller

    Saturday, December 10, 2016 12:37 PM

Answers

  • Hi Joe MIIIer,

    Welcome to the MSDN forum.

    Refer to the error message “A project with an Output Type of Class Library cannot be started directly”, it looks like the project type set as the Startup project in your current solution is Class Library type, the Class Library cannot be started directly, you need to set an executable like C# windows application or console application to start, please have a look at this smiliar issue:

    Does your solution includes several projects or just one project? Could you please share the screenshot of your current Solution Explore in here?

    1. If there is only one Class Library project, you can try to add a new project which project type is windows application or console application under the current solution, in the newly project to reference your Class Library, then set the newly project as the startup project through right click the project name and click ‘Set as Startup project’, then try to debug the Class Library.

    2. If there is only one project but type is windows application or console application, you need to right click the project name and select ‘Properties’, under ‘Application’ tab, check the value of ‘Output type:’, if it is ‘Class Library’, you need to correct it to the right project type like the following, then you can start normally.

    3. If there are some other projects, choose a project whose type is windows application or console application as the startup project, then it should work.

    Best regards,

    Sara


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, December 13, 2016 5:38 AM
    Moderator