Save to a shared path will cause fatal error
It's a Nice tool. Only noticed one problem.
Save file to a windows shared path such as \\192.168.1.43\shared will cause a fatal error. It may be the issue of file utils.
I have to change the code , save icon to temp path first, and then copy to destination.
Thanks for your report! 👍
~It is much more likely that a function PathEx.Combine that I wrote is causing this problem. This function combines paths in a very flexible way, allows environment variables and can also fix broken paths. Anyway, thanks to you, I now noticed that I may not have considered network paths. In most scenarios, it wasn't even necessary, to be honest. But somehow shameful that it didn't even cross my mind. It is therefore possible that this function has a problem with the two backslashes at the beginning, or that no drive letter is specified and then does not change the path as it would be necessary...~
So thank you very much for your report! 👍 I will definitely check this out! 😉
EDIT:
I'm not even sure if there is a problem in .NET itself, or if it has something to do with the Windows permissions. For example, Windows could deny such functions if a program is unsigned. Software certificates are usually too expensive for such small, free open-source projects. I've noticed similar problems with other unsigned software.
The funny thing is that you can often bypass such restrictions simply with Command Prompt. So if I were to say in my program that it should first save it somewhere on the hard disk and send a move command to cmd.exe, then it suddenly works. However, I don't know if I want to solve it this way. Maybe I'll find a more elegant solution.
It's interesting to read your detailed analyze. As you said, It's likely be something with the path arg check logic, so I just commented the check function call as a temporary solutions few days ago. (or save to temp path and copy to destination), cause some one is waiting to use. In fact , myself rarely check path format.Framework or system always do it correctly, so I just catch exception and show it.
As to the cert, I don't get it . Got no problem with it, whether sign it or not. Maybe you mentioned it as another problem example?
Sorry for the very late reply... 😌
My family has grown and we've done a lot of home renovations too. This left little time for my private projects. 🤯
Another problem is that I switched to Linux a long time ago. So I don't have a qualified Windows test case for this kind of issue. I thought about doing this with virtual machines, but I was very unmotivated to set them up, to be honest. I don't want to invest too much effort in old .NET Framework projects as long as there is no critical problem. Because I plan to port this application to .NET Core. I can't say when exactly, but I've already started porting my own utility library. I use it in almost all of my .NET Framework projects. Therefore it makes the most sense to port this application only after I have already ported the dependent functions of my library.
However, some parts of the library are more than 10 years old and the logic has not been changed. I take this opportunity now to rewrite all of the code. I also delete old features or add new ones.
I have several goals that have top priority:
- Cross-platform support.
- Strong test cases for almost every single function, no matter how small.
- Subdivision of different areas into different modules, i.e. projects.
- Performance tweaks whenever it's worth it, which means I have to write a lot more code as well.
- A good example would be CRC computing in my Crypto class, which I have already ported. The code in my .NET Framework class is a few lines long and may even look quite elegant. In the .NET Core class, the code is 20 times larger, which increase the performance by up to 10000% in comparison.
But unfortunately it takes a while if I want to achieve all of my goals! 😅
Only that you and others know what's going on and that I haven't forgotten this issue! 😉
Should be fixed in a6ce3257763e049686429e69ecee382f1dc7108f