473,480 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

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
3 7570
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

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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3980
by: Jean Stax | last post by:
Hi ! I created a sample library project. In my second project I reference this library and make the following call, which returns "undefined value": Type myType =...
1
10383
by: Omatase | last post by:
Here is my code: CDO.Message iMessage = new CDO.MessageClass(); string sFrom; string sDate; iMessage.DataSource.Open(bstrURLItem,null, ADODB.ConnectModeEnum.adModeRead,...
7
7792
by: Sky | last post by:
I have been looking for a more powerful version of GetType(string) that will find the Type no matter what, and will work even if only supplied "{TypeName}", not the full "{TypeName},{AssemblyName}"...
7
23110
by: Alan T | last post by:
I have create a class library and add it to the reference list in one of the projects. However, when I compile the project and got the error: Assembly generation failed -- Referenced assembly...
3
2703
by: Vance | last post by:
I'm sure I'm missing something obvious, but in my web application I have added a couple of C# files containing classes I want to use in Default.aspx.cs (default.aspx's C# code beside file). ...
0
1215
by: ardas111 | last post by:
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...
2
3883
by: =?Utf-8?B?TWluaS1Ub29scyBUaW1t?= | last post by:
I have an odd web services problem. I have a shared assembly (shared.dll) that is referenced both by a C# WinForms client (client.exe) and a C# Web Service (service.dll). When I upload the web...
7
2360
by: Robert | last post by:
Thanks George, I really am grateful for attempts to be helpful, but this really doesn't answer the question in my OP. What I am looking for is an explanation of WHY things are this way (I was...
8
3255
by: Martin Eckart | last post by:
Hi folks, Who can explain me why the following expression does not result in getting the correct type, but null: Type t = Type.GetType("System.Xml.XmlReader"); For "System.String" it works...
0
7033
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6903
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7027
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7071
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
6861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4763
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
2974
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1291
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
170
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.