views:

43

answers:

0

I've got some VB code that's using a default instance of a Form. It compiles fine within VS but when I try compiling using the nant vbc task it throws this error,

error BC30469: Reference to a non-shared member requires an object reference.

Here's the relevant section of my nant script,

<vbc target="exe" output="${basename}.exe" rootnamespace="${basename}">
  <imports>
    <import namespace="Microsoft.VisualBasic"/>
     ....
  </imports>
  <sources>
    <include name="**/*.vb" />
  </sources>
  <references>
    .....
 </vbc>

The VB code looks like this,

m_PlanID = MDIParent.PlanDetails.PlanID

Any idea what I'm doing wrong?

Ideally I'd prefer not to be using default instances at all but that's a job for another day.