我是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.Template
到dotnet.exe
,再到Microsoft.EntityFrameworkCore.Tools 2.0.1
。你知道下一步该怎么做吗?
https://stackoverflow.com/questions/48052285
复制相似问题