dotnet apps running over CSNW

G

Guest

I have found that .NET applications made up from multiple assemblies do not run from file servers if Microsoft Client Service for NetWare is used to access the file server. When you try to do so, you invariably get a System.IO.FileLoadException with an error message such as "Can not access file <assemblyName> because it is being used by another process." where <assemblyName> is the name of the second assembly loaded for your application.

The problem can be reproduced as such:
1. Create a simple .NET app with at least two assemblies. For example, make a .exe windows app as your first assembly, and in it have a reference to a class that resides in a separate class library assembly. In your .exe startup code, simply instantiate a class from the class library (so that the framework will attempt to load the class library .dll at runtime).
2. Copy the resulting .exe and .dll to any location on a NetWare server.
3. Using a workstation that connects to the NetWare server via Client Service for NetWare, execute the .exe.

Curiously, if you use Novell's client to access the server instead of the Microsoft one, then everything works fine. However, in many cases our customers must use the Microsoft client.

Has anybody else experienced this problem and/or found a solution to it?
 
N

Nick Malik

Most of the issues with MCSNW were fixed with Windows 2000 Service Pack 3.

What service pack are you using?

The best thing I can say is that you can trap this error early and suggest
that the user could install the latest service pack.

--- Nick

Lorin McCaffrey said:
I have found that .NET applications made up from multiple assemblies do
not run from file servers if Microsoft Client Service for NetWare is used to
access the file server. When you try to do so, you invariably get a
System.IO.FileLoadException with an error message such as "Can not access
file <assemblyName> because it is being used by another process." where
The problem can be reproduced as such:
1. Create a simple .NET app with at least two assemblies. For example,
make a .exe windows app as your first assembly, and in it have a reference
to a class that resides in a separate class library assembly. In your .exe
startup code, simply instantiate a class from the class library (so that the
framework will attempt to load the class library .dll at runtime).
2. Copy the resulting .exe and .dll to any location on a NetWare server.
3. Using a workstation that connects to the NetWare server via Client
Service for NetWare, execute the .exe.
Curiously, if you use Novell's client to access the server instead of the
Microsoft one, then everything works fine. However, in many cases our
customers must use the Microsoft client.
 
G

Guest

This problem can be reproduced on Windows 2000 SP4, Windows XP Pro SP1, and possibly others.

I am having difficulty catching the exception. Even if these are the only lines in the
executable the exception still does not get caught (where d2192TestLibrary is the name of the second assembly, the class library):

Try
Dim newObject As New d2192TestLibrary.Class1
Catch exp As Exception
MsgBox("Caught the exception: " & exp.Message)
End Try

It does not seem to be a problem with the Fusion loader, since I can force fusion to log everything and it says it is successful in loading the second assembly (and then the FileLoadException still gets thrown somewhere later). However, if you explicitly use System.Reflection.Assembly.LoadFile then it fails with the same FileLoadException and you could catch the exception in this case.

The underlying problem still seems to be that a .NET app composed of multiple assemblies cannot be run from a Netware drive if you use MCSNW, regardless of the workstation OS. Any ideas on a workaround?
 

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