I have an interface in a DLL and am implementing it in a Console App for Testing
My Interface is as Follows
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Gemini.Data.Interfaces
{
public interface IUser
{
IEnumerable<IUserDetails> UserProfiles { get; set; }
string AdUserName { get; set; }
}
public interface IUserDetails
{
int UserId { get; set; }
string DisplayUserName { get; set; }
string OfficeCode { get; set; }
string UserEmail { get; set; }
string AdLogin { get; set; }
bool? LastActiveUser { get; set; }
Gemini.Data.App_Consts.Access_Rights UserAccess { get; set; }
bool IsPM { get; set; }
bool IsSPM { get; set; }
bool IsVdbUser { get; set; }
DateTime? LastModified { get; set; }
DateTime? LastLoginUse { get; set; }
int? LastModifiedBy { get; set; }
}
}
and when I try to use it in the Testing App I get the following
The type or namespace name ‘IUser’ does not exist in the namespace ‘Gemini.Data.Interfaces’ (are you missing an assembly reference?)
the Console App is as Follows
using System;
using System.Collections.Generic;
using Gemini.Data.Interfaces;
namespace ConsoleApplication2
{
public class User : Gemini.Data.Interfaces.IUser
{
private IEnumerable<IUserDetails> _UserProfiles = null;
#region IUser Members
public IEnumerable<IUserDetails> UserProfiles
{
get { return _UserProfiles; }
set { _UserProfiles = value; }
}
public string AdUserName { get; set; }
#endregion
}
class Program
{
static void Main(string[] args)
{
User u = new User();
Gemini.Data.Main.UserDetails ud = new Gemini.Data.Main.UserDetails(u, "Qpirate");
}
}
}
Visual Studio seems to reference the Interfaces and I can call Go To Definition on the Classes.
Anyone know of something else I can try?
I have already checked that the console app its targeting the same .NET Framework as the DLL.
I eventually just deleted the old Solution and started again, but one thing i did notice was that when i created a console app the Target Framework was “.NET Framework Client Profile”