-4

have a problem, that someone else wrote in C# WFP. the problem is two things:

1) when I try to run the program in debug mode it says this :

A project with 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.

now the guy wrote this code is gone, so I cant talk to him, but I was told the project was done and that is it running on some computers.

also when I try and Publish it, it makes an .WPF file and the files done not run. on my computer it install but when I run it it does not do anything. nothing opens up. On Another computer is says the program has to close.

so I really do not know what to do.

or how to troubleshoot this.

any ideas ?

oh the project solution has a .Core, .Data and . WPF project files in it

BBoone
  • 51
  • 8
  • The error is specific. Did you do what its message suggests? – Aluan Haddad Feb 15 '18 at 15:21
  • 3
    More to the point, what have you done to look through the code to find your problem? The message is telling you it's a library project, not an executable. – CDove Feb 15 '18 at 15:22
  • 1
    I had to guess, what your other project files look like, but maybe there is a bootstrapper or something else. At the current point I can only suggest to rightclick on your other projects within the solution explorer and click on __Set as StartUp Project__ try start your application and if it fails take another one. The current StartUp Project is the bold one in your solution explorer – Martin Backasch Feb 15 '18 at 15:31
  • 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:17

1 Answers1

1

I imagine the .Core and .Data projects are indeed Class Libraries as the error suggests - which cannot be run directly (they are code designed to just be used by other programs).

So you probably need to right click the .WPF project - and select Set as Start Up Project, then you should be able to run it.

Milney
  • 6,253
  • 2
  • 19
  • 33