0

I'm currently writing an web app using C# and Asp.Net MVC. Everything works perfectly fine on my local dev machine.

When I put it on the server the styling etc was absolutely fine. However, none of the POST methods were working.

IIS kept throwing me the following error:

HTTP Error 500.24 - Internal Server Error An Asp.NET setting has been detected that does not apply in Integrated managed pipeline mode

As per suggested I changed to classic mode and tried the

<validation validateIntegratedModeConfiguration="false"/> 

in the web.config file without any luck.

I have a fair few views where I use the code as

@using(Html.BeginForm("Create", "User")){ //form data here }
...

Now when I publish the website under the default website, the url becomes https://abc.domain.com/mywebsite this is where all of the POST methods stop working. However, if I publish the website as it's own application so not under the default website then everything works perfectly fine.

Now I can see the reason why the POST methods can't be found is because it's not root directory anymore.

So my question is, is there an easier way to get around this? because I've currently decide to go down the route of @Url.Action("MyAction", "SomeController") and submit the form via jQuery which seems to resolve the issue. However, is there a setting or some sort which I can apply to the entire application rather than keep on having to provide @Url.Action("MyAction", "SomeController") for each click event.

Edit: Below is the screenshot of the error message I receive

enter image description here

Izzy
  • 6,740
  • 7
  • 40
  • 84
  • Can you post the screenshot or paste texts from generated error page? Watch for "most likely cause" section, the error source may implicitly or explicitly given there. – Tetsuya Yamamoto Jan 27 '17 at 08:55
  • It's probably a long-shot - but have you made sure that the application pool is using the same pipeline? Classic / Integrated. And that you are using the same .NET CLR-version? – smoksnes Jan 27 '17 at 08:55
  • @TetsuyaYamamoto Please see the attached image – Izzy Jan 27 '17 at 09:02
  • @smoksnes Yes, I've compared them already and they're are the same – Izzy Jan 27 '17 at 09:04
  • I see that you have impersonation issue on production environment, open IIS Manager => select your server => open 'IIS Authentication' => disable ASP.NET impersonation if it's enabled (similar to http://stackoverflow.com/questions/14445252/http-error-500-24-internal-server-error-an-asp-net-setting-has-been-detected-t). – Tetsuya Yamamoto Jan 27 '17 at 09:10
  • @TetsuyaYamamoto I've disabled but the problem still presists – Izzy Jan 27 '17 at 09:17
  • Try going to your application pool => basic settings => set managed pipeline mode to `Classic`, also grant read and execute access to current server user you want to control with, add it to `IIS_IUSRS` group then set that user as physical path credentials (don't forget to set physical path credentials interactive logon too). – Tetsuya Yamamoto Jan 27 '17 at 09:35

1 Answers1

0

In IIS, Compare .Net CLR version for app pool of existing default website and new application where your website works fine. If there is difference change that setting of app pool of default website to that of new application.

LKC
  • 186
  • 6