global.asax works on local computer but not after i publish to server

前端 未结 7 661
滥情空心
滥情空心 2020-12-06 11:26

How can I get my global.asax file to publish to our ftp site?

I have added a global.asax file to my project (using asp.net with c# from vs2

相关标签:
7条回答
  • 2020-12-06 11:31

    try the following:

    <system.webServer>
        <validation validateIntegratedModeConfiguration="false" />
        <handlers>
            <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv4.0,bitness64" />
        </handlers>
    
        <validation validateIntegratedModeConfiguration="false" />
    </system.webServer>
    
    0 讨论(0)
  • 2020-12-06 11:33

    Check that the "Build action" of the Global.asax file is set to "Content" in the file properties. All files set to content will be deployed.

    0 讨论(0)
  • 2020-12-06 11:37

    Try to publish the following files this works for me

    App_global.asax.dll
    App_global.asax.compiled
    PrecompiledApp.config
    yoursite.dll

    and as @GabrielG said you have to uncheck precompile during publishing

    I hope this help somebody else.

    0 讨论(0)
  • 2020-12-06 11:39

    We had to uncheck the Precompile during publishing feature in our publishing profile and that did the trick.

    0 讨论(0)
  • 2020-12-06 11:41

    I had the same problem and found that I also had to set Copy to Output Directory property to Copy always

    0 讨论(0)
  • 2020-12-06 11:45

    We tried a lot of things.

    1. Global.asax is not publishing and event are not firing in Global.asax
    2. Why are the Global.asax events not firing in my ASP .NET website?
    3. Global.asax not firing for Release build
    4. Mystery of Global.asax in ASP.NET MVC application

    We also tried putting the below files in root and bin directories.

    1. App_global.asax.dll and App_global.asax.compiled files
    2. PrecompiledApp.config

    None of it worked!

    We had to put raw Global.asax instead of pre-compiled dll, in order to fire the global events, for our asp .net 2.0 website.

    Hope this helps someone! Cheers! Happy coding! :D

    0 讨论(0)
提交回复
热议问题