-1

When I try to run the solution 'ModelCompilerSolution' that is output by the OPC UA ModelCompiler BuildDesign.bat file, I get an error message from Visual Studio that says:

"A project with an Output Type of Class Library cannot be started directly. In order to debug this project, add an executable project to this solution which references the library project. Set the executable project as the startup project."

What are they referring to by the executable project that they mention to add? Generally, how should this project be created?

nabs825
  • 43
  • 1
  • 8
  • 1
    I would say it is impossible to get this error/message when **building** project. I'd bet you try to run the solution, not just build it. – astrowalker Jun 28 '18 at 06:02
  • @astrowalker, that is correct. I fixed this in the original question. However, are you aware of any potential answers to my questions when phrased in this context? – nabs825 Jun 28 '18 at 13:02
  • Yes and no -- it seems this solution is simply a library, so you are supposed to write your own project (executable one) and refer this library. – astrowalker Jun 28 '18 at 13:56
  • Possible duplicate of ["A project with an Output type of Class Library cannot be started directly"](https://stackoverflow.com/questions/3363106/a-project-with-an-output-type-of-class-library-cannot-be-started-directly) – kenorb Sep 18 '18 at 16:14

1 Answers1

0

The error happens because Class libraries cannot be executed by themselves. Assuming an application project (console, forms, wpf, etc) exist on your solution, you need to set it as Startup project (right-click) so Visual Studio has something to run.

enter image description here

pollirrata
  • 5,188
  • 2
  • 32
  • 50