I've had code working for several years now and I had to upgrade the project to .Net 4. After upgrading the project, I am getting the following error after accessing any method:
There is an error in XML document (1,1) - hexadecimal value 0x1F, is an invalid character. Line 1 position 1.
Here is a sample of the code I'm attempting to run:
Dim ConsumerKey As String = "XXXXXXXXXXXXXXXXXXXXXX"
Dim UserAgentString As String = "TEST Xero Interface (Private App Testing)"
Dim privateCertificate As X509Certificate2 = New X509Certificate2("C:\Data\public_privatekey.pfx", "xxxxxxx")
Dim uConsumerSession As IOAuthSession = New XeroApiPrivateSession(UserAgentString, ConsumerKey, privateCertificate)
Dim uRepository As New Repository(uConsumerSession)
Dim uInvoice As New Model.Invoice
Dim uContact As New Model.Contact
uContact.Name = "ABC Ltd"
uContact.IsCustomer = True
uInvoice.Contact = uContact
uInvoice.Type = "ACCREC"
uInvoice.Date = Now
uInvoice.DueDate = DateAdd(DateInterval.Day, 14, Now)
uInvoice.Status = "DRAFT"
uInvoice.LineAmountTypes = 0
uInvoice.LineItems = New LineItems
Dim uLineItem = New Model.LineItem
uLineItem.Quantity = 1
uLineItem.ItemCode = "TEST TRANS"
uLineItem.Description = "Testing Router"
uLineItem.AccountCode = "400"
uLineItem.UnitAmount = 200
uInvoice.LineItems.Add(uLineItem)
uRepository.Create(Of Model.Invoice)(uInvoice)
What am I doing wrong here? Why did the same code I've used for years stop working?