I included both a VS2010 and a VS2012 project. It occurs with both, even after setting obfuscation support to true in vs2010.

Again, it occurs even if PostSharp doesn't actually do anything... the example above illustrates this.

UPDATE:

According to dotPeek the non-obfuscated assembly also has the questionmark-icons even if PostSharp didn't handle the assembly (though it doesn't if the postsharp library is removed entirely). Regardless, the issue does not occur if I build the Caller referencing said assembly. It also doesn't happen if I obfuscate that assembly, only PostSharp (with an un-used aspect) + SmartAssembly makes it occur.

Not sure what it is that SA does that makes the Caller mess up.

UPDATE 2:

Ok, possibly even more interesting, if I first compile the Caller using the obfuscated version of the library that is not handled by PostSharp, and then swap that library out with the Obfuscated+PostSharp handled version, the program runs fine.

But when I compile the Caller using the latter library as a direct reference, and then swap it out with the former, it still crashes.

Note that the Caller doesn't have any PostSharp code and isn't handled by it at all, and that I'm also not obfuscating the Caller.

How weird is this!?

To summarize----------------------------------------
Does not occur when:

-Compile Caller with reference to library that has PostSharp Reference
-Compile Caller with reference to library that has PostSharp Reference + Aspect
-Compile with either of those 2 and then swap the library with their obfuscated versions.

Does occur when:

-Compile Caller with reference to library that has PostSharp Reference + Obfuscation
-Compile Caller with reference to library that has PostSharp Reference + Aspect + Obfuscation
-Compile with either of those 2 and then swap the library with their non-obfuscated versions.----------------------------------------

Also does not occur when PostSharp reference is removed entirely and the library is then obfuscated and used for compiling the Caller (as expected ofc)

We have also improved support for Windows Phone 7.1 and Windows Phone 7.5, SQL CLR assemblies and assemblies using PostSharp.

Brian Donahue wrote:But we have some information that it *may* work if you use PostSharp before you use SmartAssembly. I guess you can give that a try.

But that's what I'm already doing. I'm compiling the library with Postsharp enabled, I then obfuscate that library and reference it from the main assembly (Caller) which doesn't use PostSharp at all.

Weirdest of all is that it works fine if I compile the Caller using the non-obfuscated library, and then swap that dll file out with the obfuscated version. This means it's an issue with compiling using an obfuscated library rather than an issue with the library itself.

There seems to be something about the SA + PostSharp combo that makes the Caller mess up constants in the library at compile time.