首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >让NUnit在Visual Studio社区2017下工作

让NUnit在Visual Studio社区2017下工作
EN

Stack Overflow用户
提问于 2018-01-02 02:42:43
回答 1查看 817关注 0票数 1

我是NUnit的新手,正试图在Visual Studio Community 2017下开始使用它;我在启动和运行它时遇到了很大的困难。

NUnit的实际安装进行得很顺利。我按照NUnit维基上的Installation page中的步骤(选项1)添加了NUnit和NUnit.console,现在已经在解决方案中添加了这些(以及NUnit.ConsoleRunner和一些NUnit.Extension.*扩展)。

NUnit维基的.NET Core and .NET Standard page说下一步是安装NUnit模板,这就是我被卡住的地方。它显示“运行dotnet new -i NUnit3.DotNetNew.Template以安装NUnit模板”。我的系统上似乎没有dotnet.exe。看看Where is the dotnet command executable located on Windows?,它看起来像是安装Microsoft.EntityFrameworkCore.Tools的方法,这让我找到了https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.Tools/。在此基础上,我从Package Manager控制台尝试了Install-Package Microsoft.EntityFrameworkCore.Tools -Version 2.0.1;但这给出了错误:

PM> Install-Package Microsoft.EntityFrameworkCore.Tools -Version 2.0.1

Install-Package : Could not install package
'Microsoft.EntityFrameworkCore.Tools 2.0.1'. You are trying to install this
package into a project that targets '.NETFramework,Version=v4.5', but the
package does not contain any assembly references or content files that are
compatible with that framework. For more information, contact the package
author.

所以我在这里真的陷入了困境,从NUnit3.DotNetNew.Templatedotnet.exe,再到Microsoft.EntityFrameworkCore.Tools 2.0.1。你知道下一步该怎么做吗?

EN

回答 1

Stack Overflow用户

发布于 2018-12-13 04:09:39

如果这对某些人有任何帮助:在Visual Studio Community 2017中,您可以从主菜单中安装"NUnit VS Template“,如下所示:

  1. 转到:工具>扩展和更新> Online
  2. Searh for‘nunit’
  3. 单击所需的nunit软件包,然后在侧面板上安装。
  4. 您可能需要关闭并重新打开VS 2017

<代码>G29

希望能有所帮助

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48052285

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档