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

Mono 'The 'ExeConfigFilename' argument cannot be null.' #8

Closed
Martin-Molinero opened this issue Mar 10, 2021 · 3 comments
Closed

Mono 'The 'ExeConfigFilename' argument cannot be null.' #8

Martin-Molinero opened this issue Mar 10, 2021 · 3 comments

Comments

@Martin-Molinero
Copy link

Martin-Molinero commented Mar 10, 2021

Hi all,
We've recently updated QuantConnect/pythonnet#47 to be aligned with https://github.com/pythonnet/pythonnet and started getting the following error

The 'ExeConfigFilename' argument cannot be null.
  at System.Configuration.ExeConfigurationHost.CheckFileMap (System.Configuration.ConfigurationUserLevel level, System.Configuration.ExeConfigurationFileMap map) [0x0001b] in <65bca3ec97b145069173491f1a974cbf>:0 
  at System.Configuration.ExeConfigurationHost.InitForConfiguration (System.String& locationSubPath, System.String& configPath, System.String& locationConfigPath, System.Configuration.Internal.IInternalConfigRoot root, System.Object[] hostInitConfigurationParams) [0x00030] in <65bca3ec97b145069173491f1a974cbf>:0 
  at System.Configuration.InternalConfigurationSystem.InitForConfiguration (System.String& locationConfigPath, System.String& parentConfigPath, System.String& parentLocationConfigPath) [0x00000] in <65bca3ec97b145069173491f1a974cbf>:0 
  at System.Configuration.Configuration..ctor (System.Configuration.InternalConfigurationSystem system, System.String locationSubPath) [0x0001f] in <65bca3ec97b145069173491f1a974cbf>:0 
  at System.Configuration.InternalConfigurationFactory.Create (System.Type typeConfigHost, System.Object[] hostInitConfigurationParams) [0x0000d] in <65bca3ec97b145069173491f1a974cbf>:0 
  at System.Configuration.ConfigurationManager.OpenExeConfigurationInternal (System.Configuration.ConfigurationUserLevel userLevel, System.Reflection.Assembly calling_assembly, System.String exePath) [0x000ef] in <65bca3ec97b145069173491f1a974cbf>:0 
  at System.Configuration.ClientConfigurationSystem.get_Configuration () [0x0000e] in <65bca3ec97b145069173491f1a974cbf>:0 

Steps to reproduce:

from pythonnet import load
from clr import AddReference
AddReference("RestSharp")
from RestSharp import *
client = RestClient("https://www.google.com/")
restsharpResponse = client.Execute(RestRequest())
print(restsharpResponse.ErrorException.InnerException)

I suspect it's related to this new clr-loader, seen some old related issues pythonnet/pythonnet@37a4ea5 & https://stackoverflow.com/questions/35872504/pythonnet-exception-the-execonfigfilename-argument-cannot-be-null .

  • Seems mono_domain_set_config isn't being called anymore? should it be called automatically internally (as before I believe) or we are missing some call for it in? Or is it maybe we are screwing it up in the way we consume it/missing some step

Thanks!

@Martin-Molinero
Copy link
Author

Martin-Molinero commented Mar 10, 2021

From my understanding mono_domain_set_config has to be called, maybe internally setting it 🤔 , see

You need to add a call to mono_domain_set_config. It is not automatic. Though it doesn't really matter what you supply as the config file name it doesn't need to exist.

https://xamarin.github.io/bugzilla-archives/51/51261/bug.html

Edit: using mono 5.12

@C-SELLERS
Copy link
Contributor

Request to close this because of #9

Also if possible can we do a version bump and publish the latest?

@C-SELLERS C-SELLERS mentioned this issue Apr 1, 2021
@filmor
Copy link
Member

filmor commented Apr 4, 2021

Fixed in 0.1.6, thank you very much :)

@filmor filmor closed this as completed Apr 4, 2021
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

Successfully merging a pull request may close this issue.

3 participants