Answer the question
In order to leave comments, you need to log in
Why can't the Visual Studio C# project see the DLL?
Here is the code for my DLL library:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MyLibrary
{
struct Birthday
{
private int year, month, day;
public Birthday(int day, int month, int year)
{
this.day = day;
this.month = month;
this.year = year;
}
public void Show()
{
Console.WriteLine("\n{0}.{1}.{2}", day, month, year);
}
}
struct Person
{
public string firstname, lastname, middlename;
public Person(string fn, string ln, string mn)
{
this.firstname = fn;
this.lastname = ln;
this.middlename = mn;
}
}
class PersonComparer : IComparer<Person>
{
public int Compare(Person x, Person y)
{
var ret = string.CompareOrdinal(x.lastname, y.lastname);
if (ret != 0) return ret;
var ret1 = string.CompareOrdinal(x.firstname, y.firstname);
if (ret1 != 0) return ret1;
return string.CompareOrdinal(x.middlename, y.middlename);
}
}
}
Answer the question
In order to leave comments, you need to log in
I can only assume that the studio does not see the namespace, because it has no public classes.
Try marking the class you are going to use as public.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question