SmartAssembly error - System.InvalidOperationException
pjagadeesan
Posts: 4
I am trying to obfuscate my web application code. The individual dll's like App_Code and App_global are not an issue. But my application has a merged assembly (App_Web_xxx files merged using aspnet_merge) which is causing an error.
Build Failed:
System.InvalidOperationException: Unknown constant type object
Any ideas and what would cause the error on the merged file. Any help will be appreciated. Thanks.
Build Failed:
System.InvalidOperationException: Unknown constant type object
Any ideas and what would cause the error on the merged file. Any help will be appreciated. Thanks.
Comments
This exception is thrown when there is a value in the Constant metadata table of a type we don't expect. From information in your exception report, it looks like it's a constant specified on a parameter of the EnterData.saveSubCategoryData method in the OESReporting assembly. If you have access to the source code of that assembly, could you post (or send us) the definition of that method and information on how you compiled it, or information on where you got the assembly from?
thanks
SimonC
The method definition was
Protected Function saveSubCategoryData(Optional ByVal selectedIndex = Nothing) As Boolean
I was able to change it to the following, compile and obfuscate.
Protected Function saveSubCategoryData(Optional ByVal selectedIndex As String = Nothing) As Boolean
Thanks again!
FYI - SmartAssembly did not throw an error when the compiled App_Code dll was obfuscated separately.
It only threw an error when I tried to obfuscate the merged assembly
(merged all my App_Web, App_Code dlls to one assembly using aspnet_merge)
Is there anything else I can do to help track this problem. I have not been able to obfuscate our software for sometime and have resorted to sending out 'unprotected' code.
In your case, the input assembly is invalid. The exception table type for one of the methods in the DeployLX.Licensing.V4 assembly is an invalid value (0x2a). The allowed values according to the CLR spec are 0x1, 0x2, 0x40, or 0x80.
This is probably due to existing obfuscation on that assembly. As a workaround, you could try embedding that assembly instead of merging it, or distribute it separately.
I am getting this error when trying to open the SmartAssembly project. Therefore, I am unable to modify the SmartAssembly project without recreating it from scratch (which I am not keen to do). Is there any way of removing this 'merged' assembly by another method?