[Mono-list] Not all types imported from linked assemblies
Stephen Touset
stephen@touset.org
Wed, 10 Nov 2004 17:50:19 -0500
--=-BJj89juDLBUKVZ8QxNXB
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=
g
> MonoDevelop as my IDE, but I've attempted to do the same steps through th=
e
> command line, both to no fruition.
>=20
> 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=
k
> 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:
>=20
> mcs -target:library -out:outfile.dll ${SOURCES} -r:${BASE_PROJECT_EXE}
> -r:${OTHER_ASSEMBLIES}
>=20
> 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=
w
> 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.
>=20
> $ mcs -target:library -out:"test.dll" -r ../LADR.exe -r
> nunit.framework.dll Sources/Record/Record_Test.cs
> Compilation succeeded
> $
>=20
> $ 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
> $
>=20
> However, a quick "strings" shows that the assembly has both classes in pl=
ace:
>=20
> $ strings ../LADR.exe | grep Record
> IRecord
> LdapRecordProxy
> Record
> $
>=20
> I could always include the sources from the base project by hand, but tha=
t
> 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?
>=20
--=20
Stephen Touset <stephen@touset.org>
--=-BJj89juDLBUKVZ8QxNXB
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
iD8DBQBBkpsq+fMdKwQeHvYRAjwqAJ4rpGYsi0ugk1qwZtqzJMGo2dgsWACdG1RL
wdRB/ckDVAdt5HtXXSAH1PA=
=Bb7z
-----END PGP SIGNATURE-----
--=-BJj89juDLBUKVZ8QxNXB--