Options

Feature/Exc Reporting SA dlls to be included in installer?

smudasmuda Posts: 24
edited January 22, 2012 1:26AM in SmartAssembly
Hi!

To be able to use Feature and/or Exception reporting the SA dlls seems to be required to redistribute, is that correct?

If they aren't included the SA unhandled exception handler shows up with "Could not load file or assembly 'SmartAssembly.ReportException, Version=6.0.0.0...' or one of its dependecies. The system cannot find the file specified.

The exception itself seems to be coming from one assemby that is only embedded, not merged. (and this i because a problem with de-serialization, which I'll post in a different thread)

Best Regards,

John

Comments

  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    SmartAssembly.ReportException does not need to be distributed with your assembly output. When the build takes place, all of the fuctionality should be added to the assembly during the build process.

    Please see: http://www.red-gate.com/supportcenter/c ... rrors_DLLs
  • Options
    Have you tried this with embedded assemblies (not merged)? I can't get that to work without adding the SA assemblies to the directory.

    When the ReportException get called from the embedded assembly, it failes with
    "Could not load file or assembly 'SmartAssembly.ReportException, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7f465a1c156d4d57' or one of its dependencies. The system cannot find the file specified."

    Best regards,

    John
  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    I think I see now -- you are attempting to put error reporting in a DLL, then embed it into another assembly. If you use ReportException in a DLL, then you probably need to ship the ReportException DLL with your application because unless you use method 2 (add an entry point to the DLL), the embedding of the guts of the error reporting is not done.
  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi, sorry the documentation about this is not very clear, so I had to go back and try it myself --

    If you follow this procedure, the Report method should work without having to include the ReportException DLL.
    • Create a class library project including a method that calls Report() and compile it
    • Run SmartAssembly on the class library DLL, specifying error reporting and entering the project and company name
    • Create a console application, reference the "processed" version of the DLL and call the function in the DLL
    • Compile and run the console application, it will show an SA error dialog

    If I had to guess, I'd say you forgot to enable error reporting when you processed the DLL.
  • Options
    I added more logging and realized the exception occurs during deserialization of an object. I have (with your help) solved the issue:
    http://www.red-gate.com/messageboard/vi ... hp?t=14511

    which means I can now merge the deseralization issue into the main assembly and this problem goes away.

    Thanks for your help!

    Best Regards,

    John
Sign In or Register to comment.