Bug / missing: obfuscation

(Theo) #1

The [assembly: obfuscation] does not react to the parameter PublicMembers := true.

And in the documentation is stated:

This metadata is stored in the .fx file, so that the binary files (such as .dlls, .jars, or .a files) that will eventually be distributed to your end-users only contain the obfuscated names. When targeting .NET or Java (which does not emit .fx files by default), you will want to enable the Create .fx File option in project settings, to enable this.

I can not find this setting anywhere.

(RemObjects) #2

Thanks, logged as bugs://80597

(Carlo Kok) #3

you want PublicTypes, not PublicMembers. (Docs have just been updated to reflect this)

VS or Water?

Water has it here:

Seems VS doesn’t show it, i’ll log. For now: add <CreateFXFile>True</CreateFXFile> to the project file.

(Theo) #4

Where do I add it in the project file?

(Theo) #5

Works :smile:

(Carlo Kok) #6

in the top property group.

(Theo) #7

I do not get an .fx after compile file in Visual Studio

My project file:
buildITDb.elements (4.4 KB)

(Theo) #8

@ck: I see the problem; it is created in the Obj folder, but not copied to the bin folder.

(Theo) #9

I copied the .fx file to the bin folder, but with a project reference only the obfuscated members are visible.
I tried to reference the .fx file instead, but that is not accepted by Visual Studio.

(Theo) #10

@ck: This problem is unrelated.
I have the same problem again; I did now recompile without obfuscation, and the dependent project doesn’t see the namespaces (see my mail to you and Marc).

This one started as soon as I compile the dll with obfuscated public types. The exe did not see the namespaces anymore (as was expected). Copying the fx file to the bin folder did not help. And it does still not see the namespaces after I recompiled the dll without obfuscation.

Removed the reference, compiled (errors of cause), made a project reference again, an now it works again.

(Theo) #11

Summary of the problems left:

  1. Fx file is not copied to the bin (map file is also not copied)
  2. If I use a project reference, the fx file is not used
  3. If I try to reference the fx file itself, I get:

(RemObjects) #12

Thanks, logged as bugs://80600

(Carlo Kok) #13

3 isn’t really a bug per se (the error should just be better); you should reference the dll on .NET.

1 question though; you explicitly mention fx files used not working for project references; does that mean it works if it’s a regular reference?

(Theo) #14

I didn’t try that …

But no, referencing the dll (copied the fx file to the bin first) does also not work.

(RemObjects) #15

bugs://80600 got closed with status fixed.

(Carlo Kok) #16

Both should be fixed.

(RemObjects) #17

bugs://80597 got closed with status fixed.

(Theo) #18

Fix confirmed; fx file is copied and is used for references.

(Theo) #19

Just found another bug: Go to reference does not work when the reference is obfuscated (but mapped by the fx file).
In the output window is logged: Could not find external type

(RemObjects) #20

Thanks, logged as bugs://80643