Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Exception in flask and mod_wsgi app #180

Closed
@danic

Description

@danic

Has anybody managed to successfully run a (non-trivial) Flask app under Apache mod_wsgi using pythonnet ? My app keeps throwing this exception:

"System.TypeInitializationException: The type initializer for 'System.Web.Script.Serialization.JavaScriptSerializer' threw an exception. ---> System.Configuration.ConfigurationErrorsException: Error Initializing the configuration system. ---> System.ArgumentException: The 'ExeConfigFilename' argument cannot be null"

as soon as it tries to use a clr object that deserializes some JSON. Full details here:

http://stackoverflow.com/questions/35872504/pythonnet-exception-the-execonfigfilename-argument-cannot-be-null

On this bug Mono added the mono_domain_set_config API to help with this situation. I don't see that method being called in the Mono code. Neither it seems to be called if I run the code in this other bug through gdb. However the code does not crash, as on the other hand I would expect as my version of Mono does have that bugfix. Still don't quite understand how that bug fix works though if it's not being called. Obviously missing something fairly fundamental here.
Maybe pythonnet PyNet_Init needs to explicitly call mono_domain_set_config ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions