Project Reference not working

  • Thread starter Thread starter Hitesh Khatri
  • Start date Start date
H

Hitesh Khatri

Hi All,
I have web application project, to which I have added
project-reference to another class library.

When I am using one of the property from that class. I am
getting following error.

'Public Overridable Overloads Property PropName() As
Project1.PropName' is declared in project 'Project1.dll',
which is not referenced by project 'WebProject.dll'.

I don't want to add direct reference to the dll file, I
want to use project reference. I also tried using Import
statement in my module but It didn't help too.

Please suggest a solution.

Regards,
Hitesh
 
Hi,

If 'Project1.dll' is the class library assembly you must make reference
to it, otherwise .Net don’t know which assembly lo load.

If 'Project1.dll' isn’t the class library but it assembly that the class
library used then check if the property that you call return ant type
declare in the 'Project1.dll' assembly. If so you also must make
reference to it.

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
 
Hi,
Thanks for responding to my question.

I am having one Web Project (VB.NET-WebProject.dll) and
one Class Library Project (VB.NET-Project1.dll) in my
Solution. In the Web Project, I have added 'Project
Reference' to the Class Library Project. The reference
property is also showing the correct path for the dll
(based on build config). Why .NET cannot load assembly
from that path.

You are suggesting that I must add direct reference to
Project1.dll and not 'Project Reference'. What is the use
of project reference?

I have different build config (Debug, Release etc.) setup
for my project. In case I add direct reference to the
dll, do I have to keep changing it when I switch the
build config? or should I just add reference to the dll in
the bin folder?

Thanks in advance for your help.
Regard,
Hitesh
 
Hi,
You are suggesting that I must add direct reference to Project1.dll and
not
'Project Reference'. What is the use of project reference?

No, What I meant is project reference. Any way if you reference the DLL
but ASP.NET not seems to load it check if the Copy Local property of the
reference set to true. If not set it to true. This will end up with a
copy version of the DLL in the Bin directory of your web application.

.Net looks for reference assembly in GAC and if the assembly not found
in the GAC in the Bin directory of the loading application. If the
assembly not found in those locations the CLR raise error.


Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
 
Back
Top