简体   繁体   English

通过NuGet软件包安装软件包与vs2015中“工具”菜单中的“扩展和更新”选项有什么区别?

[英]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. 我已经使用specflow创建了一个项目,因此我将一个新的功能文件另存为类库项目,当我尝试运行该项目时,出现错误:'无法直接启动具有类库输出类型的项目。 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. 我认为将n单位和specflow引用添加到项目的方式存在错误。 I have noticed I could install specflow via NuGet packages or extensions and updates. 我注意到我可以通过NuGet软件包或扩展和更新来安装specflow。 So what the difference between adding packages in these two ways? 那么用这两种方式添加软件包之间有什么区别?

They are two different things. 他们是两个不同的东西。

the Specflow extension extends the visual studio ide to support specflow. Specflow扩展扩展了Visual Studio的思想以支持Specflow。 Specifically: 特别:

  • it adds syntax highlighting support for gherkin syntax 它增加了对小黄瓜语法的语法高亮支持
  • it allows the tests to be generated from .feature files 它允许从.feature文件生成测试
  • 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 它允许与Visual Studio单元测试窗口集成

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. 没有这些编写,Visual Studio中的Specflow测试将更加困难,并且单元测试用例本身的生成将无法完成。

the nuget package allows an individual project to use specflow. nuget包允许单个项目使用specflow。 This adds the necessary references to the project so that you can consume the types which specflow uses. 这将向项目添加必要的引用,以便您可以使用specflow使用的类型。 without these being referenced the projects which try and use specflow would not compile. 没有引用这些,尝试使用specflow的项目将无法编译。

As for your issue, this is not related to specflow in any way. 至于您的问题,这与specflow毫无关系。 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. 构建dll的项目无法启动,需要托管一些东西才能使用该库,如果您将其设置为启动项目,则无论是否使用specflow,该库中的任何项目都会出现此错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM