6

Trying to move from .Net4.5 to .Net5, so i have created my solution, which consists of folders called "Solution Items" and "src".

I have managed to get 3 projects building using .NET 5. I had to create the projects as "Class Library (Package) - PREVIEW - A project template for creating a class library as a NuGet package that can target any platform"

Now i want to put my unit test projects into my solution. I believe that i have to use XUnit now, which has different attributes for tests.

But if i create a "Unit Test Project", i cant reference my new .net5 projects.

Can someone point me in the right direction please.

VMAtm
  • 27,943
  • 17
  • 79
  • 125
Gillardo
  • 9,518
  • 18
  • 73
  • 141

1 Answers1

0
  1. Install SideWaffle Template Pack as .
  2. File -> New Project -> Web -> xUnit Test Project.
  3. Add your web project to the project.json file.
  4. Profit!!!

See full details here from Sayed-Ibrahim-Hashimi (Microsoft).

Muhammad Rehan Saeed
  • 35,627
  • 39
  • 202
  • 311
  • 2
    Thanks, that seems to work for creating a unit test project for my website, but what about for each of my other projects, that are not website projects, but use .net5? it doesnt seem to work for these (sorry, probably simple thing i am missing) – Gillardo Oct 09 '15 at 09:25
  • .net5? Do you mean .NET 4.5? Is this in your project.json file? In that case, you should be using dnx45. – Muhammad Rehan Saeed Oct 09 '15 at 09:31
  • 2
    Yeah i have got net5 in some projects. This should be dnx45 instead your saying? That could explain why nothing wants to reference anything else. I am using EntityFramework as well, at net5 was the only way to get the project to build.... – Gillardo Oct 09 '15 at 09:33
  • See [this](http://stackoverflow.com/questions/31539341/project-json-definition-dnx451-vs-dotnet-4-51) answer. If it is not an ASP.NET 5 project, you can use net45. – Muhammad Rehan Saeed Oct 09 '15 at 09:39