Hello All,

Can someone help me out with this please? I have no idea :

Error :

No accessible 'Main' method with an appropriate signature was found in 'UsedCarsSales'

The second error is Project-level conditional compilation constant 'VBC_VER = 9.0, TARGET = "winexe", CONFIG= "Debug", PLATFORM= "x86" , DEBUG; ^^ ^^ TRACE' is not valid: Character is not valid


Please i need your help. I am new to VB and this doesn't just make any sense.


Thanks in anticipation

Dani AI

Generated

Two separate issues are present: the compiler cannot find a valid entry point (the "No accessible 'Main' method" error) and the project’s conditional-compilation string is malformed (the "project-level conditional compilation constant … is not valid" error). (learn.microsoft.com)

Entry-point (BC30737)

  • Determine the project type (Windows Forms vs Console) on the Project → Properties → Application page. Visual Basic’s Application Framework supplies a form-based startup for WinForms projects; to use a custom Sub Main you typically disable the Application Framework and choose Sub Main as the startup object. As noted, an explicit Main/Sub Main is required when the project expects a console-style entry point; its accessibility depends on where it’s declared. (learn.microsoft.com)

Example (module-based Sub Main)

Module Startup
    Public Sub Main()
        ' For a WinForms app: start the main form
        System.Windows.Forms.Application.Run(New MainForm())
    End Sub
End Module

Conditional-compilation constants (BC31030)

  • That error means the "conditional compilation symbols" project value contains illegal characters (commas/quotes/extra text). Fix it using Project → Properties → Compile → Advanced Compile Options → Conditional compilation symbols: remove the garbled text and leave only valid symbols. If the IDE UI fails, unload the project and edit the .vbproj to clean the <DefineConstants> entries (backup first). Use the Visual Studio UI or the documented syntax for conditional compilation when making changes. (learn.microsoft.com)

Quick checklist: confirm OutputType/startup object in Application properties, add a properly declared Sub Main (Module vs Class/Shared rules), fix/clean the conditional-symbols field or <DefineConstants>, then do a Clean + Rebuild (restart VS if settings don’t appear to update).

Is your app a window app or command line app? I found this on Microsoft's website.

Command-line applications must have a Sub Main defined. Main must be declared as Public Shared if it is defined in a class, or as Public if defined in a module.

You Main should look like this...

public Shared Sub Main(byVal args() as String)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.