[Mono-bugs] [Bug 75959][Wis] New - I am trying to recompile a
vb.net code that is succesully compiled on MS .NET platform.
MBAS doesn't recognize some of statements and crush and the end
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Fri Sep 2 08:24:27 EDT 2005
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by vlindos at abv.bg.
http://bugzilla.ximian.com/show_bug.cgi?id=75959
--- shadow/75959 2005-09-02 08:24:27.000000000 -0400
+++ shadow/75959.tmp.10318 2005-09-02 08:24:27.000000000 -0400
@@ -0,0 +1,525 @@
+Bug#: 75959
+Product: Mono: Tools
+Version: unspecified
+OS:
+OS Details: Debian Unstable with CVS Mono
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: tools
+AssignedTo: mono-bugs at ximian.com
+ReportedBy: vlindos at abv.bg
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: I am trying to recompile a vb.net code that is succesully compiled on MS .NET platform. MBAS doesn't recognize some of statements and crush and the end
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+Here is problematic file:
+-Connection.vb------------------------------------------------------------
+Public Class Connection
+ Inherits System.Windows.Forms.Form
+
+#Region " Declarations "
+ ' Ïðîìåíëèâà çà ðåçóëòàò íà ïðîçîðåöà
+ Private m_FormResult As System.Windows.Forms.DialogResult
+
+ ' Ïðîìåíëèâà çà èçáîð íà òåêñòà ïðè ñúáèòèåòî OnMouseDown
+ Private SelectAllText As Boolean = True
+
+#End Region
+
+#Region " Windows Form Designer generated code "
+
+ Public Sub New()
+ MyBase.New()
+
+ 'This call is required by the Windows Form Designer.
+ InitializeComponent()
+
+ 'Add any initialization after the InitializeComponent() call
+
+ End Sub
+
+ 'Form overrides dispose to clean up the component list.
+ Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
+ If disposing Then
+ If Not (components Is Nothing) Then
+ components.Dispose()
+ End If
+ End If
+ MyBase.Dispose(disposing)
+ End Sub
+
+ 'Required by the Windows Form Designer
+ Private components As System.ComponentModel.IContainer
+
+ 'NOTE: The following procedure is required by the Windows Form Designer
+ 'It can be modified using the Windows Form Designer.
+ 'Do not modify it using the code editor.
+ Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
+ Friend WithEvents Label6 As System.Windows.Forms.Label
+ Friend WithEvents Label5 As System.Windows.Forms.Label
+ Friend WithEvents Label4 As System.Windows.Forms.Label
+ Friend WithEvents Label3 As System.Windows.Forms.Label
+ Friend WithEvents Label2 As System.Windows.Forms.Label
+ Friend WithEvents Label1 As System.Windows.Forms.Label
+ Friend WithEvents cbDatabaseType As System.Windows.Forms.ComboBox
+ Friend WithEvents tbDatabase As System.Windows.Forms.TextBox
+ Friend WithEvents tbServer As System.Windows.Forms.TextBox
+ Friend WithEvents Button2 As System.Windows.Forms.Button
+ Friend WithEvents Button1 As System.Windows.Forms.Button
+ Friend WithEvents tbPassword As System.Windows.Forms.TextBox
+ Friend WithEvents tbUser As System.Windows.Forms.TextBox
+ Friend WithEvents tbPath As System.Windows.Forms.TextBox
+ <System.Diagnostics.DebuggerStepThrough()> Private Sub
+InitializeComponent()
+ Me.GroupBox1 = New System.Windows.Forms.GroupBox
+ Me.Label6 = New System.Windows.Forms.Label
+ Me.tbPath = New System.Windows.Forms.TextBox
+ Me.Label5 = New System.Windows.Forms.Label
+ Me.Label4 = New System.Windows.Forms.Label
+ Me.Label3 = New System.Windows.Forms.Label
+ Me.Label2 = New System.Windows.Forms.Label
+ Me.Label1 = New System.Windows.Forms.Label
+ Me.cbDatabaseType = New System.Windows.Forms.ComboBox
+ Me.tbPassword = New System.Windows.Forms.TextBox
+ Me.tbUser = New System.Windows.Forms.TextBox
+ Me.tbDatabase = New System.Windows.Forms.TextBox
+ Me.tbServer = New System.Windows.Forms.TextBox
+ Me.Button2 = New System.Windows.Forms.Button
+ Me.Button1 = New System.Windows.Forms.Button
+ Me.GroupBox1.SuspendLayout()
+ Me.SuspendLayout()
+ '
+ 'GroupBox1
+ '
+ Me.GroupBox1.Controls.Add(Me.Label6)
+ Me.GroupBox1.Controls.Add(Me.tbPath)
+ Me.GroupBox1.Controls.Add(Me.Label5)
+ Me.GroupBox1.Controls.Add(Me.Label4)
+ Me.GroupBox1.Controls.Add(Me.Label3)
+ Me.GroupBox1.Controls.Add(Me.Label2)
+ Me.GroupBox1.Controls.Add(Me.Label1)
+ Me.GroupBox1.Controls.Add(Me.cbDatabaseType)
+ Me.GroupBox1.Controls.Add(Me.tbPassword)
+ Me.GroupBox1.Controls.Add(Me.tbUser)
+ Me.GroupBox1.Controls.Add(Me.tbDatabase)
+ Me.GroupBox1.Controls.Add(Me.tbServer)
+ Me.GroupBox1.Location = New System.Drawing.Point(3, 0)
+ Me.GroupBox1.Name = "GroupBox1"
+ Me.GroupBox1.Size = New System.Drawing.Size(351, 162)
+ Me.GroupBox1.TabIndex = 14
+ Me.GroupBox1.TabStop = False
+ '
+ 'Label6
+ '
+ Me.Label6.AutoSize = True
+ Me.Label6.Location = New System.Drawing.Point(6, 39)
+ Me.Label6.Name = "Label6"
+ Me.Label6.Size = New System.Drawing.Size(147, 16)
+ Me.Label6.TabIndex = 27
+ Me.Label6.Text = "Ïúò äî áàçàòà (MS Access)"
+ '
+ 'tbPath
+ '
+ Me.tbPath.Location = New System.Drawing.Point(159, 36)
+ Me.tbPath.Name = "tbPath"
+ Me.tbPath.Size = New System.Drawing.Size(183, 20)
+ Me.tbPath.TabIndex = 1
+ Me.tbPath.Text = ""
+ '
+ 'Label5
+ '
+ Me.Label5.AutoSize = True
+ Me.Label5.Location = New System.Drawing.Point(6, 135)
+ Me.Label5.Name = "Label5"
+ Me.Label5.Size = New System.Drawing.Size(47, 16)
+ Me.Label5.TabIndex = 25
+ Me.Label5.Text = "Ïàðîëà:"
+ '
+ 'Label4
+ '
+ Me.Label4.AutoSize = True
+ Me.Label4.Location = New System.Drawing.Point(6, 111)
+ Me.Label4.Name = "Label4"
+ Me.Label4.Size = New System.Drawing.Size(109, 16)
+ Me.Label4.TabIndex = 24
+ Me.Label4.Text = "Ïîòðåáèòåëñêî èìå"
+ '
+ 'Label3
+ '
+ Me.Label3.AutoSize = True
+ Me.Label3.Location = New System.Drawing.Point(6, 87)
+ Me.Label3.Name = "Label3"
+ Me.Label3.Size = New System.Drawing.Size(82, 16)
+ Me.Label3.TabIndex = 23
+ Me.Label3.Text = "Èìå íà áàçàòà"
+ '
+ 'Label2
+ '
+ Me.Label2.AutoSize = True
+ Me.Label2.Location = New System.Drawing.Point(6, 63)
+ Me.Label2.Name = "Label2"
+ Me.Label2.Size = New System.Drawing.Size(90, 16)
+ Me.Label2.TabIndex = 22
+ Me.Label2.Text = "Èìå íà ñúðâúðà"
+ '
+ 'Label1
+ '
+ Me.Label1.AutoSize = True
+ Me.Label1.Location = New System.Drawing.Point(6, 15)
+ Me.Label1.Name = "Label1"
+ Me.Label1.Size = New System.Drawing.Size(113, 16)
+ Me.Label1.TabIndex = 21
+ Me.Label1.Text = "Òèï íà áàçàòà äàííè"
+ '
+ 'cbDatabaseType
+ '
+ Me.cbDatabaseType.DropDownStyle = System.Windows.Forms.
+ComboBoxStyle.DropDownList
+ Me.cbDatabaseType.Location = New System.Drawing.Point(159, 12)
+ Me.cbDatabaseType.Name = "cbDatabaseType"
+ Me.cbDatabaseType.Size = New System.Drawing.Size(183, 21)
+ Me.cbDatabaseType.TabIndex = 0
+ '
+ 'tbPassword
+ '
+ Me.tbPassword.Location = New System.Drawing.Point(159, 132)
+ Me.tbPassword.Name = "tbPassword"
+ Me.tbPassword.PasswordChar = Microsoft.VisualBasic.ChrW(42)
+ Me.tbPassword.Size = New System.Drawing.Size(183, 20)
+ Me.tbPassword.TabIndex = 5
+ Me.tbPassword.Text = ""
+ '
+ 'tbUser
+ '
+ Me.tbUser.Location = New System.Drawing.Point(159, 108)
+ Me.tbUser.Name = "tbUser"
+ Me.tbUser.Size = New System.Drawing.Size(183, 20)
+ Me.tbUser.TabIndex = 4
+ Me.tbUser.Text = ""
+ '
+ 'tbDatabase
+ '
+ Me.tbDatabase.Location = New System.Drawing.Point(159, 84)
+ Me.tbDatabase.Name = "tbDatabase"
+ Me.tbDatabase.Size = New System.Drawing.Size(183, 20)
+ Me.tbDatabase.TabIndex = 3
+ Me.tbDatabase.Text = ""
+ '
+ 'tbServer
+ '
+ Me.tbServer.Location = New System.Drawing.Point(159, 60)
+ Me.tbServer.Name = "tbServer"
+ Me.tbServer.Size = New System.Drawing.Size(183, 20)
+ Me.tbServer.TabIndex = 2
+ Me.tbServer.Text = ""
+ '
+ 'Button2
+ '
+ Me.Button2.DialogResult = System.Windows.Forms.DialogResult.Cancel
+ Me.Button2.Location = New System.Drawing.Point(180, 168)
+ Me.Button2.Name = "Button2"
+ Me.Button2.TabIndex = 7
+ Me.Button2.Text = "Îòêàç"
+ '
+ 'Button1
+ '
+ Me.Button1.Location = New System.Drawing.Point(102, 168)
+ Me.Button1.Name = "Button1"
+ Me.Button1.TabIndex = 6
+ Me.Button1.Text = "ÎÊ"
+ '
+ 'Connection
+ '
+ Me.AcceptButton = Me.Button1
+ Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
+ Me.CancelButton = Me.Button2
+ Me.ClientSize = New System.Drawing.Size(357, 197)
+ Me.Controls.Add(Me.Button2)
+ Me.Controls.Add(Me.Button1)
+ Me.Controls.Add(Me.GroupBox1)
+ Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.
+FixedDialog
+ Me.KeyPreview = True
+ Me.MaximizeBox = False
+ Me.MinimizeBox = False
+ Me.Name = "Connection"
+ Me.StartPosition = System.Windows.Forms.FormStartPosition.
+CenterScreen
+ Me.Text = "Âðúçêà ñ áàçàòà äàííè"
+ Me.GroupBox1.ResumeLayout(False)
+ Me.ResumeLayout(False)
+
+ End Sub
+
+#End Region
+
+#Region " Properties "
+
+ Public ReadOnly Property FormResult() As System.Windows.Forms.
+DialogResult
+ Get
+ Return m_FormResult
+ End Get
+ End Property
+
+#End Region
+
+#Region " Form Events "
+
+ Private Sub Connection_Load(ByVal sender As System.Object, ByVal e As
+System.EventArgs) Handles MyBase.Load
+ cbDatabaseType.Items.Clear()
+ cbDatabaseType.Items.Add("MS Access")
+ cbDatabaseType.Items.Add("MS SQL Server")
+ cbDatabaseType.Items.Add("My SQL")
+
+ cbDatabaseType.SelectedIndex = 2
+
+ tbPath.Text = Application.StartupPath + "\Microinvest.mdb"
+
+ tbServer.Text = "Yavor"
+ tbDatabase.Text = "Microinvest"
+ tbUser.Text = "root"
+ 'tbuser.Text = "sa"
+ tbPassword.Text = "investmicro"
+
+ m_FormResult = DialogResult.Cancel
+ End Sub
+
+ Private Sub Connection_Activated(ByVal sender As Object, ByVal e As
+System.EventArgs) Handles MyBase.Activated
+ Busy(False)
+ cbDatabaseType.Focus()
+ End Sub
+
+#End Region
+
+#Region " Button Events "
+
+ Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
+System.EventArgs) Handles Button1.Click
+ Dim ConnectionString As String ' Ïðîìåíëèâà çà ñòðèíãà çà
+âðúçêà ñ áàçàòà
+ Dim DatabaseName As String ' Ïðîìåíëèâà çà èìåòî íà áàçàòà
+ Dim ServerName As String ' Ïðîìåíëèâà çà èìåòî íà ñúðâåðà
+ Dim WorkStationName As String ' Ïðîìåíëèâà çà èìåòî íà
+ðàáîòíàòà ñòàíöèÿ
+ Dim UserName As String ' Ïðîìåíëèâà çà èìåòî íà
+ïîòðåáèòåëÿ
+ Dim UserPassword As String ' Ïðîìåíëèâà àç ïàðîëàòà íà
+ïîòðåáèòåë
+
+ Busy(True)
+ 'Óñòàíîâÿâàíå íà âðúçêà ñ áàçàòà
+ Try
+ CurrentDBType = CType(cbDatabaseType.SelectedIndex,
+DatabaseType)
+
+ Select Case CType(cbDatabaseType.SelectedIndex, DatabaseType)
+ Case DatabaseType.MSAccess
+ ' Èíèöèàëèçàöèÿ çà áàçàòà äàííè íà MS Access
+ DatabaseName = tbPath.Text
+ ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;
+User ID=Admin;" + _
+ "Mode=Share Deny None;" + _
+ "Jet OLEDB:Engine Type=3;Jet OLEDB:Database
+Locking Mode=0;" + _
+ "Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:
+Global Bulk Transactions=1;" + _
+ "Jet OLEDB:Create System Database=False;Jet
+OLEDB:Encrypt Database=False;" + _
+ "Jet OLEDB:Don't Copy Locale on Compact=False;
+Jet OLEDB:Compact Without Replica Repair=False;" + _
+ "Jet OLEDB:Database Password=Microinvest6380;" +
+_
+ "Jet OLEDB:SFP=False;Data Source=" &
+DatabaseName
+
+ Case DatabaseType.MSSqlServer
+ ' Èíèöèàëèçàöèÿ çà áàçàòà äàííè íà MS SQL Server
+ ServerName = tbServer.Text
+ DatabaseName = tbDatabase.Text
+ UserName = tbUser.Text
+ UserPassword = tbPassword.Text
+ ConnectionString = "packet size=4096;user id=" &
+UserName & ";data source=" & ServerName & _
+ ";persist security info=True;initial catalog=" &
+DatabaseName & ";password=" & UserPassword
+
+ Case DatabaseType.MySql
+ ' Èíèöèàëèçàöèÿ çà áàçàòà äàííè íà MySQL
+ ServerName = tbServer.Text
+ DatabaseName = tbDatabase.Text
+ UserName = tbUser.Text
+ UserPassword = tbPassword.Text
+ ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" &
+_
+ "SERVER=" & ServerName & ";" & _
+ "DATABASE=" & DatabaseName & ";" &
+_
+ "UID=" & UserName & ";" + _
+ "PASSWORD=" & UserPassword & ";" &
+_
+ "OPTION=17923"
+ End Select
+
+ Catch ex As Exception
+ MessageBox.Show("Ãðåøêà ïðè ÷åòåíå íà êîíôèãóðàöèîííèòå
+ïàðàìåòðè!", "Âíèìàíèå", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
+ Busy(False)
+ Return
+ End Try
+
+ ' Èíèöèàëèçàöèÿ íà ñúîòâåòíèÿ connection îáåêò
+ If Not IsNothing(MainConnection) AndAlso MainConnection.State =
+ConnectionState.Open Then
+ MainConnection.Close() : MainConnection.Dispose()
+ End If
+ MainConnection = GetConnection(ConnectionString,
+CType(cbDatabaseType.SelectedIndex, DatabaseType))
+ SetConnection(MainConnection)
+
+ Try
+ If MainConnection.State <> ConnectionState.Open Then
+MainConnection.Open()
+ If CType(cbDatabaseType.SelectedIndex, DatabaseType) = Common.
+DatabaseType.MySql Then ExecuteNonQuery("SET CHARACTER SET cp1251")
+
+ Catch ex As Exception
+ MessageBox.Show("Íå ìîæå äà áúäå íàïðàâåíà âðúçêà ñ áàçàòà
+äàííè", "Âíèìàíèå", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
+ Busy(False)
+ Return
+ End Try
+
+
+ m_FormResult = DialogResult.OK
+ Me.Close()
+ Busy(False)
+ End Sub
+
+ Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
+System.EventArgs) Handles Button2.Click
+ Me.Close()
+ End Sub
+#End Region
+
+#Region " ComboBox Events "
+
+ Private Sub cbDatabaseType_SelectedIndexChanged(ByVal sender As Object,
+ByVal e As System.EventArgs) Handles cbDatabaseType.SelectedIndexChanged
+ If cbDatabaseType.SelectedIndex = 0 Then
+ tbPath.Enabled = True
+ tbDatabase.Enabled = False
+ tbServer.Enabled = False
+ tbUser.Enabled = False
+ tbPassword.Enabled = False
+ Else
+ tbPath.Enabled = False
+ tbDatabase.Enabled = True
+ tbServer.Enabled = True
+ tbUser.Enabled = True
+ tbPassword.Enabled = True
+ End If
+
+ End Sub
+
+
+
+#End Region
+
+#Region " TextBox Events "
+
+ Private Sub tbPath_MouseEnter(ByVal sender As Object, ByVal e As
+System.EventArgs) Handles tbPath.MouseEnter, tbDatabase.MouseEnter,
+tbPassword.MouseEnter, tbServer.MouseEnter, tbUser.MouseEnter
+ If CType(sender, TextBox).Focused Then
+ SelectAllText = False
+ Else
+ SelectAllText = True
+ End If
+ End Sub
+
+ Private Sub tbDatabase_MouseDown(ByVal sender As Object, ByVal e As
+System.Windows.Forms.MouseEventArgs) Handles tbPath.MouseDown, tbDatabase.
+MouseDown, tbPassword.MouseDown, tbServer.MouseDown, tbUser.MouseDown
+ If SelectAllText Then
+ CType(sender, TextBox).SelectAll()
+ SelectAllText = False
+ End If
+ End Sub
+
+ Private Sub tbDatabase_GotFocus(ByVal sender As Object, ByVal e As
+System.EventArgs) Handles tbPath.GotFocus, tbDatabase.GotFocus, tbPassword.
+GotFocus, tbServer.GotFocus, tbUser.GotFocus
+ CType(sender, TextBox).SelectAll()
+ End Sub
+
+
+#End Region
+
+
+End Class
+-Connection.vb------------------------------------------------------------
+
+Steps to reproduce the problem:
+1. Trying to compile upper file with
+# mbas Connection.vb
+
+
+Actual Results:
+MonoBASIC Compiler 0.96.2.0 - (c)2002, 2003, 2004, 2005 Rafael Teixeira
+--------
+THIS IS AN ALPHA SOFTWARE.
+--------
+Connection.vb(256,40) error BC30451: The name 'Application.StartupPath'
+could not be found in 'Connection'
+Connection.vb(264,0) error BC0176: Static member 'Cancel' cannot be
+accessed with an instance reference, qualify with a type name instead
+Connection.vb(268,11) error BC30451: The name 'Busy' could not be found in
+'Connection'
+Connection.vb(325,0) error BC30002: Cannot find type `Exception'
+Connection.vb(342,0) error BC30002: Cannot find type `Exception'
+Connection.vb(385,26) error BC30002: Cannot find type `TextBox'
+Connection.vb(394,28) error BC30002: Cannot find type `TextBox'
+error BC0000: Exception: System.NullReferenceException: Object reference
+not set to an instance of an object
+in <0x00213> Mono.MonoBASIC.Invocation:DoResolve (Mono.MonoBASIC.
+EmitContext ec)
+in <0x0016b> Mono.MonoBASIC.Expression:Resolve (Mono.MonoBASIC.EmitContext
+ec, ResolveFlags flags)
+in <0x0000f> Mono.MonoBASIC.Expression:Resolve (Mono.MonoBASIC.EmitContext
+ec)
+in <0x0001d> Mono.MonoBASIC.StatementExpression:Resolve (Mono.MonoBASIC.
+EmitContext ec)
+in <0x001ad> Mono.MonoBASIC.Block:Resolve (Mono.MonoBASIC.EmitContext ec)
+in <0x0004c> Mono.MonoBASIC.If:Resolve (Mono.MonoBASIC.EmitContext ec)
+in <0x001ad> Mono.MonoBASIC.Block:Resolve (Mono.MonoBASIC.EmitContext ec)
+in <0x000c1> Mono.MonoBASIC.EmitContext:EmitTopBlock (Mono.MonoBASIC.Block
+block, System.String bname, Mono.MonoBASIC.InternalParameters ip, Location
+loc)
+in <0x0046b> Mono.MonoBASIC.MethodData:Emit (Mono.MonoBASIC.TypeContainer
+parent, Mono.MonoBASIC.Block block, System.Object kind)
+in <0x00031> Mono.MonoBASIC.Method:Emit (Mono.MonoBASIC.TypeContainer
+parent)
+in <0x00236> Mono.MonoBASIC.TypeContainer:Emit ()
+in <0x00303> Mono.MonoBASIC.RootContext:EmitCode ()
+in <0x0001d> Mono.Languages.Driver:EmitCode ()
+in (wrapper delegate-invoke) System.MulticastDelegate:invoke_bool ()
+in <0x000e2> Mono.Languages.Driver:Execute (System.String[] args)
+
+
+Expected Results:
+Success compilation
+
+How often does this happen?
+
+
+Additional Information:
More information about the mono-bugs
mailing list