How to absolutely prevent SA from touching a certain class
timothyp
Posts: 13 Bronze 1
There is one class in our project which really shouldn't be touched by SmartAssembly at all,
because as soon as it does, for some reason, it completely breaks that class.
We have configured the SA project to exclude this class from anything SA might do to it,
we have added all the attributes we could find:
We have moved that single file to a separate assembly (which we still have to merge because
of the other assemblies that are merged) and told SA to leave it alone, yet every time after building
the project we find the class has been modified anyway.
because as soon as it does, for some reason, it completely breaks that class.
We have configured the SA project to exclude this class from anything SA might do to it,
we have added all the attributes we could find:
[DoNotObfuscateControlFlow] [DoNotObfuscateType] [DoNotPruneType] [DoNotSealType] [StayPublic] [DoNotEncodeStrings] [DoNotMove] [DoNotObfuscate] [DoNotObfuscateControlFlow] [DoNotPrune]
We have moved that single file to a separate assembly (which we still have to merge because
of the other assemblies that are merged) and told SA to leave it alone, yet every time after building
the project we find the class has been modified anyway.
Tagged:
Comments
After obfuscation all but one method works without issues.
The one that fails is called `ImportAsync` and no matter what attributes we
add or what we configure in SA, the code is always obfuscated to this:
And we really need it to remain untouched by SA.
When running the obfuscated version the exception information is
I can tell you that before and after are quite different.
I've sent you an email from our file server.
Extracting the requested information and preparing that to upload made me think
about the problem and after I sent it I realized what was really going on.
Turns out the issue does indeed happen with SA enabled,
but it's not caused by SA. In fact it was caused by a rookie mistake on our end.
Assuming a call was being awaited while in fact it wasn't. Debug and normal release
builds always worked by accident, timing differences with the SA enabled version caused
the bug to pop up, but that's entirely our fault.
My apologies for the inconvenience.