Loading...

DotNetDevelopment@googlegroups.com

[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
described
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:

C.vb

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

D.vb


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

When I run d.netmodule and start up the debugger in Visual Stuido I
get
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
Studio
debugger, I got error message

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