{"action":"created","issue":{"url":"https://api.github.com/repos/pythonnet/pythonnet/issues/155","repository_url":"https://api.github.com/repos/pythonnet/pythonnet","labels_url":"https://api.github.com/repos/pythonnet/pythonnet/issues/155/labels{/name}","comments_url":"https://api.github.com/repos/pythonnet/pythonnet/issues/155/comments","events_url":"https://api.github.com/repos/pythonnet/pythonnet/issues/155/events","html_url":"https://github.com/pythonnet/pythonnet/issues/155","id":134407580,"number":155,"title":"Trying to Integrate Python.Net in ASP.Net App Fails Error: \"Attempted to access an unloaded AppDomain\"","user":{"login":"gatapia","id":135965,"avatar_url":"https://avatars.githubusercontent.com/u/135965?v=3","gravatar_id":"","url":"https://api.github.com/users/gatapia","html_url":"https://github.com/gatapia","followers_url":"https://api.github.com/users/gatapia/followers","following_url":"https://api.github.com/users/gatapia/following{/other_user}","gists_url":"https://api.github.com/users/gatapia/gists{/gist_id}","starred_url":"https://api.github.com/users/gatapia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gatapia/subscriptions","organizations_url":"https://api.github.com/users/gatapia/orgs","repos_url":"https://api.github.com/users/gatapia/repos","events_url":"https://api.github.com/users/gatapia/events{/privacy}","received_events_url":"https://api.github.com/users/gatapia/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-02-17T21:37:23Z","updated_at":"2016-02-18T22:25:49Z","closed_at":null,"body":"Hi All,\r\n\r\nHas anyone had any success in running some python code from an ASP.Net (Web.Api) server?  I have a python module I load on application start and I have a controller that periodically communicates with this module.\r\n\r\nI load the python module with the code taken from PyImportTest.cs file.  And I periodically call this loaded module from Controllers using module.InvokeMethod(...).AdManagedObject(...).\r\n\r\nThis all works great in Tests but under webserver conditions (threading I am assuming) this fails with a: \"Attempted to access an unloaded AppDomain\" error.\r\n\r\nAny pointers?  Is this a threading issue? Can I get back onto the thread that kicked off the python module somehow before calling InvokeMethod?\r\n\r\nOr is this a bug with PythonNet?\r\n"},"comment":{"url":"https://api.github.com/repos/pythonnet/pythonnet/issues/comments/185952260","html_url":"https://github.com/pythonnet/pythonnet/issues/155#issuecomment-185952260","issue_url":"https://api.github.com/repos/pythonnet/pythonnet/issues/155","id":185952260,"user":{"login":"denfromufa","id":7870949,"avatar_url":"https://avatars.githubusercontent.com/u/7870949?v=3","gravatar_id":"","url":"https://api.github.com/users/denfromufa","html_url":"https://github.com/denfromufa","followers_url":"https://api.github.com/users/denfromufa/followers","following_url":"https://api.github.com/users/denfromufa/following{/other_user}","gists_url":"https://api.github.com/users/denfromufa/gists{/gist_id}","starred_url":"https://api.github.com/users/denfromufa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/denfromufa/subscriptions","organizations_url":"https://api.github.com/users/denfromufa/orgs","repos_url":"https://api.github.com/users/denfromufa/repos","events_url":"https://api.github.com/users/denfromufa/events{/privacy}","received_events_url":"https://api.github.com/users/denfromufa/received_events","type":"User","site_admin":false},"created_at":"2016-02-18T22:25:49Z","updated_at":"2016-02-18T22:25:49Z","body":"do you have multiple threads in your app?"}}