none
Unsigned assemblies and application running from NAS RRS feed

  • Question

  • I created an in-house utility program that we run from a NAS location. This program loads several unsigned DLLs at runtime (LoadAssembly). The program runs fine most of the time, but from time to time, a user will get a SystemAccessViolation exception (trace shows a call to StrongNameSignatureVerification as the last thing that happened).

    I'm not sure exactly what is going on. Multiple users can be running the program. Like I said, the program runs most of the time.

     
    Tuesday, April 12, 2016 4:26 PM

Answers

  • Hi JRQ,

    >>The program runs fine most of the time, but from time to time, a user will get a SystemAccessViolation exception (trace shows a call to StrongNameSignatureVerification as the last thing that happened).

    Because you mentioned that you get an AccessViolationException, I doubt the problem happened when the application loads assemblies. I suggest you try to load assembly dynamically (in running time) in your application to check if the exception from loading them.

    Note: We cannot allow reference unsigned assemblies from signed assemblies. Otherwise it would beat the purpose of having assembly A signed in the first place.

    In addition, we can check AccessViolationException Class from MSDN. Note in remarks section:

    An AccessViolationException exception can occur only in unsafe managed code or when verifiable managed code interacts with unmanaged code:

    • An access violation that occurs in unsafe managed code can be expressed as either a NullReferenceException exception or an AccessViolationException exception, depending on the platform.

    • An access violation in unmanaged code that bubbles up to managed code is always wrapped in an AccessViolationException exception.

    In either case, you can identify and correct the cause of the AccessViolationException exception as follows:

    Make sure that the memory that you are attempting to access has been allocated.

    An AccessViolationException exception is always thrown by an attempt to access protected memory -- that is, to access memory that is not allocated or that is not owned by a process.

    Automatic memory management is one of the services that the common language runtime provides. If managed code provides the same functionality as your unmanagede code, you may wish to move to managed code to take advantage of this functionality. For more information, see Automatic Memory Management.

    Make sure that the memory that you are attempting to access has not been corrupted.

    If several read or write operations have occurred through bad pointers, memory may be corrupted. This typically occurs when reading or writing to addresses outside of a predefined buffer.

    Best regards,

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, April 13, 2016 2:24 AM