OK, had a look at this last night, and MS have done a bit of frigging about
with the way applciaiotns can start.  Basically if you go into the project
options, there is a checkbox with something like "Enable application
framework" on it.  If this is checked, then it looks like when you compile
the app, VS synthesises an Application class that contains the Sub Main.
This creates an intance of the appkicaiton, and presumably creates the
Windows message loop etc and registers your forms message sink.

I don't know if there is a way round this manually from NAnt.  I guess you
could write a script task to emit a class on the fly, but unless you really
need the application framework, then it may be easier just to disable this
in the vbproj settings and create your own custom Sub Main that starts the
applicaiton with an instance of the form.

Anyone else got any more details on how the Application Framework hangs
together round this area?  Did a Google (happy birthday btw!) but there
doesn't seem to be much low level information on this area.

Sorry it's not much help Mark,

Cheers,

Bill




                                                                          
  [EMAIL PROTECTED]                                         
  k                                       To:                             
  Sent by:                        [EMAIL PROTECTED]                  
  [EMAIL PROTECTED]         cc:                             
  rge.net                         nant-users@lists.sourceforge.net        
                                          Subject:        Re:             
                                  [Nant-users] Visual Studio 2005 Beta 2  
  26/09/2005 16:23                                                        
                                                                          






Hmm.  That certainly looks right Mark.

I don't have VS2005 on my work machine, so I'll have to have a play when I
get home tonight.  I don't know if it has changed in 2005 now you can have
unreferenced forms, but in 2003, you still had a void Main in the startup
form that started the application thread with an instance of the form.

I'm guessing this may have changed with not needing an instance of the
form.  There may be a new compiler switch for this that NAnt doesn't
support yet.  Have you tried changing the vbproj to set the startup to Main
and creating a void Main that explicitly creates an instance of your form
and runs it in the Application object?

Cheers,

Bill



                                                                          
  Mark Howell                                                             
  <[EMAIL PROTECTED]>          To:                                   
                             [EMAIL PROTECTED]             
                                    cc:                                   
  26/09/2005 16:09           nant-users@lists.sourceforge.net,            
                             [EMAIL PROTECTED]       
                                    Subject:        Re: [Nant-users]      
                             Visual Studio 2005 Beta 2                    
                                                                          






Hi Bill,

Here is the build script:


<?xml version="1.0" encoding="utf-8" ?>
<project name="CCTest" default="oldbuild" basedir=".">
               <property name="basename" value="CCTest" />

               <target name="oldbuild">
                                <vbc target="winexe" output
="bin\${basename}.exe"
rootnamespace="${basename}" >
                                                 <imports>
                                                                  <import
namespace="System" />
                                                                  <import
namespace="System.ComponentModel" />
                                                                  <import
namespace="System.Net.Sockets" />
                                                                  <import
namespace="System.Text" />
                                                 </imports>
                                                 <sources>
                                                                  <include
name="Form1.vb" />
                                                                  <include
name="Email.vb" />
                                                                  <include
name="Log.vb" />
                                                                  <include
name="My Project\*.vb" />
                                                 </sources>

                                                 <resources prefix="
${basename}"
dynamicprefix="true">
                                                                  <include
name="**/*.resx" />
                                                 </resources>

                                                 <references>
                                                                  <include
name="C:
\ClearCase\Views\snapviews\MarkH_view\vs.net\vb.net\ClearCaseTCP\CCTCPServer\obj\Debug\Interop.ClearCase.dll"

/>
                                                                  <include
name="C:
\ClearCase\Views\snapviews\MarkH_view\vs.net\vb.net\ClearCaseTCP\CCTCPServer\obj\Debug\Interop.Microsoft.Office.Core.dll"

/>
                                                                  <include
name="C:
\ClearCase\Views\snapviews\MarkH_view\vs.net\vb.net\ClearCaseTCP\CCTCPServer\obj\Debug\Interop.Outlook.dll"

/>
                                                                  <include
name="C:
\ClearCase\Views\snapviews\MarkH_view\vs.net\vb.net\ClearCaseTCP\CCTCPServer\obj\Debug\Interop.Redemption.dll"

/>
                                                                  <include
name="C:
\WINDOWS\assembly\GAC\stdole\7.0.3300.0__b03f5f7f11d50a3a\stdole.dll"
/>
                                                                  <include
name="System.dll" />
                                                                  <include
name="System.Deployment.dll" />
                                                                  <include
name="System.Drawing.dll" />
                                                                  <include
name="System.Windows.Forms.dll" />
                                                 </references>
                                </vbc>
               </target>
</project>

I took out the main bit and still get the same error.

MTIA

Mark

--- [EMAIL PROTECTED] wrote:

