an ASP.NET Open Source CMS & eCommerce platform
Search:
Skip Navigation LinksHome > DotShoppingCart Forums > Support > Installation > First call of site failes with file permission ...
Last Post 10/10/2009 5:06:19 PM By peter stein. 2 replies.
10/10/2009 4:50:38 AM
peter stein
Posts: 3
Joined: 10/9/2009
First call of site failes with file permission error in environment: Open Source ShoppingCart, SQL2005 Std Ed., MS-Server 2003 SP2
Hello,
 
after successfully installed shoppingcart on my MSSrv2003, SQL2005 Std.Ed environment I tried to call for the first time the DotShoppingCart. I got a permission error to whatever. I didn't do a filemon or regmon analysis at the moment.
 
I tried the following:
 
Check NT Authority\Network Service Account if it was entered in the logins and database security sections in the SQL-Server with Mgmt Studio. OK
Check the file permissions of the NT Authority\Network Service Account described in getting started manual. OK
Switch Default ApplPool in IIS to NT Authority\Network Service Account. OK
 
Call site second time. NOK
 
Gave local admin rights to the whole web-folder and subfolders
 
Call site third time. NOK
 
Restart IIS
 
Call site fourth time. NOK
 
Create local Service User and added this to DB-Login/Security sections, ApplPool and set file permissions to modify as descricbed.
 
Call site fifth time. NOK
 
Every time I got following:
 

<span> 

Server Error in 'XXXXX' Application. <hr width="100%" color="#c0c0c0" size="1" />

Required permissions cannot be acquired.

</span>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.Security.Policy.PolicyException: Required permissions cannot be acquired.

Source Error:

<table width="100%" bgcolor="#ffffcc"> <tbody> <tr> <td>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.</td> </tr> </tbody> </table>
Stack Trace:

<table width="100%" bgcolor="#ffffcc"> <tbody> <tr> <td>
[PolicyException: Required permissions cannot be acquired.]
   System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission) +7602199
   System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission) +57

