Reflection error

Oct 27, 2009 at 8:22 PM

Hi Miron,

I´m trying to implement your lib in my project, and it works fine localy.

But when  I published my website, this component is raising the following error:

-----------------------------------------------------------------------------
HttpException: Because your server does not support reflection or you set the attribute 'reflectionAlloweded="false"', You must specify a non-autogenerated machine key in your web.config to compress Webresource.axd

Ocorrido em: 26/10/2009 às 13:31:19.

Página: /avipam/marketplace/WebResource.axd
Usuário: lantonio

Stack Trance
System.Web.HttpException
Mensagem: Because your server does not support reflection or you set the attribute 'reflectionAlloweded="false"', You must specify a non-autogenerated machine key in your web.config to compress Webresource.axd
Source: MbCompression
   at Miron.Web.MbCompression.WebResourceCompressionModule.ThrowHttpException(Int32 num, String SRName)
   at Miron.Web.MbCompression.WebResourceCompressionModule.GetDataFromQuery(NameValueCollection queryString)
   at Miron.Web.MbCompression.WebResourceCompressionModule.OnPreRequestHandlerExecute(Object sender, EventArgs e)
   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


Dados do request
URL http://200.192.162.232/avipam/marketplace/WebResource.axd?d=p2g8UsodRnnWNVxfOzfB-JVcpTsyxZ2_IXfjuU47LasM-VPkHbzdIwPZZm1qd33kku_TMTOkT0awPux3tf='RadWMinimizedClose{0}' onclick='{1}.Close()'/></td></tr></table>
Browser Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Application Path /avipam/marketplace
Host Address 200.161.58.100
Host Name 200.161.58.100

---------------------------------------------------

This is the configuration in my Web.Config:

<Miron.web>
    <!-- cachingStorage="OutputCache / FileSystem"-->
    <CompressorSettings
                        reflectionAlloweded="true"
                        compressCSS="false"
                        compressJavaScript="false"
                        compressPage="true"
                        compressWebResource="true"
                        minifyContent="false"
                        cachingStorage="OutputCache"
                        autoMode="true"
                        scriptsVersion="1"
                        cssVersion="1">
      <excludeTypes>
        <add key="image/gif"/>
        <add key="image/jpeg"/>
      </excludeTypes>
      <!--<excludePaths>
        <add key="~/DontCompressMe.aspx"/>
      </excludePaths>-->
    </CompressorSettings>
  </Miron.web>

I saw some instructions in the README.txt file about it, and it says that I need to put another configuration inside <System.Web>, just like the QuickStart Web Site, which is not in my Web.Config:

<machineKey validationKey="D9414F26B8A5602E55FE91C8AF9033B3AEC545EFA14F7F243DC00333602040F9D839AB9608673E802FE426AEA1D0BAB74F5F99CEEBA1DC69D290F7EC94BD09FE"
                decryptionKey="57529A1AA30F3396A0B5690FCAD576A1DBE861BDA05EC52B794228A5592B6156"
                validation="SHA1"
                decryption="AES"/>

Could you give more details about this tag function and let me know if this is the reason for the error I´m getting and why it doesn´t happen locally?

Thanks

Oct 28, 2009 at 6:45 PM

Just use the last version from the source code tab and add the machinekey to your web.config and it all needs to be fine.

The reason that it works fine on your local machine and in the production not is because in your local machine there is no limitation using reflection while in your production server (I guess it is a share hosting server) reflection is not allowed.