[Prev] Thread [Next]  |  [Prev] Date [Next]

[DotNetDevelopment] multifile assembly vbc al Dr. Leff Sun Jul 25 08:00:15 2010

I am having trouble preparing two modules with a multifile assembly as
in <A href="http://msdn.microsoft.com/en-us/library/
226t7yxe.aspx">(Howto: Build a multifile assembly in the MSD .net
Framework Developers Guide</A>

I am using Visual Studio 10.

Here is my batch file:

vbc /t:module c.vb
vbc /addmodule:c.netmodule /t:module d.vb

Here are my two simple utilities to test:


imports System
public class c
public sub cc
   console.writeline ("c.cc called")
end sub
end class


imports system
public class d
public shared sub main ()
dim c as c
c = new c()
end sub
end class

When I run d.netmodule and start up the debugger in Visual Stuido I
a BadImageFormatException.  "The module was expected to contain an
assembly manifest"

I added to my batch file the following line

al d.netmodule /main:d.main /out:d.exe /target:exe

When I run d.exe, it has a problem and when I started the Visual
debugger, I got error message

BadImageFormatException was unhandled
An attempt was made to load a program with an incorrect format.
Exception from HRESULT: 0x8007000B