[FileLoadException: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
   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 'Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +613
   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +203
   System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +105
   System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
   System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +54
   System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +8805010
   System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +128
   System.Web.Compilation.BuildManager.CompileCodeDirectories() +265
   System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +320

[HttpException (0x80004005): Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
   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 'Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8886319
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +259
</td> </tr> </tbody> </table>
<hr width="100%" color="#c0c0c0" size="1" /> Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
 
ANY HELP Appreciated
 
thx, Peter
10/10/2009 7:43:45 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: First call of site failes with file permission error in environment: Open Source ShoppingCart, SQL2005 Std Ed., MS-Server 2003 SP2
'Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417
 
First check if "Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.dll" exists and then try to give full trust to web site to see if it works.
DotShoppingCart Staff
10/10/2009 5:06:19 PM
peter stein
Posts: 3
Joined: 10/9/2009
Re: First call of site failes with file permission error in environment: Open Source ShoppingCart, SQL2005 Std Ed., MS-Server 2003 SP2
<span style="background-color: rgb(255, 255, 0);"><span style="background-color: rgb(255, 255, 255);">"Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.dll" is existing in "web\Bin" also all the others.
</span></span>
 
<span style="background-color: rgb(255, 255, 0);"><span style="background-color: rgb(255, 255, 255);">Added this to webconfig (the orange parts):</span></span>
 
<span style="background-color: rgb(255, 255, 0);"><span style="background-color: rgb(255, 255, 255);">    <location allowOverride="false" path="Default Web Site"></span></span><span style="background-color: rgb(255, 255, 0);"><span style="background-color: rgb(255, 255, 255);">
      <system.web>
          <httpCookies httpOnlyCookies="true" />
          <pages validateRequest="false">
              <controls>
                  <add tagPrefix="ajaxc" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"/>
                  <add tagPrefix="dsc" namespace="DotShoppingCart.OpenSource.WebControls" assembly="DotShoppingCart.OpenSource.WebControls"/>
                  <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                  <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></controls>
          </pages>
          <securityPolicy>
            <trustLevel name="Full" policyFile="internal"/>
            <trustLevel name="High" policyFile="web_hightrust.config"/>
            <trustLevel name="Medium" policyFile="web_mediumtrust.config"/>
            <trustLevel name="Low" policyFile="web_lowtrust.config"/>
            <trustLevel name="Minimal" policyFile="web_minimaltrust.config"/>
          </securityPolicy>
          <trust level="Full" originUrl=""/>

        <!--
              Set compilation debug="true" to insert debugging
              symbols into the compiled page. Because this
              affects performance, set this value to true only
              during development.
          -->
          <compilation debug="true">
              <assemblies>
                  <add assembly="System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                  <add assembly="System.Configuration.Install, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                  <add assembly="System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                  <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                  <add assembly="System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                  <add assembly="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                  <add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                  <add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                  <add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                  <add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                  <add assembly="System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                  <add assembly="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                  <add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                  <add assembly="System.Messaging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                  <add assembly="System.Runtime.Serialization.Formatters.Soap, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                  <add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                  <add assembly="System.DirectoryServices.Protocols, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                  <add assembly="System.ServiceProcess, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                  <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                  <add assembly="System.Web.RegularExpressions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                  <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                  <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                  <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                  <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                  <add assembly="System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                  <add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies>
          </compilation>
          <!--
              The <authentication> section enables configuration
              of the security authentication mode used by
              ASP.NET to identify an incoming user.
          -->
          <httpHandlers>
              <remove verb="*" path="*.asmx"/>
              <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
              <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
              <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
              <add path="dbfile.axd" verb="*" type="DotShoppingCart.OpenSource.HttpHandlers.DbFileHttpHandler, DotShoppingCart.OpenSource.HttpHandlers.DbFileHttpHandler"/>
              <add path="dbimage.axd" verb="*" type="DotShoppingCart.OpenSource.HttpHandlers.DbImageHttpHandler, DotShoppingCart.OpenSource.HttpHandlers.DbImageHttpHandler"/>
              <add path="dyimage.axd" verb="*" type="DotShoppingCart.OpenSource.HttpHandlers.DyImageHttpHandler, DotShoppingCart.OpenSource.HttpHandlers.DyImageHttpHandler"/>
          </httpHandlers>
          <httpModules>
              <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
              <add name="UrlRewriter" type="DotShoppingCart.OpenSource.HttpModules.UrlRewriterHttpModule, DotShoppingCart.OpenSource.HttpModules.UrlRewriter" />
          </httpModules>
          <authentication mode="Forms">
              <forms name=".ASPNET" loginUrl="login.aspx" cookieless="UseCookies" protection="All" timeout="30" path="/"/>
          </authentication>
          <anonymousIdentification enabled="true"/>
          <identity impersonate="false"/>
          <membership defaultProvider="SqlMembershipProvider" userIsOnlineTimeWindow="15" hashAlgorithmType="SHA1">
              <providers>
                  <clear/>
                  <add name="SqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" applicationName="DotShoppingCart" connectionStringName="dsc" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="true" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" passwordAttemptWindow="10" passwordStrengthRegularExpression="" minRequiredPasswordLength="4" minRequiredNonalphanumericCharacters="0"/>
              </providers>
          </membership>
          <roleManager enabled="true" defaultProvider="SqlRoleProvider">
              <providers>
                  <clear/>
                  <add name="SqlRoleProvider" type="System.Web.Security.SqlRoleProvider" applicationName="DotShoppingCart" connectionStringName="dsc" />
              </providers>
          </roleManager>
          <profile automaticSaveEnabled="true" defaultProvider="SqlProfileProvider" inherits="DotShoppingCart.OpenSource.Core.ProfileDSC">
              <providers>
                  <clear/>
                  <add name="SqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" applicationName="DotShoppingCart" connectionStringName="dsc" />
              </providers>
              <properties>
                  <group name="Whosonline">
                      <add name="EnableAutoRefresh" type="System.Boolean" allowAnonymous="false"/>
                      <add name="RefreshIntervalInMinutes" type="System.Int32" allowAnonymous="false"/>
                  </group>
              </properties>
          </profile>
          <siteMap defaultProvider="AspNetXmlSiteMapProvider" enabled="true">
              <providers>
                  <add name="CategorySiteMapProvider" type="DotShoppingCart.OpenSource.Providers.CategorySiteMapProvider, DotShoppingCart.OpenSource.Providers.CategorySiteMapProvider, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
              </providers>
          </siteMap>
          <!--
              The <customErrors> section enables configuration
              of what to do if/when an unhandled error occurs
              during the execution of a request. Specifically,
              it enables developers to configure html error pages
              to be displayed in place of a error stack trace.
          -->
        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
          <error statusCode="403" redirect="NoAccess.htm"/>
          <error statusCode="404" redirect="FileNotFound.htm"/>
        </customErrors>
      </system.web>
</span><span style="background-color: rgb(255, 255, 255);">    </location></span></span>
 
The result didn't change except that I got the standard error page with following content (I am testing on localhost):
 
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed.

Details: To enable the details of this specific error message to be viewable on the local server machine, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "RemoteOnly". To enable the details to be viewable on remote machines, please set "mode" to "Off".


<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="RemoteOnly"/>
    </system.web>
</configuration>
 

Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.


<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="On" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>