Resolved xUnit .net framework project missing VS2019

AlexJames

Well-known member
Joined
Mar 20, 2020
Messages
65
Programming Experience
10+
Hi All

i'm trying to add a xUnit test project to my app so that i can run and learn unit tests. When i go to add a project, i only have the (xUnit .NET CORE) , i'm completely missing the (xUnit .net framework) project. I've tried the add and remove features in VS and have run all the updates but still the .net framework version is missing. Any ideas on what else i can try ?

many thanks
AJ.
 
It would have to exist for it to be missing. There is no such project template, which is why you don't see one. You can add project templates yourself though, that you or a third-party created. This looks like something you could use:

 
Hi JM

Thank you for your reply, I had no idea that there wasn't a xUnit .NET framework project by default in VS. It seems to be one of the most popular unit testing projects and I wrongfully assumed that there would be one for the .net frameowork. Thank you for the extension link, i'll give that a bash.
 
You've been able to use xUnit for a long time but there hasn't been a dedicated project template for long. Given that Microsoft are really pushing .NET Core for new development, whoever create the xUnit .NET Core project template probably thought that it wasn't really worth creating a .NET Framework template too.
 
Thanks JM

So without using an extension like the one you shared, and if there's no project template for the .net framework, how are devs using it these days if they dont have a .NET CORE app ? could you create a new class library project and then add the Nuget package for xUnit ? would that work in a similar way ?
 
Back
Top Bottom