So I have a .NET Core 3.1
project. I am trying to create a unit testing project to go along with it. I have created a .NET Standard 2.1 Class Library
for this purpose. I'm then trying to add a reference to the main project, in order to be able to reference code from there. This isn't working, as I get the following compilation errors:
'..\MyProj\MyProj.csproj' targets 'netcoreapp3.1'. It cannot be referenced by a project that targets '.NETStandard,Version=v2.1'. Project MyProj is not compatible with netstandard2.1 (.NETStandard,Version=v2.1). Project MyProj supports: netcoreapp3.1 (.NETCoreApp,Version=v3.1) Test (test\Test)
So this does make sense to me, as I understand why .NET Core
wouldn't be able to reference a .NET Standard
project.
But then how can I create a Unit Testing project? Is it possible to create a .NET Core 3.1 Class Library
? From everything I have read, it seems like that doesn't exist.
How can I set up a unit test project that references the main project?