Hi
I've been experimenting with Obfuscar and to be safe I want to run my unit tests first, then obfuscate and rerun the tests to ensure nothing has broken. However after obfuscation of the library being tested I cannot get the dll containing the test code to load in NUnit - it throws a FileNotFound exception for the test code dll, even though I've just selected it, and it can be loaded by ILSpy.
I've created and attached an example which replicates the problem. There are two dlls, the first contains the code I want obfuscating, in this case MyClass with a single static property Value that returns a string. The second dll contains the NUnit test which simply checks the string is what it is expecting.
My Obfuscar configuration is set to obfuscate the first dll, and to ignore the namespace used in the test dll. The configuration file is at packages/Obfuscar.2.0.0.0/tools/test.xml and the obfuscated output written to the Output folder at that location.
If I load the test dll in ILSpy I can see that it has adjusted the call to the obfuscated class as A.A() instead of MyClass.Value, but otherwise appears untouched.
This is using the version of NUint (2.6.3) and Obfuscar (2.0.0) from nuget. You'll need the NUnit binaries from http://nunit.org/index.php?p=download
Thanks
Darren
Comments: It was processed, like I said if you opened ObfuscarTest.Tests.dll after it has been processed by Obfuscar in ILSpy you can see the call to MyClass.Value has been changed to A.A(), so I'm not sure about that mapping.txt file. Rebuilding and testing the project now I get exactly the same output in mapping.txt that you've listed, but the dll is still unable to be loaded in NUnit. Were you able to open your compiled ObfuscarTest.Tests.dll in NUnit 2.6.3 as part of your testing?
I've been experimenting with Obfuscar and to be safe I want to run my unit tests first, then obfuscate and rerun the tests to ensure nothing has broken. However after obfuscation of the library being tested I cannot get the dll containing the test code to load in NUnit - it throws a FileNotFound exception for the test code dll, even though I've just selected it, and it can be loaded by ILSpy.
I've created and attached an example which replicates the problem. There are two dlls, the first contains the code I want obfuscating, in this case MyClass with a single static property Value that returns a string. The second dll contains the NUnit test which simply checks the string is what it is expecting.
My Obfuscar configuration is set to obfuscate the first dll, and to ignore the namespace used in the test dll. The configuration file is at packages/Obfuscar.2.0.0.0/tools/test.xml and the obfuscated output written to the Output folder at that location.
If I load the test dll in ILSpy I can see that it has adjusted the call to the obfuscated class as A.A() instead of MyClass.Value, but otherwise appears untouched.
This is using the version of NUint (2.6.3) and Obfuscar (2.0.0) from nuget. You'll need the NUnit binaries from http://nunit.org/index.php?p=download
Thanks
Darren
Comments: It was processed, like I said if you opened ObfuscarTest.Tests.dll after it has been processed by Obfuscar in ILSpy you can see the call to MyClass.Value has been changed to A.A(), so I'm not sure about that mapping.txt file. Rebuilding and testing the project now I get exactly the same output in mapping.txt that you've listed, but the dll is still unable to be loaded in NUnit. Were you able to open your compiled ObfuscarTest.Tests.dll in NUnit 2.6.3 as part of your testing?