accass violation error on calling a function from a external assembly

  • Thread starter Thread starter j.s.
  • Start date Start date
J

j.s.

hi foklkz, i have a big problem with a vb programm.
the setting:
- one programm P written i vb
- one assembly A written in boo
wich inherits from a class B written in vb and contains three
functions i call from P f1,f2,f3.
- both call functions from different assemblies (A1,_,An)
written in boo or vb and
wich are 'hard' imported to each project.

- if P_DIR is the path to A is found in P_DIR\Plugins.
- A1,_,An is found in P_DIR if just P needs it,
or if P and A need them.
- assemblies just needed by A are found in P_DIR\Plugins
none of them is found in the GAC, because none if them
reached final state.


how to throw a accass violation exception:
-the program creates a new instance of A by
asm = Reflection.Assembly.LoadFrom(dll)
type = asm.GetTypes(index)
connection = System.Activator.CreateInstance(type, params)
P call f1
P call f2, wich returns date, everything ok up to now.
---
P call f3 wich should return some date too.
this throws the accass violation exception
---

i checked peverify for A, P and B and get just this error:
A::___initializer][Offset 0x00000006] The initonly-Feld could not be
changed outside of ".ctor"

for P and B there is no error.

i hope somebody of you can help me.

greatz & thnx
 
hi foklkz, i have a big problem with a vb programm.
the setting:
- one programm P written i vb
- one assembly A written in boo
wich inherits from a class B written in vb and contains three
functions i call from P f1,f2,f3.
- both call functions from different assemblies (A1,_,An)
written in boo or vb and
wich are 'hard' imported to each project.

- if P_DIR is the path to A is found in P_DIR\Plugins.
- A1,_,An is found in P_DIR if just P needs it,
or if P and A need them.
- assemblies just needed by A are found in P_DIR\Plugins
none of them is found in the GAC, because none if them
reached final state.


how to throw a accass violation exception:
-the program creates a new instance of A by
asm = Reflection.Assembly.LoadFrom(dll)
type = asm.GetTypes(index)
connection = System.Activator.CreateInstance(type, params)
P call f1
P call f2, wich returns date, everything ok up to now.
---
P call f3 wich should return some date too.
this throws the accass violation exception
---

i checked peverify for A, P and B and get just this error:
A::___initializer][Offset 0x00000006] The initonly-Feld could not be
changed outside of ".ctor"

Well... Of the top, it looks as if something is attempting to change a
readonly variable in A, after the constructor. Readonly values can only
be initialized when they are declared or in the constructor of the
class.
 
yea, thats what i though first too. but the only readonly vars are set
in the constructor.
and if i try to change a ro-var from the same class i get a compiler
error, right before i try to compile.
the only way where or how the variable could be changed is when i call
f3 but as far as i now doesnt it change any global variable.

greatz Johannes
hi foklkz, i have a big problem with a vb programm.
the setting:
- one programm P written i vb
- one assembly A written in boo
wich inherits from a class B written in vb and contains three
functions i call from P f1,f2,f3.
- both call functions from different assemblies (A1,_,An)
written in boo or vb and
wich are 'hard' imported to each project.
- if P_DIR is the path to A is found in P_DIR\Plugins.
- A1,_,An is found in P_DIR if just P needs it,
or if P and A need them.
- assemblies just needed by A are found in P_DIR\Plugins
none of them is found in the GAC, because none if them
reached final state.
how to throw a accass violation exception:
-the program creates a new instance of A by
asm = Reflection.Assembly.LoadFrom(dll)
type = asm.GetTypes(index)
connection = System.Activator.CreateInstance(type, params)
P call f1
P call f2, wich returns date, everything ok up to now.
i checked peverify for A, P and B and get just this error:
A::___initializer][Offset 0x00000006] The initonly-Feld could not be
changed outside of ".ctor"

Well... Of the top, it looks as if something is attempting to change a
readonly variable in A, after the constructor. Readonly values can only
be initialized when they are declared or in the constructor of the
class.
 
Back
Top