'Changing the path of the generated file from dll

In a WPF (C#) project, I have a Fortran DLL file attached.

The DLL is located in the project directory, which goes to Program Files during installation.

When called, the DLL file generates a file in the project directory.

Is it possible to somehow change the path of the generated file from the DLL? I cannot edit the DLL file. (I would like to move this dll file to a location where no permissions are needed)

When the program is running as Administrator, it works. I want to use the program without Admin permissions.



Solution 1:[1]

"Program Files" folder is read only for normal user. Your App can not generate file on this folder. You have to change path for generated file to other folder with Write rights. To user documents, temp or to hidden system ProgramData\[project] folder. Or install application to user profile (installation per user, not per machine).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1