ArgumentOutOfRangeException thrown in GUI, cannot find dependent 3rd party assembly with MSBuild

SethSeth Posts: 15 Bronze 1
Hello,

I am having an issue when
Tagged:

Comments

  • SethSeth Posts: 15 Bronze 1
    Whoops, hit enter on accident.

    I am having an issue with one assembly I'm trying to obfuscate. When I build it using the GUI, I get an ArgumentOutOfRangeException (I see it as an error message while it's running the obfuscation, and I see it in the SmartAssembly log file - see attached). I'm not sure if this is my code that's creating the exception, or SmartAssembly's.

    The weird part is that when I build my source code using the MSBuild integration I have set up, I get a different error:
    error : SmartAssembly build failed:
    error : Cannot find dependency 'BusinessObjects.Licensing.KeycodeDecoder, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304', which is required for assembly:
    error : CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304
    

    This dependency is not set up to be merged or embedded for this .dll, and the project references this dependency by pointing to its installed location on the machine.

    Questions:
    1. Are these two errors related?
    2. If I embed the dependency in the .saproj, will this get rid of the second error?
    3. Will getting rid of the second error get rid of the first error?
  • SethSeth Posts: 15 Bronze 1
    After much testing, it seems that the issue is the BusinessObject.Licensing.KeycodeDecoder.dll is not a .NET managed assembly, which means that SmartAssembly has difficulty (if not outright refusal) processing it. It also seems the two issues were related, since solving the first solved the second one.

    We got around the issue by making all CrystalReports dlls referenced by our code to be ignored, via the "NotAvailable" <Assembly> attribute in the .saproj file. This causes the MSBuild to pass, and performing a clean/rebuild on the dll in Visual Studio before running the build in SA GUI removes the second issue.
  • Jessica RJessica R Posts: 1,319 Rose Gold 4
    Thanks for update the post here @Seth, I'm glad to hear you've got things working!

    To clarify the NotAvailable attribute, it would look like this in an saproj:
    <Assembly AssemblyName="BusinessObjects.Licensing.KeycodeDecoder, Culture=neutral, PublicKeyToken=null" NotAvailable="1">
    

    Jessica Ramos | Product Support Engineer | Redgate Software

    Have you visited our Help Center?


Sign In or Register to comment.