question

Rinaldo-4034 avatar image
0 Votes"
Rinaldo-4034 asked Rinaldo-4034 answered

<variable) does not contain a defenition for <variabel>

Hi,

I have the following error I can't resolve
'PaymentMeans' does not contain a definition for 'dueDateField' and no accessible extension method 'dueDateField' accepting a first argument of type 'PaymentMeans' could be found (are you missing a using directive or an assembly reference?) XMLublreader

I attempt to make a variable in a getter and setter 'dueDateField' The code is this:

 [System.Xml.Serialization.XmlElementAttribute(Namespace = "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2", DataType = "date")]
         public System.DateTime PaymentDueDate
         {
             get
             {
                 return this.paymentDueDateField;
             }
             set
             {
                 this.paymentDueDateField = value;
             }
         }
    
         [System.Xml.Serialization.XmlElementAttribute(Namespace = "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2", DataType = "date")]
         public System.DateTime DueDate
         {
             get
             {
                 return this.dueDateField;
             }
             set
             {
                 this.dueDateField = value;
             }
         }
    
 // Declaration
    
  public partial class PaymentMeans  
     {
    
         private string paymentMeansCodeField;
    
         private System.DateTime paymentDueDateField;
    
         private System.DateTime DuedateField;

I see that paymentDueFiled is grayed and DueDateField is black.

If more information needed I am glad to provide it.
It was a XML file which is converted to CLASSes by VS paste special

dotnet-csharp
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Viorel-1 avatar image
0 Votes"
Viorel-1 answered

Make sure that the shown class that defines the DueDate property also contains the dueDateField field, respecting case-sensitivity of C# language.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Rinaldo-4034 avatar image
0 Votes"
Rinaldo-4034 answered

It was indeed the capital letter. So easy to overlook.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.