Problem when initiating visual studio solution

Asked

Viewed 2,989 times

0

Problema VisualStudio

I want to open this solution but I can’t, someone could help me solve this mistake?

  • how so "Open"? you want to run it?

  • yes, I want to run it, debug it

  • the problem is exactly what is in the message "Unable to start a class library output type directly". You do not directly run a class project, it has to be something "executable" like a Console Application, Windows Form Application or Web Application for example, and this yes to "call" the class library

3 answers

1

From what I’m seeing your project is testing, testing projects are not debugged in the "traditional way".

I don’t know if there are any other options, but the one I know is Test Explorer, to open it, search "test explorer" in visual studio search box inserir a descrição da imagem aqui

After that, it will open a window (usually on the left side), Cases tests do not display, recompile the project.

inserir a descrição da imagem aqui

I also noticed that you’re using the Nunit. It may be necessary to install the Adapter of it so that the tests appear.

inserir a descrição da imagem aqui

0

Go to the "Project"->"'Project-name' property" menu. In swap output type to "Console Application"

0

The class library is like a book, in your case the following is happening: Book is trying to read the Human and not the Human read the book. Got it?

The Human would be the . EXE and the Book would be the Class Library

As you have created a Class Library solution, then in this solution you will only have Class Library. If you create projects . EXE within this solution, will give errors because the solution is like a shelf full of projects(books) that was created for the purpose of just storing books and never be started.

To solve the problem, try to create a solution that has a starting point like (windows form, wpf, console application, ...), then you can create several libraries with a starting point already configured automatically to read the (library).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.