I have a web application which I have built and deployed to a web server. We only deploy the aspx, plus dlls etc and not the source code.
When I try and access the web site I get the message "the file /global.asax.cs'does not exist".
If I copy it across to the server it works and the rest of the site is fine. No other C# source code is present on the site so it is obviously using the compiled DLL for everything but global.asax.cs
The global.asax file looks like this:
<%@ Application CodeFile="Global.asax.cs" Language="C#" Inherits="GTFC.Global" %>
and the global.asax.cs like this:
namespace GTFC
{
public partial class Global : System.Web.HttpApplication
{
}
}
You can fix it by changing CodeFile
to Codebehind
:
<%@ Application Codebehind="Global.asax.cs" Language="C#" Inherits="GTFC.Global" %>
Reading: CodeFile vs CodeBehind
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With