Can I get a list of assemblies used by an unlinked app, to seed "Ignore assemblies" list?

I would like to get a complete list of assemblies used by my app with linking turned off. I would like to use it to seed the "Ignore assemblies" list to the linker, with the goal that the output after the linking phase of the build should be the same as if I had not enabled linking at all. With that starting point, I can play the process of elimination game to find which assembly is holding a symbol that is preventing some of my reflection code from working properly.

I had thought that I could look at the output in the debugger where it prints "Loaded assembly:" and collect that list of assemblies. With a little shell script I was able to collect a set of assemblies:

grep "Loaded assembly: " ~/foo.txt |sed 's/Loaded assembly://' |awk -F"/" '{print $NF}'|grep -v "Anonymously Hosted "|sed 's/.dll//'|sed 's/^ //'

The resulting list seems incomplete. The output of the linker is still a smaller app than the unlinked app. I noticed that "mscorlib" wasn't in the debugger spew, so I tacked that on as well.

Any hints or strategies would be much appreciated. I'm primarily interested in Android, if that helps to limit scope at all.

Best Answer

  • Josh.1093Josh.1093 US ✭✭
    Accepted Answer

    A simpler way to get the assembly list is to build an unlinked app with no fast deployment, and get the assembly list from the APK's assemblies directory.

    Unfortunately, in my case, the APK has the same assembly list that I was generating above by looking at debugger output. Something seems to be behaving strangely in the linker - if you exclude all assemblies from linking you'd think you'd get an app of the same size, and no runtime issues. As it turns out, I'm still seeing a 40 KB difference between linked (with full exclusions) and unlinked. One of the assemblies in my app is smaller when it's linked, even if it's in the exclusion list, or if I only link SDK assemblies. Odd!

Answers

  • Josh.1093Josh.1093 USUniversity ✭✭
    Accepted Answer

    A simpler way to get the assembly list is to build an unlinked app with no fast deployment, and get the assembly list from the APK's assemblies directory.

    Unfortunately, in my case, the APK has the same assembly list that I was generating above by looking at debugger output. Something seems to be behaving strangely in the linker - if you exclude all assemblies from linking you'd think you'd get an app of the same size, and no runtime issues. As it turns out, I'm still seeing a 40 KB difference between linked (with full exclusions) and unlinked. One of the assemblies in my app is smaller when it's linked, even if it's in the exclusion list, or if I only link SDK assemblies. Odd!

Sign In or Register to comment.