I'm getting an error when I try to load the Global class I made (below)
Any idea why ? I tried to manually delete the .NET Framework cache files but it didn't help
If I just put the class in App_Code there is no error - but it does not get loaded...
Once I add Global.asax to the root - I get this error:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0433: The type 'ASP.global_asax' exists in both ...
Imports System Imports System.Net.Mail Imports System.Web
''' <summary> ''' Global (Inherits HttpApplication through Umbraco) ''' </summary> Public Class [Global] Inherits umbraco.Global
''' <summary> ''' Code that runs on application startup ''' </summary> ''' <param name="sender"></param> ''' <param name="e"></param> Protected Overrides Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
MyBase.Application_Start(sender, e)
End Sub
''' <summary> ''' Code that runs on application shutdown ''' </summary> ''' <param name="sender"></param> ''' <param name="e"></param> Protected Overrides Sub Application_End(ByVal sender As Object, ByVal e As EventArgs)
MyBase.Application_End(sender, e)
End Sub
''' <summary> ''' Code that runs when an unhandled error occurs ''' </summary> ''' <param name="sender"></param> ''' <param name="e"></param> Protected Overrides Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
MyBase.Application_Error(sender, e)
End Sub
Protected Overrides Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
MyBase.Application_BeginRequest(sender, e)
End Sub
''' <summary> ''' Code that runs when a new session is started ''' (currently not implemented in Umbraco - do not override) ''' </summary> ''' <param name="sender"></param> ''' <param name="e"></param> Protected Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
' MyBase.Session_Start(sender, e)
Session.Timeout = 20
End Sub
''' <summary> ''' Code that runs when a session ends. ''' Note: The Session_End event is raised only when the sessionstate mode ''' is set to InProc in the Web.config file. If session mode is set to StateServer ''' or SQLServer, the event is not raised. ''' </summary> ''' <param name="sender"></param> ''' <param name="e"></param> Protected Overrides Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
Hell no, I don't run the source in my applications, I use the official releases. What i meant by "deleting it constantly" is that I delete it when ever I set up a new site.
Where is Session_Start ?
I've looked in the source at public class Global : HttpApplication (in Umbraco 4.5) but I could not find Session_Start()
Any special reason why Session_Start() is not implemented like the others ?
Is there some other place in Umbraco that defines Session.Timeout ?
Just an accidental omission, you can just add your own public void Session_State(object sender, EventArgs e) method no problem though.
Or create a HttpModule to do it.
Yeah this is what I thought,
I added a public one...
Thanks.
I'm getting an error when I try to load the Global class I made (below)
Any idea why ? I tried to manually delete the .NET Framework cache files but it didn't help
If I just put the class in App_Code there is no error - but it does not get loaded...
Once I add Global.asax to the root - I get this error:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0433: The type 'ASP.global_asax' exists in both ...
Global.asax looks like this:
<%@ Application
Language="VB"
Inherits="Global"
CodeBehind="Global.asax.vb"
%>
The class is in VB and looks like this:
Imports System
Imports System.Net.Mail
Imports System.Web
''' <summary>
''' Global (Inherits HttpApplication through Umbraco)
''' </summary>
Public Class [Global]
Inherits umbraco.Global
''' <summary>
''' Code that runs on application startup
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
Protected Overrides Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
MyBase.Application_Start(sender, e)
End Sub
''' <summary>
''' Code that runs on application shutdown
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
Protected Overrides Sub Application_End(ByVal sender As Object, ByVal e As EventArgs)
MyBase.Application_End(sender, e)
End Sub
''' <summary>
''' Code that runs when an unhandled error occurs
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
Protected Overrides Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
MyBase.Application_Error(sender, e)
End Sub
Protected Overrides Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
MyBase.Application_BeginRequest(sender, e)
End Sub
''' <summary>
''' Code that runs when a new session is started
''' (currently not implemented in Umbraco - do not override)
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
Protected Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
' MyBase.Session_Start(sender, e)
Session.Timeout = 20
End Sub
''' <summary>
''' Code that runs when a session ends.
''' Note: The Session_End event is raised only when the sessionstate mode
''' is set to InProc in the Web.config file. If session mode is set to StateServer
''' or SQLServer, the event is not raised.
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
Protected Overrides Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
MyBase.Session_End(sender, e)
End Sub
End Class
Just delete App_global.asax.dll from bin folder.
Thanks, that worked.
Do you know why that file is there by default ?
I reverse engineered it and saw this inside:
You can look at the source on codeplex (or download it)
The only method that is implemented is:
I saw that,
I'm actually wonder if I can keep both - since my class inherits umbraco.Global
But even if I rename my class to Global2, once I add Global.asax it gets the error above
(if I keep the DLL)
but I'm not sure if App_global.asax.dll in the bin folder is the same from the Umbraco source code that does Log.Add(...
I don't actually know why that file is still there, or where it keeps coming from :P.
You can delete the file and it wont cause problems (I delete it constantly :P)
slace, R U compiling the whole Umbraco solution with your Umbraco web site ?
I think it should only reappear if deploying the web application.. ?
if anyone knows what can make App_global.asax.dll reappear please drop a line.
Hell no, I don't run the source in my applications, I use the official releases. What i meant by "deleting it constantly" is that I delete it when ever I set up a new site.
Got it, thanks.
is working on a reply...