By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,333 Members | 1,850 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,333 IT Pros & Developers. It's quick & easy.

The type 'frm_data.frm_data' is defined in an assembly that is not referenced. You must add a reference to assembly

P: n/a
Language :: VS.NET/ C#
The type 'frm_data.frm_data' is defined in an assembly that is not
referenced. You must add a reference to assembly

I have a Frm_sol solution, which consists on 2 projects
FRM_Business and frm_Data.

I build the 2 projects and copied the dlls created from them, to
another Solution having a Sample_website, sample_business and
Sample_Data.

So now
Sample_bl is having reference of Sample_dl project
and in
Sample_dl project i added a reference for frm_data.dll and made a
function call to a method of frm_data.dll from inside a method of
sample_dl. It works.

But, as soon as i try to inherit from a class in frm_data.dll to
sample_bl projects class. it builds.
But, Sample_bl on build gives an error ::

Error 1 The type 'frm_data.frm_data' is defined in an assembly that
is not referenced. You must add a reference to assembly 'framework_dl,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=72fb7114fd4e6ef7'. C:
\Temp\Test_Project\Sample\Sample_bl\components\Sam plecomponent_bl.cs
16 13 Sample_bl

Please help. Basically i want to create dll's for the layered
projects and want to use in another layered application.

thanks

Sep 30 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi ma79ash,

your text is a little bit confusing
I guess you have a class in sample_dl wich inherits from a class frm_data in
assembly frm_data.
This inheriting class is referenced in sample_bl. For this to work in C# the
sample_bl has also to reference frm_data. This is, because the public
members of the base class are also public members of the inheriting class.
So the compiler has to know the base-class when referencing the derived
class.

In your case I would recommend to redesign your layer-concept, so that the
public classes of the business layer do not derive from the classes of the
data layer but encapsulate them

Christof

Oct 1 '07 #2

P: n/a

Hi Chris ,
Let me rephrase my question one more time.

I have ParentBusiness.dll , BusinessData.dll contains class
BaseBusiness.cs and ParentData.dll. contains class BaseData.cs I
created new Solutions , And with ChildBusinss and ChildData Layer .
Child Business contains reference of ParentBusiness.dll, and Child
Data layer contains reference of ParentDataLayer .

ChildData contains a Class which is inhereted from BaseData.cs
(ParentData.dll) . In this case , data Layer is building
successfully , But when i try to call a Method of Child Data class
from ChildBusiness , it thorw compilcation error as

"The type ParentData.basedata' is defined in an assembly that is not
referenced. You must add a reference to assembly"
error CS0012: The type ParentData.BaseDatai s defined in an assembly
that is not referenced. You must add a reference to assembly
'ParentData.dll, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=null'.

Hope so this will help to understand the problem

Thanks in Advance
On Oct 1, 7:46 am, "Christof Nordiek" <c...@nospam.dewrote:
Hima79ash,

your text is a little bit confusing
I guess you have a class in sample_dl wich inherits from a class frm_data in
assembly frm_data.
This inheriting class is referenced in sample_bl. For this to work in C# the
sample_bl has also to reference frm_data. This is, because the public
members of the base class are also public members of the inheriting class.
So the compiler has to know the base-class when referencing the derived
class.

In your case I would recommend to redesign your layer-concept, so that the
public classes of the business layer do not derive from the classes of the
data layer but encapsulate them

Christof

Oct 1 '07 #3

P: n/a
Hi ma,

<ma*****@gmail.comschrieb im Newsbeitrag
news:11**********************@57g2000hsv.googlegro ups.com...
>
Hi Chris ,
Let me rephrase my question one more time.

I have ParentBusiness.dll , BusinessData.dll contains class
BaseBusiness.cs and ParentData.dll. contains class BaseData.cs I
created new Solutions , And with ChildBusinss and ChildData Layer .
Child Business contains reference of ParentBusiness.dll, and Child
Data layer contains reference of ParentDataLayer .
So far so good.
ChildData contains a Class which is inhereted from BaseData.cs
(ParentData.dll) . In this case , data Layer is building
successfully , But when i try to call a Method of Child Data class
from ChildBusiness , it thorw compilcation error as
Let's call the deriving classes DerivedData and DerivedBusiness
respectively.

Since the project ChildBusiness references DerivedData wich derives from
BaseData the project has to refernce project ParentData also.
This is, because the compiler wants to inspect class BaseData for members
ChildData inherits from BaseData aswell as maybe other base classes of
BaseDate.
"The type ParentData.basedata' is defined in an assembly that is not
referenced. You must add a reference to assembly"
error CS0012: The type ParentData.BaseDatai s defined in an assembly
that is not referenced. You must add a reference to assembly
'ParentData.dll, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=null'.
As it says, you must add a reference to ParentData.dll. Any problem doing
so? The BusinessLayer of the second solution would reference both DataLayer
assemblies. I'd say, that is a reasonable design.
>
Hope so this will help to understand the problem

Thanks in Advance
On Oct 1, 7:46 am, "Christof Nordiek" <c...@nospam.dewrote:
>Hima79ash,

your text is a little bit confusing
I guess you have a class in sample_dl wich inherits from a class frm_data
in
assembly frm_data.
This inheriting class is referenced in sample_bl. For this to work in C#
the
sample_bl has also to reference frm_data. This is, because the public
members of the base class are also public members of the inheriting
class.
So the compiler has to know the base-class when referencing the derived
class.

In your case I would recommend to redesign your layer-concept, so that
the
public classes of the business layer do not derive from the classes of
the
data layer but encapsulate them

Christof

Oct 4 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.