Pixie
Pixie

Reputation: 67

Whats the difference between installing a package via NuGet packages and the 'extentions and updates' option from the 'Tools' menu in vs2015?

I have created a project using specflow, so I have a new feature file saved as a class library project, when I try and run the project I get the error: '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'

I think it's an error with the way I have added the n-unit and specflow references to the project. I have noticed I could install specflow via NuGet packages or extensions and updates. So what the difference between adding packages in these two ways?

Upvotes: 1

Views: 614

Answers (1)

Sam Holder
Sam Holder

Reputation: 32936

They are two different things.

the Specflow extension extends the visual studio ide to support specflow. Specifically:

  • it adds syntax highlighting support for gherkin syntax
  • it allows the tests to be generated from .feature files
  • it adds the file templates to the file types so you can add new feature files/step bindings
  • it adds the additional context menu options to allow steps to be generated and the navigation between steps in the feature file and steps in the code.
  • it allows integration with the visual studio unit test windows

and probably a few more things that I've neglected to mention. Without this writing specflow tests in visual studio would be more difficult and the generation of the unit test cases themselves would be not be done.

the nuget package allows an individual project to use specflow. This adds the necessary references to the project so that you can consume the types which specflow uses. without these being referenced the projects which try and use specflow would not compile.

As for your issue, this is not related to specflow in any way. A project which builds a dll cannot be started, it needs something to be hosted in in order to be used any project which is a library will give this error if you set it as the startup project regardless of if you use specflow or not.

Upvotes: 3

Related Questions