Rank: Newbie
Groups: Registered
Joined: 3/9/2023(UTC) Posts: 8
Thanks: 5 times
|
Hello,
After upgrading to CenterPoint 18, I'm getting an error message when I create the API object (Exception message below). It seems to be having an issue with the encoding for the file where the database connections are stored.
I'm able to use the external api to post transactions (invoices), but for some reason the databrowser is not working. I get the exception on this code:
Dim api As DataAccessAPI = New DataAccessAPI()
Message=Failed to open xml document 'C:\ProgramData\Red Wing Software\CenterPoint\Config\Business\databases.xml' Source=RedWingSoftware.Core.Resources.L0.V1
StackTrace: at RedWingSoftware.CenterPoint.XMLFunctions.OpenXMLFile(XmlDocument xmlDoc, String fileName) at RedWingSoftware.CenterPoint.DbConfigMethods.OpenDatabasesXml(String databasesXML) at RedWingSoftware.CenterPoint.DbConfigMethods..ctor(SettingsFile settingsFile) at RedWingSoftware.CenterPoint.MainCBL.GetDatabaseManager() at RedWingSoftware.CenterPoint.ExternalAPI.BaseExternalAPI.ConfigureDatabaseManager() at RedWingSoftware.CenterPoint.ExternalAPI.BaseExternalAPI.Initialize() at CenterPointDataBrowser.DataAccessAPI.Initialize() at CenterPointDataBrowser.DataAccessAPI..ctor() at AccountingBatchCore.CashRequirementsReport.GetReportData() in C:\Users\mshultz\source\repos\Rees Accounting\AccountingBatchCore\CashRequirementsReport.vb:line 144 at AccountingBatchCore.CashRequirementsReport.Process() in C:\Users\mshultz\source\repos\Rees Accounting\AccountingBatchCore\CashRequirementsReport.vb:line 41 at AccountingBatchCore.Program.Main(String[] args) in C:\Users\mshultz\source\repos\Rees Accounting\AccountingBatchCore\Program.vb:line 16
This exception was originally thrown at this call stack: [External Code]
Inner Exception 1: XmlException: System does not support 'windows-1252' encoding. Line 1, position 31.
Inner Exception 2: ArgumentException: 'windows-1252' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method. (Parameter 'name')
Thoughts?
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 2/28/2018(UTC) Posts: 65 Location: Pennsylvani mostly Was thanked: 9 time(s) in 9 post(s)
|
It looks to me that you can fix this by registering XML encoding in your code. I wasn't running into the error myself because I was running in Service Bureau mode which gets a list of databases from a master database. However, the default way of getting a list of databases is to read in the databases.xml in the location referenced in the error message. I'm only mentioning this as background info. I went to the startup program inserted a line of code right at the top of the Main() method and that seemed to take care of the problem. Here's what that looked like: Code:
static void Main()
{
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
Edited by user Thursday, September 28, 2023 5:57:59 PM(UTC)
| Reason: Not specified
|
1 user thanked tony for this useful post.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 3/9/2023(UTC) Posts: 8
Thanks: 5 times
|
That worked, thank you! That's the only hiccup I've run into with the update. Considering how much of an architectural change it was going from framework to .net, I'm quite impressed!
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The Red Wing Software Developer Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close