0

I have a Visual Studio Mac solution solution with 2 projects - a NUnit test project and a .net standard library. I am getting compile-time errors in my test project referencing members from the .net standard library project. I've added a project reference to the library project from my test project.

The library project compiles without errors and the library classes show up in the dot autocomplete when I type in the test project - it only seems to throw an error at compile-time on the test project.

Am I misunderstanding what a .net standard library project is? I'm a bit confused about compatibility with target frameworks - the NUnit project is targeting .net framework 4.6.1 and the library is targeting .netStandard 1.4

using NUnit.Framework;
using System;

namespace MyLibNameSpace.Test
{
    [TestFixture()]
    public class Tickets
    {
        [Test()]
        public async void ShouldGetTickets()
        {
            //error here below at compile time
            MyLibNameSpace.FreshDeskService svc = new MyLibNameSpace.FreshDeskService(); 
            var tickets = await svc.GetTicketsAsync();
            Assert.GreaterOrEqual(tickets.Count, 1);
        }
    }
}
Lex Li
  • 60,503
  • 9
  • 116
  • 147
MonkeyBonkey
  • 46,433
  • 78
  • 254
  • 460
  • On Mac, your NUnit project is powered by Mono, which requires you to add necessary NETStandard.Library package reference. – Lex Li Jun 16 '17 at 13:35
  • " I am getting compile-time errors" - what *exactly* are the errors? What does the project look like? How are you building? – Jon Skeet Jun 16 '17 at 13:38
  • The error is "type does not exist in the namespace" at the commented line. It's 2 projects in one solution. One library project and one Test(NUnit) test project. Test project has one test file as shown above, library file is a vanilla project with one poco class and a simple FreshDesk class. Seems to be an issue with the target frameworks. – MonkeyBonkey Jun 16 '17 at 14:40

0 Answers0