简体   繁体   中英

Asp.net MVC deployment application issues

I continually run into all sorts of issues where the application functions fine but when pushed to my shared hosting services it fails and throws various issues. Is the notion that once the "Integrated Pipeline" is setup for the Virtual Directory that a FTP push from a "Publish" action in the project should "just work"?

It seems like I am missing something as I continually get "File Not Found", an example would be with this beta site -> http://beta.myabriza.com the js.axd and css.axd URLS generate an error that they cannot be found. These are handlers setup to squash CSS and JS following this excellent site.

Of course this runs fine on my dev machine, but seems when I push it to the server it fails. Since I am not technically serving a file I am not sure how it cant find the resource handler.

Here is a snapshot that illustrates what I am attempting to say: alt text http://img15.yfrog.com/img15/4067/amijustgoingcrazy.jpg

My web.config is setup like this;

      <add verb="*" path="css.axd" type="Utils.Web.HttpHandlers.CSSHandler, Utils.Web" validate="false"/>
      <add verb="*" path="js.axd" type="Utils.Web.HttpHandlers.JSHandler, Utils.web" validate="false"/>

EDIT: Here is my global.asax.cs (for routing):

    public class MvcApplication : System.Web.HttpApplication
    {
    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        // This is the default route to handle anything else
        routes.MapRoute(
            "Default",                                              // Route name
            "{controller}/{action}/{id}",                           // URL with parameters
            new { controller = "Home", action = "Index", id = "" }  // Parameter defaults
        );

    }

    protected void Application_Start()
    {
        RegisterRoutes(RouteTable.Routes);

        // This is a debug utility to output the routes for a given entry, only enable on demand
      //    RouteDebug.RouteDebugger.RewriteRoutesForTesting(RouteTable.Routes);
    }

Perhaps the problem is my lack of experience with developing/deploying a custom resource handler. If so, great!, please give some advice to making magic and getting that sweet taste of some small win.

您是否删除了此代码?

routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

This has proved to be a hosting problem somehow the bozos over at www.arvixe.com have done something to keep this from working. I posted the same code at another hosting provider (www.asphostcentral.com) and it works fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM