none
Error dynamically loading assembly RRS feed

  • Question

  • Hello.

    We've been using our framework which dynamically loads assemblies for a while now, but on this one computer it's failing to load a dll throwing this exception

    AppHost.exe Error: 0 : Exception System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Documents and Settings\s_cteram.NT-NJCTGSIIS01\Local Settings\Application Data\REDI Tech\Primary\REDIAppFW.Core.dll' or one of its dependencies. The data area passed to a system call is too small. (Exception from HRESULT: 0x8007007A)

    File name: 'file:///C:\Documents and Settings\s_cteram.NT-NJCTGSIIS01\Local Settings\Application Data\REDI Tech\Primary\REDIAppFW.Core.dll'

       at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)

       at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)

       at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)

       at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)

       at System.Reflection.Assembly.LoadFrom(String assemblyFile, Evidence securityEvidence)

       at System.Activator.CreateInstanceFromInternal(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)

       at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)

       at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)

       at REDIAppFW.Core.Framework.Resolver.StartCustomAssemblyResolve(AppDomain appDomain) in H:\code\redi\AppFramework\REDIAppFW.Core\src\Framework\Resolver.cs:line 357

       at AppHost.Program.Main(String[] args)

    This is the code:

                Type thisType = typeof(Resolver);
                string thisName = thisType.FullName;
                string assLocation = thisType.Assembly.Location;

                appDomain.CreateInstanceFrom(assLocation, thisName);

    Any idea what this could be?

    Thanks

    Saturday, July 21, 2012 7:57 PM

Answers

  • Check the available memory using the Task Manager.  You don't have enough memory on the computer to run the program.  It is possible that you may need to increase the size of your virtual memory on the computer.

    Does the same erro occur when using an Admin Account on the PC?  an error starting with 0x8 sometime is caused by an access priveledge being wrong, but also can occur when a pointer is null.  It appear that the program requested a allocation of memory and there was insufficient resources to grant the request.  I suspect that a Null pointer was returned when the memory was not available which caused the 0x8 error.


    jdweng

    Saturday, July 21, 2012 8:36 PM

All replies

  • Check the available memory using the Task Manager.  You don't have enough memory on the computer to run the program.  It is possible that you may need to increase the size of your virtual memory on the computer.

    Does the same erro occur when using an Admin Account on the PC?  an error starting with 0x8 sometime is caused by an access priveledge being wrong, but also can occur when a pointer is null.  It appear that the program requested a allocation of memory and there was insufficient resources to grant the request.  I suspect that a Null pointer was returned when the memory was not available which caused the 0x8 error.


    jdweng

    Saturday, July 21, 2012 8:36 PM
  • Actually, someone tried to change the home directory for an account under which this was running so that it does not contain the name of the PC, so instead of using s_cteram.NT-NJCTGSIIS01, I think they tried switching it to s_cteram,  and I think they had reported a successful launch. 

    I will also try switching the path I am passing into the CreateInstaceFrom method into a URI, by creating a new Uri object from the path and passing the value of AbsoluteUri property into the CreateInstanceFrom method.  Will come back with results.

    Thanks, Joel for your help.


    Saturday, July 21, 2012 11:51 PM
  • Hi Feinberg,

    Welcome to the MSDN Forum.

    How about your own way?

    Do you get any update?

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, July 23, 2012 10:15 AM
    Moderator
  • Did not work. 

    What's interesting is that the same path works on my other machine.  This leads me to believe that this is something related to privileges as Joes has suggested in the earlier response.

    Thanks



    Monday, July 23, 2012 7:29 PM
  • Hi Feinberg,

    I am glad to hear you have found the root cause. Congratulations.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, July 24, 2012 3:32 AM
    Moderator