E
E
Ernst Krause2020-01-17 13:18:20
C++ / C#
Ernst Krause, 2020-01-17 13:18:20

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);
        }
    }
}

After I add a link to this library to the new project through REFERENCES.
5e21890352b0d377276199.png
And I'm trying to connect it. VS does not see this library.
5e21898f8daac828526929.png
THE MAIN ESSENCE OF THE QUESTION: What am I doing wrong, that my project does not SEE this library?!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Pavlov, 2020-01-17
@bivenloheban

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.

R
Roman, 2020-01-17
@yarosroman

This is not a project that does not see, but Intellisence in the studio, for starters, clean up and rebuild the project. Second, if it didn't help https://stackoverflow.com/questions/4830397/how-to...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question