Bonsoir à tous,

Je me confronte à un petit problème auquel je ne trouve pas de solution :
J'ai généré avec CodeDom une Class qui est la suivante :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
'------------------------------------------------------------------------------
' <auto-generated>
'     Ce code a été généré par un outil.
'     Version du runtime :4.0.30319.1
'
'     Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
'     le code est régénéré.
' </auto-generated>
'------------------------------------------------------------------------------
 
Option Strict Off
Option Explicit On
 
Namespace WindowsApplication2
 
    Partial Public Class Form1
        Inherits System.Windows.Forms.Form
 
        Public button1 As System.Windows.Forms.Button
 
        Public Sub New()
            MyBase.New
            Me.InitializeComponent
        End Sub
 
        Public Sub InitializeComponent()
            Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1))
            Me.button1 = New System.Windows.Forms.Button()
            Me.SuspendLayout
            '
            'button1
            '
            Me.button1.Cursor = System.Windows.Forms.Cursors.Cross
            Me.button1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!)
            Me.button1.ImeMode = System.Windows.Forms.ImeMode.Disable
            Me.button1.Location = New System.Drawing.Point(38, 57)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(75, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "button1"
            Me.button1.UseVisualStyleBackColor = true
            '
            'Form1
            '
            Me.ClientSize = New System.Drawing.Size(322, 266)
            Me.Controls.Add(Me.button1)
            Me.Cursor = System.Windows.Forms.Cursors.Cross
            Me.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!)
            Me.Icon = CType(resources.GetObject("$this.Icon"),System.Drawing.Icon)
            Me.Name = "Form1"
            Me.Text = "Form1"
            Me.ResumeLayout(false)
        End Sub
 
        <System.STAThreadAttribute()>  _
        Public Shared Sub Main()
            System.Windows.Forms.Application.Run(New Form1())
            Dim _manager As My.MyApplication = New My.MyApplication
            _manager.Run(System.Environment.GetCommandLineArgs())
        End Sub
    End Class
 
    Public Class Form1
 
        'Fonctions
    End Class
End Namespace
Le problème est que suite à une compilation avec "CompileAssemblyFromFile", j'obtiens l'erreur suivante :
Sub Main introuvable dans Form1
A moins que je ne sois complètement fou, il est bien présent dans la Class Form1

Avez-vous une piste à m'indiquer pour corriger ce problème?

Merci