For anyone who has been frustrated with the security errors from dotnetnuke when running on a 1and1 MS Business Shared host account I finally have a workaround. I I was getting an error every time the application started up. The were usually something like this:
AssemblyVersion: 04.06.02
PortalID: 0
PortalName: MaineSGNA
UserID: 3
UserName: Paul
ActiveTabID: 48
ActiveTabName: Event Viewer
RawURL: /Admin/LogViewer/tabid/48/Default.aspx
AbsoluteURL: /Default.aspx
AbsoluteURLReferrer: http://www.mainesgna.org/Admin/SiteLog/tabid/44/Default.aspx
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.8) Gecko/20071008 Firefox/2.0.0.8
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: ea6d7295-ff79-4d6b-a37f-d170913384e4
InnerException: Attempt to access the method failed.
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: System.Reflection.MethodBase.PerformSecurityCheck
StackTrace:
Message: DotNetNuke.Services.Exceptions.PageLoadException: Attempt to access the method failed. ---> System.MethodAccessException: Attempt to access the method failed. at System.Reflection.MethodBase.PerformSecurityCheck(Object obj, RuntimeMethodHandle method, IntPtr parent, UInt32 invocationFlags) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at System.Web.Handlers.ScriptResourceHandler.EncryptString(String s) at System.Web.Handlers.ScriptResourceHandler.RuntimeScriptResourceHandler.System.Web.Handlers.IScriptResourceHandler.GetScriptResourceUrl(Assembly assembly, String resourceName, CultureInfo culture, Boolean zip, Boolean notifyScriptLoaded) at System.Web.UI.ScriptReference.GetUrlFromName(ScriptManager scriptManager, IControl scriptManagerControl, Boolean zip) at System.Web.UI.ScriptReference.GetUrl(ScriptManager scriptManager, IControl scriptManagerControl, Boolean zip) at System.Web.UI.ScriptManager.RegisterScripts() at System.Web.UI.ScriptManager.OnPagePreRenderComplete(Object sender, EventArgs e) at System.Web.UI.Page.OnPreRenderComplete(EventArgs e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---
Source:
Server Name: NTXPWUS58
After looking at the code I've determined that there is either a flaw in the code that determines if AJAX is installed in the GAC or 1and1 has AJAX installed in the GAC but it is not working correctly. There are two ways to work around the problem depending on if you are a developer and can build the DNN framework. The first can be done without a full source installation.
1. Comment out loading AJAX in default.aspx.vb
If AJAX.IsInstalled Then
'AJAX.AddScriptManager(Me)
End If
2. added a lookup in web.config for new setting to DisableAJAX.
Revise this method in AJAX.vb:
Private Shared Function ScriptManagerType() As Type
If m_ScriptManagerType Is Nothing Then
If Not m_Initialized Then
m_ScriptManagerType = Reflection.CreateType("System.Web.UI.ScriptManager", True)
End If
m_Initialized = True
End If
Return m_ScriptManagerType
End Function
after:
Private Shared Function ScriptManagerType() As Type
If Not Config.GetSetting("DisableAJAX") = "true" Then
If m_ScriptManagerType Is Nothing Then
If Not m_Initialized Then
m_ScriptManagerType = Reflection.CreateType("System.Web.UI.ScriptManager", True)
End If
m_Initialized = True
End If
Return m_ScriptManagerType
Else
Return Nothing
End If
End Function
This allows me to change the setting if needed without code changes. When I get a chance, I'm going to investigate further if 1and1 has the ajax libraries installed in the GAC and is fooling the ajax loading code. I'll reply here with my findings.
Paul T