-1

see the attached image

I created class library, created Web Application project, then add reference to the class library in the Web Application project as explained here, but can't add "using" for it. (the namespace of customer.cs is also "CDemoLib") (when i added "using CDemoLib;" i got 'cannot resolve symbol CDemoLib'

the code of customer.cs is

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CDemoLib
{
 public class Customer
 {
    private int _age;
    private string _name;

    public Customer()
    {
        Age = 0;
        Name = "Not available";
    }

    public int Age
    {
        get { return _age; }
        set { _age = value; }
    }
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }
  }
}

reference expanded

arielorvits
  • 5,235
  • 8
  • 36
  • 61

2 Answers2

5

Well, using doesn't add references to the assembly, but to namespaces declared in the assembly. The namespaces declared in the assembly may be very different from the assembly file name.

Double click the reference in the solution explorer (the right arrow in your screen shot) to open the "Object Catalog". You will be able to see the namespaces there.

Thorsten Dittmar
  • 55,956
  • 8
  • 91
  • 139
0

As @Jon Skeet offer - it look like a Resharper issue. it can compiled, and if i suspend Resharper it fixed...

u can download new resharper to fix this

arielorvits
  • 5,235
  • 8
  • 36
  • 61