L铆nea 41: <form id="form1" runat="server"> L铆nea 42: <asp:ScriptManager runat="server" EnablePartialRendering="true" ID="smMain" EnableScriptGlobalization="true"
[MethodAccessException: Error al intentar obtener acceso al m茅todo System.Management.Instrumentation.InstrumentedAttribute..ctor(System.String) debido a una infracci贸n de las reglas de transparencia de seguridad.] System.RuntimeMethodHandle.CheckLinktimeDemands(IRuntimeMethodInfo method, RuntimeModule module, Boolean isDecoratedTargetSecurityTransparent) +0 System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) +482 System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType) +103 System.Reflection.RuntimeAssembly.GetCustomAttributes(Boolean inherit) +33 System.Web.UI.AssemblyCache.GetAjaxFrameworkAssemblyAttribute(Assembly assembly) +114 System.Web.UI.ScriptManager.get_DefaultAjaxFrameworkAssembly() +526 System.Web.UI.ScriptManager..ctor() +49 ASP.nsi_master.__BuildControlsmMain() in ... OMITIDO...
Esta es la configuraci贸n inicial (el fragmento que interesa system.web, hay un tagprefix para los controles):
<system.web>
... OMITIDO ... <pages theme="AdaptacionGuiaCOMPANY"> <controls> <add tagPrefix="COMPANYUI" namespace="COMPANY.Frk.Web.UI.WebControls" assembly="COMPANY.Frk.Web, Version=4.0.0.0, ..."/> <add tagPrefix="asp" namespace="System.Web.UI" ...聽 ... OMITIDO ...
</controls>
</pages>
... OMITIDO ...</system.web>
Aqu铆 se indica la soluci贸n:
http://forums.asp.net/t/1678578.aspx
We have seen a combination of issues that might cause this:
1) The webserver has the trust level set less than "Full" at the machine web.config (ref)
2) The webserver does not have the AJAX files (System.Web.Extensions) installed into the GAC.
Solution 1:聽Set trust level to "Full" in the machine level web.config
Solution 2:聽Install AJAX files into the GAC
If refreshing resolves it - it might just be a timing issue loading the extensions. Probably if you install into the GAC it will resolve it.
AjaxControltoolkit聽 est谩 en la GAC y el error segu铆a produci茅ndose. 聽Sigo las indicaciones para establecer trust Full en el web.config de la aplicaci贸n.
Modifico el config de esta manera (atenci贸n al location):
<location allowOverride="false" path="Default Web Site"> <system.web> <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="" />... OMITIDO ... <pages theme="AdaptacionGuiaCOMPANY"> <controls> <add tagPrefix="COMPANYUI" namespace="COMPANY.Frk.Web.UI.WebControls" assembly="COMPANY.Frk.Web, Version=4.0.0.0, ..."/> <add tagPrefix="asp" namespace="System.Web.UI" ...聽 ... OMITIDO ...</controls></pages>... OMITIDO ...</system.web> </location>
As铆 el error ya no aparece, pero al ejecutar la aplicaci贸n aparece otro error, que no encuentra la etiqueta (el prefijo) para los controles:
http://localhost:57784/Monitorizacion/B2b/FiltroBusquedaB2b.aspx
Error de servidor en la aplicaci贸n '/'. -------------------------------------------------------------------------------- Mensaje de error del analizador: Etiqueta de servidor 'COMPANYUI:Menu' desconocida.
Error de c贸digo fuente: L铆nea 3: <asp:HyperLink ID="CtlLogOut" runat="server" EnableViewState="false" NavigateUrl="~/Public/LogOut.aspx" CssClass="logOut"> </asp:HyperLink> L铆nea 4: <div class="taskbarLeft"> L铆nea 5: <COMPANYUI:Menu ID="CtlMenu" runat="server" MaxLevels="1" />
En el location path he probado con ~, / , . ,聽http://localhost:57784/ pero en alg煤n caso no se permite as铆 y da errores o no soluciona el error del tagprefix.
Las pruebas son en desarrollo (VS2010, Win7 64bits), con WebDev.WebServer (cassini), por tanto la url es del tipo http://localhost:57784/.
Alguna sugerencia para este problema?
Saludos y muchas gracias de antemano