I’m using C#.net 4.0 with Visual Studio 2010. I am getting the error
Error 10 The type or namespace name ‘IRange’ could not be found (are
you missing a using directive or an assembly
reference?) C:\git\emtexporter\EMTExporter.IRepository\IRangeRepository.cs 11 27 EMTExporter.IRepository
IRange is an interface in the project EMTExporter.IEntities and the project IEntities builds successfully. IRange.cs has the code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Wiggle.EMTExporter.IEntities;
namespace Wiggle.CategoryXMLExporter.IEntities
{
interface IRange
{
long ID { get; }
Dictionary<ILanguage, string> rangeNames { get; set; }
}
}
The problem occurs in IRangeRepository.cs which has the code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Wiggle.EMTExporter.IEntities;
namespace CategoryXMLExporter.IRepository
{
interface IRangeRepository
{
Dictionary<string,IList<IRange>> getAllRanges();
}
}
I am referencing EMTExporter.IEntities in the IRepository project.
I have no idea what could be going wrong!
edit: the issue was that the project was changed from CategoryXMLExporter to EMTExporter, but I hadn’t updated the Assembly name and Default namespace of the project. Updated that, made the interface public and now it works!
Your interface is not public try the following