Hi, I have a problem when loading one of my dll. I have a main class that
would load a winform in another dll using reflection. When I load it using
Assembly.CreateInstance(DLLName.DLLFormName), an exception is thrown with the
message: "Exception has been thrown by the target of an invocation."
?ex.Source
"mscorlib"
?ex.GetType.AssemblyQualifiedName
"System.Reflection.TargetInvocationException, mscorlib, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089"
?ex.StackTrace
" at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder
binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr,
Binder binder, Object[] args, CultureInfo culture, Object[]
activationAttributes)
at System.Reflection.Assembly.CreateInstance(String typeName, Boolean
ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args,
CultureInfo culture, Object[] activationAttributes)
at System.Reflection.Assembly.CreateInstance(String typeName)
at ..."
?ex.GetBaseException
{System.ComponentModel.Win32Exception}
[System.ComponentModel.Win32Exception]:
{System.ComponentModel.Win32Exception}
HelpLink: Nothing
InnerException: Nothing
Message: "Not enough storage is available to process this command"
Source: "System.Drawing"
StackTrace: " at System.Drawing.Icon.Initialize(Int32 width, Int32
height)
at System.Drawing.Icon..ctor(SerializationInfo info, StreamingContext
context)"
TargetSite: {System.Reflection.RuntimeMethodInfo}
As from ex.GetBaseException, I found that it states there is no enough
storage. When I try to remove some code operation (that retrieve lots of
information, create classes, and display in a listview), I no longer have the
problem and the dll/form loads properly. So, is this really that it is a
memory problem and that memory is running low? How can I fix this if I must
have those removed code to run? How does .net actually allocates the memory?
Is it that the memory of the whole computer has been used up, or is that
there is a limited allocation for my program? Would by increasing the virtual
memory, or let it autogrow helps?
Thanks
Eugene 2 45205
Anybody, any idea?
"Eugene" wrote: Hi, I have a problem when loading one of my dll. I have a main class that would load a winform in another dll using reflection. When I load it using Assembly.CreateInstance(DLLName.DLLFormName), an exception is thrown with the message: "Exception has been thrown by the target of an invocation."
?ex.Source "mscorlib"
?ex.GetType.AssemblyQualifiedName "System.Reflection.TargetInvocationException, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
?ex.StackTrace " at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Reflection.Assembly.CreateInstance(String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Reflection.Assembly.CreateInstance(String typeName) at ..."
?ex.GetBaseException {System.ComponentModel.Win32Exception} [System.ComponentModel.Win32Exception]: {System.ComponentModel.Win32Exception} HelpLink: Nothing InnerException: Nothing Message: "Not enough storage is available to process this command" Source: "System.Drawing" StackTrace: " at System.Drawing.Icon.Initialize(Int32 width, Int32 height) at System.Drawing.Icon..ctor(SerializationInfo info, StreamingContext context)" TargetSite: {System.Reflection.RuntimeMethodInfo}
As from ex.GetBaseException, I found that it states there is no enough storage. When I try to remove some code operation (that retrieve lots of information, create classes, and display in a listview), I no longer have the problem and the dll/form loads properly. So, is this really that it is a memory problem and that memory is running low? How can I fix this if I must have those removed code to run? How does .net actually allocates the memory? Is it that the memory of the whole computer has been used up, or is that there is a limited allocation for my program? Would by increasing the virtual memory, or let it autogrow helps?
Thanks Eugene
My guess would be that at the times it blows-up, you are passing bad
values for the icon's height & width (ie, it thinks you want it to
create an massive icon).
When you moved things around, you stoped corrupting these values.
Eugene wrote: Hi, I have a problem when loading one of my dll. I have a main class that would load a winform in another dll using reflection. When I load it using Assembly.CreateInstance(DLLName.DLLFormName), an exception is thrown with the message: "Exception has been thrown by the target of an invocation."
?ex.Source "mscorlib"
?ex.GetType.AssemblyQualifiedName "System.Reflection.TargetInvocationException, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
?ex.StackTrace " at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Reflection.Assembly.CreateInstance(String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Reflection.Assembly.CreateInstance(String typeName) at ..."
?ex.GetBaseException {System.ComponentModel.Win32Exception} [System.ComponentModel.Win32Exception]: {System.ComponentModel.Win32Exception} HelpLink: Nothing InnerException: Nothing Message: "Not enough storage is available to process this command" Source: "System.Drawing" StackTrace: " at System.Drawing.Icon.Initialize(Int32 width, Int32 height) at System.Drawing.Icon..ctor(SerializationInfo info, StreamingContext context)" TargetSite: {System.Reflection.RuntimeMethodInfo}
As from ex.GetBaseException, I found that it states there is no enough storage. When I try to remove some code operation (that retrieve lots of information, create classes, and display in a listview), I no longer have the problem and the dll/form loads properly. So, is this really that it is a memory problem and that memory is running low? How can I fix this if I must have those removed code to run? How does .net actually allocates the memory? Is it that the memory of the whole computer has been used up, or is that there is a limited allocation for my program? Would by increasing the virtual memory, or let it autogrow helps?
Thanks Eugene This discussion thread is closed Replies have been disabled for this discussion. Similar topics
3 posts
views
Thread by Noah |
last post: by
|
reply
views
Thread by Lionel B |
last post: by
|
2 posts
views
Thread by hazz |
last post: by
|
7 posts
views
Thread by hazz |
last post: by
|
6 posts
views
Thread by Chris Newcombe |
last post: by
|
4 posts
views
Thread by Carlitos |
last post: by
|
2 posts
views
Thread by Fabian |
last post: by
|
2 posts
views
Thread by cmay |
last post: by
|
2 posts
views
Thread by Monty |
last post: by
| | | | | | | | | | |