none
O que é preciso fazer para corrigir este problema de configuração no modo de reescrita (rewrite) RRS feed

  • Pergunta

  • No servidor online está funcionando, mas quando instalei no rede da empresa dá esse erro doido, o que poderia ser? O DLL: Intelligencia.UrlRewriter.dll do pacote já está instalado, não entendo onde devo mexer para corrigir o problema, ele está simplesmente ignorando a configuração da seção:

    <configuration>
    <configSections>
    <section name="rewriter"  
                  requirePermission="false"
    allowDefinition="MachineToApplication"
                  type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter"  />
    </configSections> ...

     - O problema é justamente quando coloco essa linha para funcionar no Web.Config:

    <httpModules>
    <add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter" />
    </httpModules>

     



    Server Error in '/' Application.

    The application config file is missing the required section 'rewriter'.

    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.Configuration.ConfigurationErrorsException: The application config file is missing the required section 'rewriter'.

    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: 
    [ConfigurationErrorsException: The application config file is missing the required section 'rewriter'.]
       Intelligencia.UrlRewriter.Configuration.RewriterConfiguration.LoadFromConfig() in \\192.168.0.2\aoccombr\sethyates-urlrewriter-fef0f97\src\Configuration\RewriterConfiguration.cs:171
       Intelligencia.UrlRewriter.Configuration.RewriterConfiguration..ctor(IConfigurationManager configurationManager) in \\192.168.0.2\aoccombr\sethyates-urlrewriter-fef0f97\src\Configuration\RewriterConfiguration.cs:83
       Intelligencia.UrlRewriter.Configuration.RewriterConfiguration..ctor() in \\192.168.0.2\aoccombr\sethyates-urlrewriter-fef0f97\src\Configuration\RewriterConfiguration.cs:29
       Intelligencia.UrlRewriter.RewriterHttpModule..cctor() in \\192.168.0.2\aoccombr\sethyates-urlrewriter-fef0f97\src\RewriterHttpModule.cs:59
    
    [TypeInitializationException: The type initializer for 'Intelligencia.UrlRewriter.RewriterHttpModule' threw an exception.]
    
    [TargetInvocationException: Exception has been thrown by the target of an invocation.]
       System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0
       System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +146
       System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +298
       System.Activator.CreateInstance(Type type, Boolean nonPublic) +79
       System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +10366651
       System.Web.Configuration.Common.ModulesEntry.Create() +80
       System.Web.Configuration.HttpModulesSection.CreateModules() +230
       System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +1162
       System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +312
       System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +133
       System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +196
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.3643; ASP.NET Version:2.0.50727.3634




    • Editado Ivan Ferrer sexta-feira, 23 de agosto de 2013 14:27
    sexta-feira, 23 de agosto de 2013 14:16

Respostas

  • Olá Ivan,

    Se você estiver usando o IIS7 você tem que  adicionar as seguintes linhas na sessão system.webServer do arquivo web.config

    <system.webServer>
             <validation validateIntegratedModeConfiguration="false" />
        	<modules runAllManagedModulesForAllRequests="true">
      <add name="UrlRewriter" 
       type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter" />
        	</modules>
        </system.webServer>
    
    Att,
    sexta-feira, 23 de agosto de 2013 19:30