Acces is denied: When I load a generated DLL..

M

Mamcx

My system build in runtime a dll of functions (writed by the users), and i
need to plug them inside the system for call this functions.
This is part of the code

If FEngine.Compile() Then

'FEngine.SaveCompiledState(FEngine.Item

FEngine.Run()

' Get the type from the assembly

ModType = FEngine.Assembly.GetType(FEngine.RootNamespace + ".scriptcode",
True, True)

' Obtener el metodo

method = ModType.GetMethod("EvaluarFuncion")

'Agregar parametros

If IsNothing(Parametros) = False Then

ReDim Argumentos(Parametros.Count - 1)

Dim oEntrada As DictionaryEntry

i = Parametros.Count - 1

For Each oEntrada In Parametros

Argumentos(i) = oEntrada.Value

i = i - 1

Next

End If

oResultado = method.Invoke(Nothing, Argumentos)
'=====ERROR:................................................................
..HERE

lError = False

Return oResultado

End If

I can generate in disk rigth the DLL but when i try to call a single
funtion, this error appear:


Assembly Load Trace: The following information can be helpful to determine
why the assembly 'VFPToolkitNET_VB' could not be loaded.


=== Pre-bind state information ===
LOG: DisplayName = VFPToolkitNET_VB, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///D:/Proyectos/ActiveNet/SitioWeb
LOG: Initial PrivatePath = bin
Calling assembly : FuncionesActive2000_2, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null.
===

LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Post-policy reference: VFPToolkitNET_VB, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/activenet/4596655c/6c177962/VFPToolkitNET_VB.DLL.
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/activenet/4596655c/6c177962/VFPToolkitNET_VB/VFPToolkitNET_VB.DLL.
LOG: Attempting download of new URL
file:///D:/Proyectos/ActiveNet/SitioWeb/bin/VFPToolkitNET_VB.DLL.



Stack Trace:


[FileLoadException: Access is denied: 'VFPToolkitNET_VB'.]
FuncionesActive2000_2.ENCABEZADO_FACTURASMESValorPorDefecto() +0

[TargetInvocationException: Exception has been thrown by the target of an
invocation.]
System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess) +0
System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture, Boolean verifyAccess) +422
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +23
System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +14
srvConstructorFormsNET.TScriptVB.Evaluar(String NombreFuncion, Hashtable
Parametros, Object& oFuncion) in
D:\Proyectos\Clases\srvConstructorFormsNET\TScriptVB.vb:119
srvConstructorFormsNET.TDataManager.ResolverFuncion(String lstrNombre,
Object ValorPorDefecto, Char TipoDatos) in
D:\Proyectos\Clases\srvConstructorFormsNET\TDataManager.vb:363
srvConstructorFormsNET.srvConstructorFormsNET.TAdminForms.Nuevo() in
D:\Proyectos\Clases\srvConstructorFormsNET\BuildFormsNET.vb:718
ActiveNet.BarraNavegacion.btnNuevo_Click(Object sender,
ImageClickEventArgs e) in
D:\Proyectos\ActiveNet\SitioWeb\BarraNavegacion.ascx.vb:85
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e)

System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.Ra
isePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,233
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top