Why can't I add these modules?

H

Henry

I was trying to follow instructions to create a multifile assembly. My
project had two simple classes, MathLib and StringLib with a single method
each.

The instructions told me to compile each clase into modules using the
pattern

csc /t:module MathLib.cs
and
csc /t:module StringLib.cs

these commands resulted in two modules:
MathLib.netmodule and StringLib.netmodule

Next the instructions told me to link the two modules into one library using
the following command:

csc /t:library /out:Utils.dll /addmodule:MathLib.netModule,
StringLib.netModule

When I tried this however, I got the following error messages:
error CS2015:
'g:\Projects\70-316\Chapter04\StepByStep4_13\StringLib.netmodule'
is a binary file instead of a source code file
error CS1504: Source file
'g:\Projects\70-316\Chapter04\StepByStep4_13\StringLib.netmodule'
could
not be opened ('Unspecified error ')

These are nonsensical messages to me. Of course they are binary files. Why
would I use the /addmodule: parameter if they were not modules? I don't
understand the Unspecified error either. I was able to open and look at
each file using ildasm.exe.

Can someone explain where I am going wrong?
 
H

Henry

I am answering my own question...

There was a space between the comma and the name of the second module.
Aparrently you can't allow any spaces.
 

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