Creating multi-file assemblies

J

John P

Can someone give me a little help with creating multi-file assemblies?

I am trying the simple example from richter's book and I can't seem to
get my exe to recognize a class defined in a .netmodule file.

I created 2 .cs files. One called ruts.cs that contains a class Rut, and
another .cs file, futs.cs, which contains a class Fut. Both belong to
the same Namespace. I built the rut.cs into a .netmodule as follows:

csc /t:module ruts.cs

This generated a ruts.netmodule file.

I then created a library module using futs.cs and the ruts.netmodule.

csc /t:library /out:MyAssembly.dll /addmodule:ruts.netmodule futs.cs

This created MyAssembly.dll.

Within the VS-IDE I created an app, Test and added the reference to
MyAssembly.dll and added the using MyNamespace;
In the Test I can access and use the class Fut but the class Rut is not
seen and generates an error.

So, what am I missing?


Thank you for your help with this problem


johnp
 
T

Tian Min Huang

Hello John,

Thanks for your post. As I understand, the problem you are facing is that
your multfile assembly does not work properly. I think more information is
needed before moving forward:

1. Could you please tell me the detailed error message VS .NET reports?

2. Did you use Assembly Linker (Al.exe) to create an assembly from a
collection of compiled code modules? Please refer to the following MSDN
article for detailed information and sample:

Building a Multifile Assembly
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconbuildingmulti-fileassembly.asp

Multifile Assembly Example
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconMultifileAssemblyExample.asp

I look forward to your response.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
T

Tian Min Huang

Hi John,

I haven't heard back from you yet and I'm just writing in to see if you
have had an opportunity to collect the information. If you could get back
to me at your earliest convenience, we will be able to go ahead. If there
was some part of my post that you didn't understand, please feel free to
post here. I look forward to hearing from you.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
D

DotNetJunkies User

HuangTM,

I'm new to .net assemblies and modules, and it sounds like you might be able to answer my question. I think my question is related to the one in this post.

I have inherited an ASP.Net site with many .cs files compiled into one DLL (assembly). I believe this site was developed from one developer using VS.Net. What I would like to be able to do is replace a class in the assembly without having to compile all the .cs modules again (as I don't have the source for all of them).

Say I have an assembly named MyAssembly.dll compiled with a.cs, b.cs, and c.cs. Can I change a.cs and recompile or relink with csc.exe or al.exe to replace a.cs and get a new MyAssembly.dll with new a.cs code without having to link in b.cs or c.cs again?

If you could send me an email in this regard I'd appreciate it. I'm new to this site and don't know if I'll remember where I posted it tomorrow.

(e-mail address removed)

Thanks HuangTM.
bdc
 

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