2013-01-18 14 views
3

問題突然出現,我不知道問題出現的原因以及如何解決問題。BC30057:對很多論點

編譯錯誤

說明:該請求提供服務所需資源的編譯過程中出現錯誤。請查看以下具體的錯誤細節並適當修改您的源代碼。

編譯器錯誤信息: BC30057:太多的參數「的Public Sub New(貨號作爲字符串,POLineMatch作爲字符串,ItemNumberPartCode作爲字符串,QuantityInvoiced作爲字符串,UnitPriceInvoiced作爲字符串,擴展價格作爲字符串,ItemTax作爲字符串,注意事項作爲字符串)'。

下面是代碼:

Partial Class Plugins_NonPO_GLCoding 
    Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init 
     If Me.InvoiceItemsDV.Table.Rows.Count > 0 Then 
      For i As Integer = 0 To Me.InvoiceItemsDV.Table.Rows.Count - 1 
       Dim ItemNo As String = Me.NullCheck(Me.InvoiceItemsDV.Table.Rows(i)("ItemNo")) 
       Dim POLineMatch As String = Me.NullCheck(Me.InvoiceItemsDV.Table.Rows(i)("POLineMatch")) 
       Dim ItemNumberPartCode As String = Me.NullCheck(Me.InvoiceItemsDV.Table.Rows(i)("ItemNumberPartCode")) 
       Dim QuantityInvoiced As String = Me.NullCheck(Me.InvoiceItemsDV.Table.Rows(i)("QuantityInvoiced")) 
       Dim UnitPriceInvoiced As String = Me.NullCheck(Me.InvoiceItemsDV.Table.Rows(i)("UnitPriceInvoiced")) 
       Dim ExtendedPrice As String = Me.NullCheck(Me.InvoiceItemsDV.Table.Rows(i)("ExtendedPrice")) 
       Dim GLAccount As String = Me.NullCheck(Me.InvoiceItemsDV.Table.Rows(i)("GLAccount")) 
       Dim ItemTax As String = Me.NullCheck(Me.InvoiceItemsDV.Table.Rows(i)("ItemTax")) 
       Dim Notes As String = Me.NullCheck(Me.InvoiceItemsDV.Table.Rows(i)("Notes")) 
       Dim ItemTaxCode As String = Me.NullCheck(Me.InvoiceItemsDV.Table.Rows(i)("ItemTaxCode")) 
       Dim Department As String = Me.NullCheck(Me.InvoiceItemsDV.Table.Rows(i)("Department")) 
       Dim ShipToCode As String = Me.NullCheck(Me.InvoiceItemsDV.Table.Rows(i)("ShipToCode")) 
       Me.InvoiceItems.Add(New InvoiceItems(ItemNo, POLineMatch, ItemNumberPartCode, QuantityInvoiced, UnitPriceInvoiced, ExtendedPrice, GLAccount, ItemTax, Notes, ItemTaxCode, Department, ShipToCode)) 
      Next 
     End If 
End Sub 
End Class 

Public Class InvoiceItems 
    Private _ItemNo As String 
    Private _POLineMatch As String 
    Private _ItemNumberPartCode As String 
    Private _QuantityInvoiced As String 
    Private _UnitPriceInvoiced As String 
    Private _ExtendedPrice As String 
    Private _GLAccount As String 
    Private _ItemTax As String 
    Private _Notes As String 
    Private _ItemTaxCode As String 
    Private _Department As String 
    Private _ShipToCode As String 
    Public Sub New(ByVal ItemNo As String, ByVal POLineMatch As String, ByVal ItemNumberPartCode As String, ByVal QuantityInvoiced As String, ByVal UnitPriceInvoiced As String, ByVal ExtendedPrice As String, ByVal GLAccount As String, ByVal ItemTax As String, ByVal Notes As String, ByVal ItemTaxCode As String, ByVal Department As String, ByVal ShipToCode As String) 
     Me._ItemNo = ItemNo 
     Me._POLineMatch = POLineMatch 
     Me._ItemNumberPartCode = ItemNumberPartCode 
     Me._QuantityInvoiced = QuantityInvoiced 
     Me._UnitPriceInvoiced = UnitPriceInvoiced 
     Me._ExtendedPrice = ExtendedPrice 
     Me._GLAccount = GLAccount 
     Me._ItemTax = ItemTax 
     Me._Notes = Notes 
     Me._ItemTaxCode = ItemTaxCode 
     Me._Department = Department 
     Me._ShipToCode = ShipToCode 
    End Sub 
    Public Property ItemNo() As String 
     Get 
      Return Me._ItemNo 
     End Get 
     Set(ByVal value As String) 
      Me._ItemNo = value 
     End Set 
    End Property 
' There are too many get sets so i deleted them out and left one for example 
End Class 

一切正常,甚至我的工作重複的機器上一切正常,應該如何工作,這將是這個錯誤彈出的原因嗎?

回答

2

看來你的構造函數是不一樣的:

From error: Public Sub New(ItemNo As String, POLineMatch As String, ItemNumberPartCode As String, QuantityInvoiced As String, UnitPriceInvoiced As String, ExtendedPrice As String, ItemTax As String, Notes As String) 
From code: Public Sub New(ByVal ItemNo As String, ByVal POLineMatch As String, ByVal ItemNumberPartCode As String, ByVal QuantityInvoiced As String, ByVal UnitPriceInvoiced As String, ByVal ExtendedPrice As String, ByVal GLAccount As String, ByVal ItemTax As String, ByVal Notes As String 
          , **ByVal ItemTaxCode As String, ByVal Department As String, ByVal ShipToCode As String**) 

我想你將不得不重新編譯前清理您的解決方案。如果它不工作,找到您在機器上編譯的所有dll,並將其從機器中刪除。可能有一個沒有正確清理的dll。或者你顯示的代碼可能不是你錯誤的原因。

+0

沒有解決方案,它是單獨的文件作爲插件並在運行時編譯,它不能是一個不同的文件。我會檢查是否沒有非法字符。 – skmasq

+0

@skmasq,以防萬一,文件可以更改並得到運行時編譯,那麼可能會將前一個程序集的副本緩存到系統中。重置IIS/Web服務器。我還建議在Windows下的.NET Fx文件夾中清理ASP.NET臨時文件。 – VinayC

+0

我更新了我的問題。 – skmasq