SmartAssembly error - System.InvalidOperationException

.NET obfuscator and automated error reporting

Moderators: Luke Jefferson, melvyn.harbour, dom.smith

SmartAssembly error - System.InvalidOperationException

Postby pjagadeesan » Tue Mar 13, 2012 8:47 pm

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.
pjagadeesan
 
Posts: 3
Joined: Tue Mar 13, 2012 8:37 pm

Postby Simon C » Wed Mar 14, 2012 10:31 am

Sorry you're seeing this problem. We got the exception report you sent in.

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
Simon C
 
Posts: 140
Joined: Tue Feb 26, 2008 4:56 pm
Location: Red Gate Software

Thanks

Postby pjagadeesan » Wed Mar 14, 2012 4:05 pm

Thanks for the info. It helped me to resolve the issue.

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!
pjagadeesan
 
Posts: 3
Joined: Tue Mar 13, 2012 8:37 pm

Postby Simon C » Wed Mar 14, 2012 6:02 pm

Out of interest, which version of the VB compiler are you using? The compilers in VS 2010 and VS 2008 both produce constants that match up with the CLR specification (the Object type breaks the specification, hence the error message)
Simon C
 
Posts: 140
Joined: Tue Feb 26, 2008 4:56 pm
Location: Red Gate Software

Postby pjagadeesan » Thu Mar 15, 2012 3:23 pm

I am using the VS2008 compiler.

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)
pjagadeesan
 
Posts: 3
Joined: Tue Mar 13, 2012 8:37 pm

Postby codecutter » Mon Apr 02, 2012 11:22 am

I'm also trying to run a project that was running in earlier versions of SmartAssembly. However, I am also getting a similar error. I have also upgraded to VS 2010. Error reports should have been sent.

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.
Doug Krawec
codecutter
 
Posts: 4
Joined: Wed Jul 04, 2007 11:44 pm

Postby Simon C » Mon Apr 02, 2012 11:40 am

We've got your error reports.

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.
Simon C
 
Posts: 140
Joined: Tue Feb 26, 2008 4:56 pm
Location: Red Gate Software

Postby codecutter » Mon Apr 02, 2012 11:55 am

Thank you for the quick reply.

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?
Doug Krawec
codecutter
 
Posts: 4
Joined: Wed Jul 04, 2007 11:44 pm

Postby Simon C » Mon Apr 02, 2012 12:03 pm

You could edit the saproj in a text editor and simply remove the <Assembly> xml element for that assembly, then try and reload the project.
Simon C
 
Posts: 140
Joined: Tue Feb 26, 2008 4:56 pm
Location: Red Gate Software


Return to SmartAssembly 6

Who is online

Users browsing this forum: No registered users and 0 guests