> What are you specifying for the target attribute of
> <vbc>  This needs to
> be "winexe" of it is a winforms appplication.  If
> you specify "exe" the
> compiler will treat it as a comnole applicaiton and
> therefore look for a
> void Main().  Can you post an example of your build
> script?
>
> Cheers,
>
> Bill
>
>
>
>
>
>
> Mark Howell <[EMAIL PROTECTED]>
> Sent by: [EMAIL PROTECTED]
> 26/09/2005 15:58
>
>
>         To:     nant-users@lists.sourceforge.net
>         cc:
>         Subject:        [Nant-users] Visual Studio
> 2005 Beta 2
>
>
> I am having trouble building my VB.NET 2005
> solution.
> This is just an example windows application with a
> single form. I have tried:
>                  <target name="build">
>                                  <solution
> configuration="release"
> solutionfile="..\CCTCP.sln" />
>                  </target>
>
> build:
>
>  [solution] Starting solution build.
>
> BUILD FAILED
>
> Microsoft Visual Studio.NET 2005 solutions are not
> supported.
>
> Total time: 0.1 seconds.
>
> I am now trying to write the build file by hand and
> I
> am getting the error:
>
> [vbc] vbc : error BC30420: 'Sub Main' was not found
> in
> 'Form1'.
>
> This is not a console application so there is no Sub
> Main, just the Form1_Load entry point.
>
>
> All help greatly appreciated
>
> MTIA
>
> Mark
>
>
>
>
>
___________________________________________________________
> To help you stay safe and secure online, we've
> developed the all new
> Yahoo! Security Centre. http://uk.security.yahoo.com
>
>
>
-------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's
> Geronimo App Server.
> Download it for free - -and be entered to win a 42"
> plasma tv or your very
> own Sony(tm)PSP.  Click here to play:
> http://sourceforge.net/geronimo.php
> _______________________________________________
> Nant-users mailing list
> Nant-users@lists.sourceforge.net
>
https://lists.sourceforge.net/lists/listinfo/nant-users
>
>
>
> As detailed in the company handbook, Avon Insurance
> has the facility to
> monitor and read both incoming and outgoing
> communications by e-mail.
>
> A copy of the company handbook can be found here:
>
http://www.ho.nfumutual.co.uk/mutualnet/HANDBOOK/ITPolicies/ITSecure.htm
>
>
>
>
>
>
> IMPORTANT
> The information contained in this e-mail and any
> attachments is intended for the addressee only
> and may contain legally privileged or confidential
> information.   If you are not the intended
> recipient you must not  use, disclose, copy,
> distribute, alter, or take any action in reliance
> on the information and Avon Insurance plc will not
> accept liability for any loss or damage howsoever
> arising, directly or indirectly in reliance on it
> and gives no warranty or representation as to its
> accuracy or reliability.   If you are not the
> addressee, please notify us immediately on 01789
> 202121*
> and delete the material from your computer and
> destroy any copies.
>
> Avon Insurance plc reserves the right to monitor and
> record incoming and outgoing email messages for
> the purposes of investigating or detecting
> unauthorised use of its system and ensuring its
> effective operation.
> Avon Insurance plc will not accept liability for any
> loss or damage as a result of any virus being passed
> on.
>
> Avon Insurance plc (No. 209606).
> Registered in England.  Registered Office: Arden
> Street, Stratford upon Avon, Warwickshire CV37 6WA.
> Authorised and regulated by the Financial Services
> Authority.
> A member of the NFU Mutual group of companies and
> the Association of British Insurers.
>
> *For security and training purposes, telephone calls
> may be recorded and monitored.
>






___________________________________________________________
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with
voicemail http://uk.messenger.yahoo.com


As detailed in the company handbook, Avon Insurance has the facility to
monitor and read both incoming and outgoing communications by e-mail.

A copy of the company handbook can be found here:
http://www.ho.nfumutual.co.uk/mutualnet/HANDBOOK/ITPolicies/ITSecure.htm



IMPORTANT
The information contained in this e-mail and any attachments is intended
for the addressee only
and may contain legally privileged or confidential information. If you are
not the intended
recipient you must not use, disclose, copy, distribute, alter, or take any
action in reliance
on the information and Avon Insurance plc will not accept liability for any
loss or damage howsoever
arising, directly or indirectly in reliance on it and gives no warranty or
representation as to its
accuracy or reliability. If you are not the addressee, please notify us
immediately on 01789 202121*
and delete the material from your computer and destroy any copies.

Avon Insurance plc reserves the right to monitor and record incoming and
outgoing email messages for
the purposes of investigating or detecting unauthorised use of its system
and ensuring its effective operation.
Avon Insurance plc will not accept liability for any loss or damage as a
result of any virus being passed on.

Avon Insurance plc (No. 209606).
Registered in England. Registered Office: Arden Street, Stratford upon
Avon, Warwickshire CV37 6WA.
Authorised and regulated by the Financial Services Authority.
A member of the NFU Mutual group of companies and the Association of
British Insurers.

*For security and training purposes, telephone calls may be recorded and
monitored.


As detailed in the company handbook, Avon Insurance has the facility to
monitor and read both incoming and outgoing communications by e-mail.

A copy of the company handbook can be found here:
http://www.ho.nfumutual.co.uk/mutualnet/HANDBOOK/ITPolicies/ITSecure.htm


IMPORTANT
The information contained in this e-mail and any attachments is intended
for the addressee only
and may contain legally privileged or confidential information. If you are
not the intended
recipient you must not use, disclose, copy, distribute, alter, or take any
action in reliance
on the information and Avon Insurance plc will not accept liability for any
loss or damage howsoever
arising, directly or indirectly in reliance on it and gives no warranty or
representation as to its
accuracy or reliability. If you are not the addressee, please notify us
immediately on 01789 202121*
and delete the material from your computer and destroy any copies.

Avon Insurance plc reserves the right to monitor and record incoming and
outgoing email messages for
the purposes of investigating or detecting unauthorised use of its system
and ensuring its effective operation.
Avon Insurance plc will not accept liability for any loss or damage as a
result of any virus being passed on.

Avon Insurance plc (No. 209606).
Registered in England. Registered Office: Arden Street, Stratford upon
Avon, Warwickshire CV37 6WA.
Authorised and regulated by the Financial Services Authority.
A member of the NFU Mutual group of companies and the Association of
British Insurers.

*For security and training purposes, telephone calls may be recorded and
monitored.




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. 
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Nant-users mailing list
Nant-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to