BlackbirdSQL / Firebird-DDEX-SqlEditor

Firebird DDEX 2.0 with SqlEditor NETProvider
Other
7 stars 1 forks source link

Open a table in designer causes messagebox "Illegal characters in path" #82

Closed MagicAndre1981 closed 2 months ago

MagicAndre1981 commented 2 months ago

After I figured out how to add a database to Server explorer (#81) I have a new issue. When I open a table in designer

image

I get this message:

image

I don't have a solution open and only tried to check if the database can be accessed.

I've enabled the diag logger option but get no extra details.

BlackbirdSQL commented 2 months ago

The issue with the empty string is resolved in the next release. See #81. I am unable to replicate your second issue after you have opened the table in the designer, with and without a solution open. I will upload a patch for #81 in the next few hours and suggest you delete the connection, then close and reopen Visual Studio, and then add the the database using the "working" file dialog to select the database file, and then retest it. It is important to close and reopen Visual Studio before recreating the connection to be sure the deleted connection is not being reused. This would not normally be an issue but we want to be sure we're testing on a completely new connection.

I will let you know as soon as the update is uploaded.

MagicAndre1981 commented 2 months ago

The issue with the empty string is resolved in the next release. See #81. I am unable to replicate your second issue after you have opened the table in the designer, with and without a solution open.

ok, looks like this comes from an ArgumentException in System.IO.Path.GetExtension(System.String) in BlackbirdSql.Controller.dll!BlackbirdSql.Controller.ControllerEventsManager::OnBeforeDocumentWindowShow which is this call:

string ext = Path.GetExtension(docInfo.Moniker);

image

image

The ETW code looks wired you use and I was not able to capture the data with wpr.exe and my wprp profile file, so I only found the .net exception and it was still helpful even without your ETW events.

I use EventSource to define my provider which I can capture easily with this entry in my wprp file:

<EventProvider Id="MyEventSource" Name="*MyEventSource" Stack="true"/>

BlackbirdSQL commented 2 months ago

Yes. I want to clear out the MS SqlServer etw because it's mostly redundant for Firebird, so it's unhooked atm. It needs a rewrite to something much simpler. Path.GetExtension(docInfo.Moniker) is a handled expected exception so the issue shouldn't be there; but the Path class is used extensively elsewhere and possibly throwing an unhandled exception, so that will be a good place to start. From your screenshots it looks like the error is appearing after the designer is open, because that is a Microsoft package which may explain why you're not able to pick up anything? It could be swallowing up exceptions thrown by BlackbirdSql. If possible, don't delete the connection that's giving problems so that we can use it as a reference. We can create a new distinct connection using the Application Name connection parameter to test on.

BlackbirdSQL commented 2 months ago

Okay I've uploaded to VSIX Gallery. Not exactly sure how it works but it is appearing in the feed. The Path class now has wrappers for all methods that work on a supplied path so you shouldn't see any exceptions. The paths are cleaned in the wrapper methods so if there are any spurious common non-printable characters they'll be removed. Could you give it a shot a let me know?

MagicAndre1981 commented 2 months ago

The message was still there, but the callstack now differed. I was now able to see that the extension from syncfusion (MAUI, Xamarin) caused it.

Sorry for the trouble.

BlackbirdSQL commented 2 months ago

No, it's no trouble at all. Your input is valued. If there's anything you'd like to see improved or added to the extension, let me know and I'll see if it can be done.