{"action":"created","issue":{"url":"https://api.github.com/repos/nunit/nunit/issues/654","labels_url":"https://api.github.com/repos/nunit/nunit/issues/654/labels{/name}","comments_url":"https://api.github.com/repos/nunit/nunit/issues/654/comments","events_url":"https://api.github.com/repos/nunit/nunit/issues/654/events","html_url":"https://github.com/nunit/nunit/issues/654","id":76177805,"number":654,"title":"ReflectionOnlyLoad and ReflectionOnlyLoadFrom","user":{"login":"oznetmaster","id":5798625,"avatar_url":"https://avatars.githubusercontent.com/u/5798625?v=3","gravatar_id":"","url":"https://api.github.com/users/oznetmaster","html_url":"https://github.com/oznetmaster","followers_url":"https://api.github.com/users/oznetmaster/followers","following_url":"https://api.github.com/users/oznetmaster/following{/other_user}","gists_url":"https://api.github.com/users/oznetmaster/gists{/gist_id}","starred_url":"https://api.github.com/users/oznetmaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oznetmaster/subscriptions","organizations_url":"https://api.github.com/users/oznetmaster/orgs","repos_url":"https://api.github.com/users/oznetmaster/repos","events_url":"https://api.github.com/users/oznetmaster/events{/privacy}","received_events_url":"https://api.github.com/users/oznetmaster/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nunit/nunit/labels/is:enhancement","name":"is:enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/nunit/nunit/labels/pri:normal","name":"pri:normal","color":"0052cc"}],"state":"open","locked":false,"assignee":{"login":"CharliePoole","id":2678661,"avatar_url":"https://avatars.githubusercontent.com/u/2678661?v=3","gravatar_id":"","url":"https://api.github.com/users/CharliePoole","html_url":"https://github.com/CharliePoole","followers_url":"https://api.github.com/users/CharliePoole/followers","following_url":"https://api.github.com/users/CharliePoole/following{/other_user}","gists_url":"https://api.github.com/users/CharliePoole/gists{/gist_id}","starred_url":"https://api.github.com/users/CharliePoole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CharliePoole/subscriptions","organizations_url":"https://api.github.com/users/CharliePoole/orgs","repos_url":"https://api.github.com/users/CharliePoole/repos","events_url":"https://api.github.com/users/CharliePoole/events{/privacy}","received_events_url":"https://api.github.com/users/CharliePoole/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/nunit/nunit/milestones/13","html_url":"https://github.com/nunit/nunit/milestones/3.0Beta4","labels_url":"https://api.github.com/repos/nunit/nunit/milestones/13/labels","id":1173447,"number":13,"title":"3.0Beta4","description":"","creator":{"login":"CharliePoole","id":2678661,"avatar_url":"https://avatars.githubusercontent.com/u/2678661?v=3","gravatar_id":"","url":"https://api.github.com/users/CharliePoole","html_url":"https://github.com/CharliePoole","followers_url":"https://api.github.com/users/CharliePoole/followers","following_url":"https://api.github.com/users/CharliePoole/following{/other_user}","gists_url":"https://api.github.com/users/CharliePoole/gists{/gist_id}","starred_url":"https://api.github.com/users/CharliePoole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CharliePoole/subscriptions","organizations_url":"https://api.github.com/users/CharliePoole/orgs","repos_url":"https://api.github.com/users/CharliePoole/repos","events_url":"https://api.github.com/users/CharliePoole/events{/privacy}","received_events_url":"https://api.github.com/users/CharliePoole/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":1,"state":"open","created_at":"2015-06-20T12:09:30Z","updated_at":"2015-07-18T14:16:39Z","due_on":"2015-08-15T04:00:00Z","closed_at":null},"comments":22,"created_at":"2015-05-14T00:37:06Z","updated_at":"2015-07-18T14:22:00Z","closed_at":null,"body":"These Assembly class methods are called in nunit.engine, nunit.engine.api, and mono-addins.\r\n\r\nThey load the specified assembly into the reflection-only context of the current AppDomain.  Assemblies that are loaded in this way remain in memory until the AppDomain is unloaded, which in all of these cases appears to be when the engine terminates.\r\n\r\nThis seemingly can result in the same assembly being loaded twice (or more?) into memory.  If it is only probed, and never actually loaded into an execution context for some reason, it just sits there using memory.\r\n\r\nThese RelectionOnlyLoad methods are called to obtain very small amounts of information from the assembly.  Version information, assembly references.\r\n\r\nIn the CF version of the core-engine, I had to replace these calls because CF does not support them.  I initially used a stripped down version of mono.cecil, but have recently found a different open source library (asmex.fileviewer) that does the same thing and is even smaller.\r\n\r\nUsing this library (or any similar one) is required for the CF build.  However, I am wondering if this should be used for all builds.  The reason is that it is file based.  It opens the assembly as a file, reads the necessary information, and then closes the file.  The information itself is totally disposable after it is used.  Hence, no potential memory leaks or memory bloat.\r\n\r\nI am further stripping the library that I am using to only provide the exact information required by NUnit, so it should get even smaller and faster.  Currently, it is only about 30K + data.\r\n\r\n(Actually nunit.engine contains a class AssemblyReader which does this for some header information, but not all necessary information).\r\n"},"comment":{"url":"https://api.github.com/repos/nunit/nunit/issues/comments/122548627","html_url":"https://github.com/nunit/nunit/issues/654#issuecomment-122548627","issue_url":"https://api.github.com/repos/nunit/nunit/issues/654","id":122548627,"user":{"login":"CharliePoole","id":2678661,"avatar_url":"https://avatars.githubusercontent.com/u/2678661?v=3","gravatar_id":"","url":"https://api.github.com/users/CharliePoole","html_url":"https://github.com/CharliePoole","followers_url":"https://api.github.com/users/CharliePoole/followers","following_url":"https://api.github.com/users/CharliePoole/following{/other_user}","gists_url":"https://api.github.com/users/CharliePoole/gists{/gist_id}","starred_url":"https://api.github.com/users/CharliePoole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CharliePoole/subscriptions","organizations_url":"https://api.github.com/users/CharliePoole/orgs","repos_url":"https://api.github.com/users/CharliePoole/repos","events_url":"https://api.github.com/users/CharliePoole/events{/privacy}","received_events_url":"https://api.github.com/users/CharliePoole/received_events","type":"User","site_admin":false},"created_at":"2015-07-18T14:22:00Z","updated_at":"2015-07-18T14:22:00Z","body":"I have changed this to milestone beta-4 because I think we need to resolve it sooner rather than later.\r\n\r\n@oznetmaster I guess we had a misunderstanding about your taking on the issue - I removed your name and added mine as the assignee. Please keep contributing your ideas.\r\n\r\nI think my next step is to create a spike that uses cecil."}}