{"action":"created","issue":{"url":"https://api.github.com/repos/NLua/NLua/issues/176","labels_url":"https://api.github.com/repos/NLua/NLua/issues/176/labels{/name}","comments_url":"https://api.github.com/repos/NLua/NLua/issues/176/comments","events_url":"https://api.github.com/repos/NLua/NLua/issues/176/events","html_url":"https://github.com/NLua/NLua/issues/176","id":100995011,"number":176,"title":"Error \"A .NET exception occured in user-code\" when load any assembly ","user":{"login":"sergeyzalunin","id":11023879,"avatar_url":"https://avatars.githubusercontent.com/u/11023879?v=3","gravatar_id":"","url":"https://api.github.com/users/sergeyzalunin","html_url":"https://github.com/sergeyzalunin","followers_url":"https://api.github.com/users/sergeyzalunin/followers","following_url":"https://api.github.com/users/sergeyzalunin/following{/other_user}","gists_url":"https://api.github.com/users/sergeyzalunin/gists{/gist_id}","starred_url":"https://api.github.com/users/sergeyzalunin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergeyzalunin/subscriptions","organizations_url":"https://api.github.com/users/sergeyzalunin/orgs","repos_url":"https://api.github.com/users/sergeyzalunin/repos","events_url":"https://api.github.com/users/sergeyzalunin/events{/privacy}","received_events_url":"https://api.github.com/users/sergeyzalunin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-14T11:42:25Z","updated_at":"2015-08-17T02:42:55Z","closed_at":null,"body":"```\r\nusing (Lua context = new Lua())\r\n{\r\n     context.LoadCLRPackage();\r\n     string  script = string.Format(\"package.cpath = \\\"{0}\\\" .. package.cpath\", @\"C:\\net assembly directory\\?.dll;\");\r\n     context.DoString(script);\r\n     context.DoString(\"luanet.load_assembly('NotMyNetAssembly')\"); // Here, I get the error \"\"A .NET exception occured in user-code\r\n}\r\n```\r\nAll assemblies compiled in same architecture 'x64'.\r\nHow can I load any assembly?"},"comment":{"url":"https://api.github.com/repos/NLua/NLua/issues/comments/131661810","html_url":"https://github.com/NLua/NLua/issues/176#issuecomment-131661810","issue_url":"https://api.github.com/repos/NLua/NLua/issues/176","id":131661810,"user":{"login":"sergeyzalunin","id":11023879,"avatar_url":"https://avatars.githubusercontent.com/u/11023879?v=3","gravatar_id":"","url":"https://api.github.com/users/sergeyzalunin","html_url":"https://github.com/sergeyzalunin","followers_url":"https://api.github.com/users/sergeyzalunin/followers","following_url":"https://api.github.com/users/sergeyzalunin/following{/other_user}","gists_url":"https://api.github.com/users/sergeyzalunin/gists{/gist_id}","starred_url":"https://api.github.com/users/sergeyzalunin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergeyzalunin/subscriptions","organizations_url":"https://api.github.com/users/sergeyzalunin/orgs","repos_url":"https://api.github.com/users/sergeyzalunin/repos","events_url":"https://api.github.com/users/sergeyzalunin/events{/privacy}","received_events_url":"https://api.github.com/users/sergeyzalunin/received_events","type":"User","site_admin":false},"created_at":"2015-08-17T02:42:55Z","updated_at":"2015-08-17T02:42:55Z","body":"Thank you @viniciusjarina. Your answer was helpful. I patched NLua and using Assembly.LoadFrom. \r\n```\r\nif (File.Exists(assemblyName))\r\n\tassembly = Assembly.LoadFile(assemblyName);\r\nelse\r\n{\r\n\t#if NETFX_CORE\r\n\t\tassembly = Assembly.Load (new AssemblyName (assemblyName));\r\n\t#else\r\n\t\tassembly = Assembly.Load(assemblyName);\r\n\t#endif\r\n}\r\n```"}}