Does system.dll need to be copied to the app bin directory?

W

Wysiwyg

I am using MS Visual Studio 2002 with Windows 2000 Advanced Server and am
starting to learn C#. Perhaps this is obvious but I can't see if what's
happening is "normal" or if something needs to be set differently. I have
implemented System.Configuration.NameValueSectionHandler which is found in
System.dll. The problem I have is this only work if I either manually copy
System.dll to the application's bin directory or set the System reference
"copy local" property to TRUE which does the same thing. It doesn't seem
reasonable for a file which much exist on every web server running the app
to need to be copied to the app's bin directory.

Is the referenced System.dll supposed to be automatically copied to the
C:\winnt\microsoft.net\framework\v1.0.xxxx\Temporary ASP.NET Files\...
directory at some point or is it supposed to be in a path? I would think
such a path would include the .NET framework directory where System.dll
resides but it only includes the Temporary directory and the application's
bin directory currently. I actually added the dot-net directory to the
system PATH but that made no difference. Is there another environment
variable I need to set?

Any information is appreciated.

Thanks.
 
N

Nicholas Paldino [.NET/C# MVP]

Wysiwyg,

The behavior you are seeing is not normal. System.dll should be in the
GAC, and if it is not found locally, then fusion (the assembly loader),
should pick it up from the GAC.

Have you tried running the Fusion Log Viewer to see how System.dll is
loaded?

Hope this helps.
 
W

Wysiwyg

Thanks for the quick reply.

The System resource is in the Global Assembly Cache. Could this have to do
with my using Visual Studio 2002 which references System.dll in the dot net
1.0.3705 directory while I have the Microsoft.net framework 1.1 installed? I
uninstalled both Visual Studio and the dot net framework but that didn't
change anything. I see both 1.0.3300.0 and 1.0.5000.0 versions of System in
my GAC from both the original framework and the 1.1 update. VS installed the
original (3300) framework even with 1.1 already installed. I can always try
working using the original framework without the dot net 1.1 update and see
if that matters. I don't have the dot net SDK but I'll load that so I can
look at the Fusion logs. Thanks again!

Bill

Nicholas Paldino said:
Wysiwyg,

The behavior you are seeing is not normal. System.dll should be in the
GAC, and if it is not found locally, then fusion (the assembly loader),
should pick it up from the GAC.

Have you tried running the Fusion Log Viewer to see how System.dll is
loaded?

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Wysiwyg said:
I am using MS Visual Studio 2002 with Windows 2000 Advanced Server and am
starting to learn C#. Perhaps this is obvious but I can't see if what's
happening is "normal" or if something needs to be set differently. I have
implemented System.Configuration.NameValueSectionHandler which is found in
System.dll. The problem I have is this only work if I either manually copy
System.dll to the application's bin directory or set the System reference
"copy local" property to TRUE which does the same thing. It doesn't seem
reasonable for a file which much exist on every web server running the app
to need to be copied to the app's bin directory.

Is the referenced System.dll supposed to be automatically copied to the
C:\winnt\microsoft.net\framework\v1.0.xxxx\Temporary ASP.NET Files\...
directory at some point or is it supposed to be in a path? I would think
such a path would include the .NET framework directory where System.dll
resides but it only includes the Temporary directory and the application's
bin directory currently. I actually added the dot-net directory to the
system PATH but that made no difference. Is there another environment
variable I need to set?

Any information is appreciated.

Thanks.
 
W

Wysiwyg

Well, here's the deal...

The Sybex book I'm using is C# Complete and it was apparently written before
the framework 1.1 was released. None of the .config file examples in the
book have a version. The System.dll existed in two GAC entries with two
different versions and the Fusion log just showed a partial assembly name
for System with no version and it wasn't found. So, I just added the version
information to the machine.config entry for my section entry and it was
found. I assume prior to framework 1.1 it would work without the version and
that the book (c) 2003 is out of date.

The book's example has

<section name="product"
type="System.Configuration.NameValueSectionHandler,System"/>

Fully qualified (and functional) it looks something like this:

<section name="product"
type="System.Configuration.NameValueSectionHandler,System,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
allowLocation="false"/>

I don't know if the original example works without MS .NET Framework 1.1
installed but I really don't care to uninstall or reinstall anything now to
test that theory. :)

Thanks for your help!

Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top