[Mono-list] Not all types imported from linked assemblies

Stephen Touset stephen@touset.org
Wed, 10 Nov 2004 17:50:19 -0500

Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

For posterity, I've solved the problem. It was quite simple after all: I
forgot to put the "public" modifier on the class, so it was not
accessible from outside the assembly. Silly, silly, silly me.

On Tue, 2004-11-09 at 16:15 -0500, Stephen Touset wrote:
> I've run into a bit of a problem trying to use the mcs compiler. I'm usin=
> MonoDevelop as my IDE, but I've attempted to do the same steps through th=
> command line, both to no fruition.
> Essentially, I have two projects: one as a main development project, the
> other  as a side project used for compiling unit tests and running them
> (based off the NUnit assembly) and running them. Obviously, I need to lin=
> in the classes from the base .NET project in order to run the unit tests
> against them. MonoDevelop's way of doing this is to depend on the base
> project, then run:
> mcs -target:library -out:outfile.dll ${SOURCES} -r:${BASE_PROJECT_EXE}
> Since this links against the base project's .exe, this makes classes from
> the base project visible to the unit testing library. However, I right no=
> have two classes in the base project that I want to test, and the above
> command only works for one of them. I've isolated them to clarify my
> point.
> $ mcs -target:library -out:"test.dll" -r ../LADR.exe -r
> nunit.framework.dll Sources/Record/Record_Test.cs
> Compilation succeeded
> $
> $ mcs -target:library -out:"test.dll" -r ../LADR.exe -r
> nunit.framework.dll Sources/Record/LdapRecordProxy_Test.cs
> Sources/Record/LdapRecordProxy_Test.cs(6) error CS0246: Cannot find type
> `LdapRecordProxy'
> Compilation failed: 1 error(s), 0 warnings
> $
> However, a quick "strings" shows that the assembly has both classes in pl=
> $ strings ../LADR.exe | grep Record
> IRecord
> LdapRecordProxy
> Record
> $
> I could always include the sources from the base project by hand, but tha=
> defeats MonoDevelop's nice project integration. Also, I'm sure I'm just
> doing something obvious wrong, since one of the classes is being found
> easily, but the other is not. Does anyone have a possible solution?
Stephen Touset <stephen@touset.org>

Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

Version: GnuPG v1.2.5 (GNU/Linux)