MvcContrib Portable Areas on IIS scripts 404(not found)

214 views Asked by At

The problem i faced was that i run the project correctly, but when the application deploy to the IIS environment, the scripts(embedded in the portable area Dll) couldn't be found (404 error).

So i want to ask for help about the key why this would happen? here's the code:

<script type="text/javascript" src="@Url.Content("~/MyAreaName/Scripts/jquery-1.10.2.js")"></script>
<script type="text/javascript" src="@Url.Content("~/MyAreaName/Scripts/jqueryUImin.js")"></script>

the above were the view called the scripts(works in the localhost, but not found int the IIS environment)

and the register routes:

    context.MapRoute(
       AreaName + "_scripts",
       base.AreaRoutePrefix + "/Scripts/{resourceName}",
       new { controller = "EmbeddedResource", action = "Index", resourcePath = "scripts"},
       new[] { "MvcContrib.PortableAreas" }
    );

could anyone give some suggestion? thank you.

Edited:

i tried to move the scripts out of the assembly(Dll) to the main project, and it works in IIS environment too; so clearly, i want to ask why the route could be found in localhost but not in IIS environment? i have searched about the related keywords and issues, but not working.

1

There are 1 answers

0
JimNeo On BEST ANSWER

OK, now i want to share the answer(or in other words, solution)

it caused by IIS mode.

the classic mode and the integrated mode's difference result in the MvcContrib PA didn‘t run the mapped route, instead, run the real physical path.

So change the mode, the module added by the different kind of mode, it works like a charm.

Thanks for reading this.