[英]How do I create .NET framework 4.6 version of XUnit project in Visual Studio 2019?
I notice when I start up Visual Studio 2019, I am unable to create a .NET Framework version of XUnit or NUnit (only MSTests).我注意到当我启动 Visual Studio 2019 时,我无法创建 XUnit 或 NUnit(仅限 MSTest)的 .NET Framework 版本。 We have been mandated to use XUnit tests, but our solution is all .NET Framework.我们被要求使用 XUnit 测试,但我们的解决方案全是 .NET Framework。 Some of the nuget packages are dependent on being .NET Framework (for Sitecore 8.2) and thus I can't add them to a .NET Core project.一些 nuget 包依赖于 .NET Framework(对于 Sitecore 8.2),因此我无法将它们添加到 .NET Core 项目中。 I cannot upgrade any of the legacy project to .NET Core or to Sitecore 9+ at this time.我目前无法将任何旧项目升级到 .NET Core 或 Sitecore 9+。
How do I add in a .NET Framework XUnit project?如何添加 .NET Framework XUnit 项目? Is there something wrong with my Visual Studio setup?我的 Visual Studio 设置有问题吗? Is it not supported?不支持吗? I have been unable to find documentation from Microsoft about this.我一直无法从 Microsoft 找到有关此的文档。 Thanks.谢谢。
First use the xUnit Test Project (.NET Core)
project template.首先使用xUnit Test Project (.NET Core)
项目模板。
Then go edit the .csproj file and change <TargetFramework>netcoreapp2.2</TargetFramework>
to <TargetFramework>net462</TargetFramework>
.然后编辑 .csproj 文件并将<TargetFramework>netcoreapp2.2</TargetFramework>
更改为<TargetFramework>net462</TargetFramework>
。
That's it.就是这样。 :) :)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.