Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Security problem generating a DLL in Web Server
Message
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Security problem generating a DLL in Web Server
Divers
Thread ID:
00794494
Message ID:
00794494
Vues:
34
My web system requiere build in runtime a set of functions from a database and build a DLL for later execution of them. This is done mainly with this code:

If lCrearArchivo Then
strings.StrToFile(lcTexto, lcNombre)
'Crear el asembly
Dim Compiler As New Microsoft.VisualBasic.VBCodeProvider()
Dim iCom As ICodeCompiler
Dim oCompilerResult As CompilerResults
Dim Param As New CompilerParameters()
'Organizar los parametros
With Param
.IncludeDebugInformation = True
.OutputAssembly = FArchivoDLL
'Agregar las referencias de assemblys externos
For i = 0 To FReferencuiasAssembly.Count - 1
.ReferencedAssemblies.Add(FReferencuiasAssembly.GetByIndex(i))
Next
End With
iCom = Compiler.CreateCompiler()
If files.File(FArchivoDLL) Then
'IO.File.Delete(FArchivoDLL)
End If

oCompilerResult = iCom.CompileAssemblyFromSource(Param, lcTexto)
'Un error de compilacion??
'If files.File(FArchivoDLL) = False Then
'Throw New IO.FileNotFoundException("No se pudo compilar las funciones del cliente.", FArchivoDLL)
' Throw New Exception(oCompilerResult.Errors.Item(0).ErrorText)
'End If
If oCompilerResult.Errors.HasErrors Then
'Reportar el error
Dim lcMensaje As String

For i = 0 To oCompilerResult.Errors.Count - 1
lcMensaje = lcMensaje + oCompilerResult.Errors(i).ErrorText + " Linea(" + oCompilerResult.Errors(i).Line.ToString() + ") " + vbCrLf
Next

Throw New Exception(lcMensaje + vbCrLf + "Al tratar de compilar las funciones de usuario.")
End If
End If

This work fine in our development computer. Before go to production, we setup a test machine with SBS 2000, and this code show up this error:

=== Pre-bind state information ===
LOG: Where-ref bind. Location = e:\inetpub\wwwroot\ActiveNET\App\Active2000\FuncionesActive2000_2.dll
LOG: Appbase = file:///e:/inetpub/wwwroot/ActiveNet
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===

LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///e:/inetpub/wwwroot/ActiveNET/App/Active2000/FuncionesActive2000_2.dll.

I try this code but not work. Also we put the rigth to read/modify/write to the ASP.NET user and not work.
Dim f2 As New System.Security.Permissions.FileIOPermission(System.Security.Permissions.FileIOPermissionAccess.AllAccess, FArchivoDLL)
f2.AddPathList(Security.Permissions.FileIOPermissionAccess.AllAccess, files.JustPath(FArchivoDLL))


Thanks for your help..
The Life is Beautiful!

Programmer in
Delphi, VS.NET
MCP
Répondre
Fil
Voir

Click here to load this message in the networking platform