473,382 Members | 1,665 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Compiling to EXE succeeds but not to DLL


I have two classes, A and B, both in the same namespace. If I compile
files to a DLL, the A class does not compile. The error message is

"[C# Error] BaseObject.cs(69): The type or namespace name 'Logger' could
not be found (are you missing a using directive or an assembly reference?)"

Note: there *is* using clause.

If I compile both as part of the same EXE there is no problem. The code
is the same!
Class A:
==========
using COM.ISADGBase.Objects;

namespace COM.ISADGBase.Objects
{
public abstract class BaseObject : IDescLevel {
//THE NEXT LINE DOES NOT COMPILE:
protected internal Logger log;
}
}

Class B;
==========
using COM.ISADGBase.Objects;

namespace COM.ISADGBase.Objects
{
public class Logger
{
}
}

With best regards
Terentius
Nov 17 '05 #1
2 1377
Terentius Neo <te***********@here.fi> wrote in
news:YK**************@read3.inet.fi:

I have two classes, A and B, both in the same namespace. If I
compile files to a DLL, the A class does not compile. The error
message is

"[C# Error] BaseObject.cs(69): The type or namespace name
'Logger' could not be found (are you missing a using directive
or an assembly reference?)"

Note: there *is* using clause.

If I compile both as part of the same EXE there is no problem.
The code is the same!


Terentius,

A using clause is not the same as an assembly reference. If you are
compiling from the command line, you need to add an assembly
reference for the assembly that contains the Logger class:

csc /t:library /r:Logger.dll BaseObject.cs

If you are using Visual Studio, expand the References node for the
project in the Solution Explorer and add a reference to Logger's
assembly.

--
Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
Nov 17 '05 #2
Terentius Neo <te***********@here.fi> wrote in
news:YK**************@read3.inet.fi:

I have two classes, A and B, both in the same namespace. If I
compile files to a DLL, the A class does not compile. The error
message is

"[C# Error] BaseObject.cs(69): The type or namespace name
'Logger' could not be found (are you missing a using directive
or an assembly reference?)"

Note: there *is* using clause.

If I compile both as part of the same EXE there is no problem.
The code is the same!


Terentius,

A using clause is not the same as an assembly reference. If you are
compiling from the command line, you need to add an assembly
reference for the assembly that contains the Logger class:

csc /t:library /r:Logger.dll BaseObject.cs

If you are using Visual Studio, expand the References node for the
project in the Solution Explorer and add a reference to Logger's
assembly.

--
Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Martin Bless | last post by:
I need to access a MSSQL database (MS-Sql, not MySQL!)and would very much like to use mssql-0.09.tar.gz which is available from http://www.object-craft.com.au/projects/mssql/download.html ...
3
by: modemer | last post by:
Hello, I got weird compiling message similar like following when I compiled my simple code on Sun 5.8 with CC WorkShop 6 update 2 C++ 5.3. CC -g -o myclass.o -c myclass.cpp CC -g -o main.o...
6
by: Rolf Schroedter | last post by:
(Sorry for cross-posting). I need to access large files > 2GByte (Linux, WinXP/NTFS) using the standard C-library calls. Till today I thought I know how to do it, namely for Win32: Use open(),...
4
by: Aaron Queenan | last post by:
When I build a C++ library to .NET using the managed C++ compiler, I get the following error message: Linking... LINK : error LNK2020: unresolved token (0A000005) _CrtDbgReport LINK : error...
2
by: Rudy Ray Moore | last post by:
Hi guys, I just upgraded to "Visual Studio .net 2003 7.1 c++" from VS6. Some things I like (proper for loop variable scoping, for example), but some other things are troubling me. One...
10
by: Christina N | last post by:
When compiling my ASP.Net application, VS puts the new DLL under the local cached directory 'VSWebCache' in stead of on the server. How can I make it save the DLL file on the server when compiling?...
2
by: yvan | last post by:
Hi, Here is my client/server scenario: Step1: Client connects to server and sends data sucessfully (using Socket.Send()). Step2: Server gracefully exists (calls Socket.Shutdown() and...
0
by: rajpatel50 | last post by:
Hi all, I’m seeing some strange behaviour when using an Unmanaged OLEDB Microsoft driver (v5.0.0.919 as supplied with Host Integration Server) to access DB2 on an iSeries (V5R3) via C# code ...
0
by: =?Utf-8?B?amVmZmVyeQ==?= | last post by:
i need help compiling code dynamically it may involve some reflection so if any one is any good in that field or compiling code this would be a great time to show me what you know. by the way my...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.