Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Have to copy global.asax.cs to live server

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
    {
    }
}
like image 806
Rob Sedgwick Avatar asked Dec 26 '22 10:12

Rob Sedgwick


1 Answers

You can fix it by changing CodeFile to Codebehind:

<%@ Application Codebehind="Global.asax.cs" Language="C#" Inherits="GTFC.Global" %>

Reading: CodeFile vs CodeBehind

like image 81
MikeSmithDev Avatar answered Jan 17 '23 23:01

MikeSmithDev