Blackslot blog

ASP.NET con IIS 7.5 y Plesk 9.3

Escrito por Sergio el 03-04-2010

Hemos detectado el siguiente problema tras instalar Plesk 9.3 sobre Windows Server 2008 R2.


 Server Error in '/mssql' Application.
 --------------------------------------------------------------------------------

 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
 Description: An unhandled exception occurred during the execution of
 the current web request. Please review the stack trace for more
 information about the error and where it originated in the code.

 Exception Details: System.UnauthorizedAccessException: Access is
 denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

 ASP.NET is not authorized to access the requested resource. Consider
 granting access rights to the resource to the ASP.NET request
 identity. ASP.NET has a base process identity (typically
 {MACHINE}ASPNET on IIS 5 or Network Service on IIS 6) that is used if
 the application is not impersonating. If the application is
 impersonating via , the identity will be
 the anonymous user (typically IUSR_MACHINENAME) or the authenticated
 request user.

 To grant ASP.NET access to a file, right-click the file in Explorer,
 choose "Properties" and select the Security tab. Click "Add" to add
 the appropriate user or group. Highlight the ASP.NET account, and
 check the boxes for the desired access.

 Source Error:

 An unhandled exception was generated during the execution of the
 current web request. Information regarding the origin and location of
 the exception can be identified using the exception stack trace below.

 Stack Trace:

 [UnauthorizedAccessException: Access is denied. (Exception from
 HRESULT: 0x80070005 (E_ACCESSDENIED))]

 [FileLoadException: Could not load file or assembly
 'System.ServiceModel, Version=3.0.0.0, Culture=neutral,
 PublicKeyToken=b77a5c561934e089' or one of its dependencies. Access is
 denied.]
 System.Reflection.Assembly._nLoad(AssemblyName fileName, String
 codeBase, Evidence assemblySecurity, Assembly locationHint,
 StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean
 forIntrospection) +0
 System.Reflection.Assembly.nLoad(AssemblyName fileName, String
 codeBase, Evidence assemblySecurity, Assembly locationHint,
 StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean
 forIntrospection) +43
 System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
 Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
 forIntrospection) +127
 System.Reflection.Assembly.InternalLoad(String assemblyString,
 Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
 forIntrospection) +142
 System.Reflection.Assembly.Load(String assemblyString) +28

 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
 assemblyName, Boolean starDirective) +46

 [ConfigurationErrorsException: Could not load file or assembly
 'System.ServiceModel, Version=3.0.0.0, Culture=neutral,
 PublicKeyToken=b77a5c561934e089' or one of its dependencies. Access is
 denied.]

 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
 assemblyName, Boolean starDirective) +613

 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo
 ai) +57

 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection
 compConfig) +178
 System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath
 configPath, Boolean supportLocalization, String outputAssemblyName) +54

 System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean  isPrecompiledApp)
 +232
 System.Web.Compilation.BuildManager.CompileGlobalAsax() +51
 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()  +337

 [HttpException (0x80004005): Could not load file or assembly
 'System.ServiceModel, Version=3.0.0.0, Culture=neutral,
 PublicKeyToken=b77a5c561934e089' or one of its dependencies. Access is
 denied.]

 System.Web.Compilation.BuildManager.ReportTopLevelCompilationException()
 +58
 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()  +512

 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager
 appManager, IApplicationHost appHost, IConfigMapPathFactory
 configMapPathFactory, HostingEnvironmentParameters hostingParameters)
 +729

 [HttpException (0x80004005): Could not load file or assembly
 'System.ServiceModel, Version=3.0.0.0, Culture=neutral,
 PublicKeyToken=b77a5c561934e089' or one of its dependencies. Access is
 denied.]
 System.Web.HttpRuntime.FirstRequestInit(HttpContext context)  +8897659
 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context)  +85

 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest  wr,
 HttpContext context) +333

El error se podía reproducir al tratar de ejecutar una aplicación ASP.NET desde Plesk, en nuestro caso al lanzar el administrador web para bases de datos SQL Server ASP.NET Enterprise Manager o MyLittleAdmin que se ejecutan desde Plesk.

Si tratamos de corregir el error desde la herramienta Plesk Reconfigurator no solucionaremos el problema debido a que los permisos necesarios no estan añadidos. Por ello, tendremos que hacerlo a mano.

Lo único que tenemos que hacer es editar el archivo DiskSecurity.xml que encontraremos en la carpeta %PLESK_DIR%etcDiskSecurity y añadirle el siguiente contenido dentro del tag Entries:


<!-- Permisos a Assembly para ASP.NET Enterprise manager -->

<Entry AccounType="1" Account="Psacln" Path="C:Windowsassembly" AceFlags="FilesOnly" AccessMask="Read" EntryFlags="0x0" />

Finalmente hay que ejecutar el siguiente comando para que se apliquen los cambios en los permisos:


"%plesk_bin%applysecurity" --apply

— Posted by Sergio | Posted in General | Posted on 3 abril, 2010

Sin comentarios

Nadie ha comentado nada

» RSS para los comentarios de éste post.

Lo siento, el formulario de comentarios está cerrado en este momento.