Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DirectoryNotFoundException ConnectorIcons\connectors.json #139

Open
keinMEME opened this issue Feb 28, 2024 · 2 comments
Open

DirectoryNotFoundException ConnectorIcons\connectors.json #139

keinMEME opened this issue Feb 28, 2024 · 2 comments

Comments

@keinMEME
Copy link

Describe the bug
I've tried @a1dancole's CLI extension with the following parameters:
dotnet run --project PowerDocu.GUI\PowerDocu.GUI.csproj -- --updateIcons="true"

It throws an System.IO.DirectoryNotFoundException, because the connectorIcons directory is missing. I looked the folder up in the windows file explorer. The message is correct, the expected folders do not exist yet.

I also ran the code in debugger mode without parameters. This time it worked. I figured out that the reason is that the folder creation only happens when I run the powerdocu in "gui mode", so I narrowed down the exact code snippet (see below).

Since I know what's wrong, it's not hard to work around the problem. But I would consider this an easy fix and hope it will be fixed in the next release.

Further descriptions
Terminal-Logs:

Updating Connectors list, please wait.
An error occured while trying to update the connector list:
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\xy\AppData\Roaming\PowerDocu.GUI\ConnectorIcons\connectors.json'.
at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
at System.IO.File.OpenHandle(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
at PowerDocu.Common.ConnectorHelper.UpdateConnectorIcons() in C:\Users\xy\lmn\xyz\abc\modules\PowerDocu.Common\PowerDocu.Common\ConnectorHelper.cs:line 102

Here is the Code-Snippet. It crashes because of the "folderpath" variable. Those directories weren't created in "CLI-mode"
image
image

Here is the code snippet where the directory is created:
File: PowerDocu.GUI\PowerDocuForm.Designer.cs
image

To Reproduce
Steps to reproduce the behavior:

  1. Just Delete the folder "PowerDocu_GUI" from "../AppData/Roaming"
  2. Then run the project in the terminal: dotnet run --project PowerDocu.GUI\PowerDocu.GUI.csproj -- --updateIcons="true"

Expected behavior
I would expect that i can run the project without errors in the cli-mode and don't have to run it in the GUI-mode first.

@modery
Copy link
Owner

modery commented Feb 29, 2024

Hi @keinMEME , thank you for the detailed error report!
It is indeed a simple fix, added the relevant code already (modery/PowerDocu.Common@8974c02). Will be part of the next release, which I hope will be ready within the next week

@modery
Copy link
Owner

modery commented Jul 13, 2024

Hi, this has been fixed in today's 2.0.1 release. Can you confirm if you still get the error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants