Mattias Sjögren said:
Willy,
Why would it care about verifiability? I could /addmodule a mixed mode
module without problems here. With the 2.0 compiler I just had to
specify /platform:x86 for it to be accepted.
Mattias
Mattias,
Sorry for not being more explicit.
What I meant was that the way Nicholas explained would not work.
Now, what you did was simply adding a reference to a single "mixed mode"
netmodule (mixed mode = process specific), and you solved this with the
/platform:x86 option. That means your C# main program becomes machine
specific, no big deal though.
The problem is however that your netmodule must be distributed with your
main program assembly (.exe), a netmodule is referenced not statically
linked, right.
So, in the scenario of the OP, (remember he want's to reduce the number of
modules (DLL's)), we have:
1- C# assemblies, say a main program (entry point)
2- managed C++ code wrappers (mixed), and
3- native C++ code (wrapped classes) DLL's
building a netmodule for 2 doesn't solve the OP's problem, you still end
with three units of distribution, and it doesn't work anyway, you have to
link 2 and 3, as 2 calls into 3.
Ok, you could build a netmodule from 2 and 3, but you can't link a DLL from
this netmodule (linker returns: fatal error LNK1302: only support linking
safe .netmodules; unable to link ijw/native .netmodule).
That means at best you end with a .exe and a netmodule, and
- a netmodule is IMO not a valid unit of distribution
- is not loadable from unmanaged code, that would mean that still you need
to distribute the unmanaged code DLL, if used by unmanaged caller.
- and still you need the /platform:x86 option.
Willy.