I cannot write a file that is in ProgramData using config.Save()

Solution for I cannot write a file that is in ProgramData using config.Save()
is Given Below:

I need to save values on my dll.config, but I have a problem with the user permissions. Is it possible to force this, to achieve the result I want? I know it is not ideal, but my dll.config file is un ProgramData. The idea is not moved from that location.

This is the .cs file:

public static void SetValue(string key, string value)
{
     
    Configuration config = ConfigurationManager.OpenExeConfiguration(System.Reflection.Assembly.GetExecutingAssembly().Location);
    config.AppSettings.Settings[key].Value = value;
    config.Save(ConfigurationSaveMode.Full, true);
      
}

And this is the .xaml file:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/></startup>
  <appSettings>
    <add key="key1" value="my value"/>
    <add key="key2" value="my value"/>
  </appSettings>
</configuration>

After Save the file, “Access to the path is denied”

Anyone could help me?