Admin .aspx tool is not loading, file is downloaded

Vote:
 

Hi!

Hi have installed a admin tool plugin that is an aspx, works just fine on my developing machine but when I deploy to my test servers the file is not loading, instead the .aspx file is downloaded?
Why is that? All other .aspx files i the Epi admin works just fine so the server can handle .aspx files.

The url for the GUI plugin is like "/modules/myplugin/myfile.aspx" and the link looks just fine in Episerver but when I click it the aspx file gets downloaded?

Any ideas?

Thanks!

/Kristoffer

#254683
May 11, 2021 15:14
Vote:
 

I would suggest to compare your dev and production web.config. Looks like one or more handlers are missing

#254684
May 11, 2021 17:45
Vote:
 

Hi!

Thanks for the tip, that was it!

On the server I found this:

<configuration>
  <system.webServer>
    <handlers>
      <add name="wildcard" path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer.Framework.AspNet" />
    </handlers>
  </system.webServer>
</configuration>

That one was not in my web.config on dev.

I can see that you have used this in you post about securing a location:

Securing a Static Folder | Episerver Developer Community

And that make sense. Any guess why the original developer har put this in the "main" system.WebServer?

Thanks!

/Kristoffer

#254686
May 11, 2021 20:55
Vote:
 

Hi!

Without that line no css is loading, static files, and with that line the plugin does not load. Any ideas why?

/Kristoffer

#254725
May 12, 2021 6:35
Vote:
 

Looks like you need this in your production web.config

        <add name="PageHandlerFactory-Integrated-4.0" path="*.aspx" verb="GET,HEAD,POST,DEBUG" type="System.Web.UI.PageHandlerFactory" preCondition="integratedMode,runtimeVersionv4.0" /> 

  <location path="episerver">/<system.webServer>/<handlers>

#254727
May 12, 2021 7:15
Vote:
 

Almost, I had to add this:

<location path="modules/MyPluginFolder">
    <system.webServer>
      <handlers>
        <clear />
        <add name="PageHandlerFactory-Integrated-4.0" path="*.aspx" verb="GET,HEAD,POST,DEBUG" type="System.Web.UI.PageHandlerFactory" preCondition="integratedMode,runtimeVersionv4.0" />
      </handlers>
    </system.webServer>
  </location>

Thanks for your help!

/Kristoffer

#254728
May 12, 2021 8:15
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.