Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

keep getting error below...can continue and all looks ok??

There was a build error

"No accessinbe "Main" method with an appropriate signature was found in form1.

 

These error messages in .net are frustrating

 

Thanks

  • *Experts*
Posted

Are trying to use Sub Main to start the program?

If not, go to your projects properites and I think (dont have VS.NET available now to check where excatly it is) then General section and set your form as the startup object.

  • Leaders
Posted

have you modified the Sub New? eg:

#Region " Windows Form Designer generated code "

   Public Sub New() '/// has anything been added in here.///
       MyBase.New()

       'This call is required by the Windows Form Designer.
       InitializeComponent()

       'Add any initialization after the InitializeComponent() call

   End Sub

i've seen that happen if the starting form has it's Sub New modified.

  • *Experts*
Posted (edited)

In the Form1 class, create the following Main method to run the

program:

 

Public Shared Sub Main()
 Application.Run(New Form1())
End Sub

 

[edit]Fixed, thanks Volte, I knew I was forgetting SOME modifier...[/edit]

Edited by Bucky

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

  • *Experts*
Posted
That is only necessary in C#. In VB, the form should be able to create itself. Also, the Sub would need to be Shared for that to work.
  • *Experts*
Posted

When you build the project and that error is displayed in the

task list, double-click it. A window pops up, and you can select

your form as the startup object there. Rebuild the project and you

should be all set; you won't need the Sub Main any more.

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...