Hosting new Webapi cause few errors (Error 500, IIS7.5)http://forums.asp.net/t/1785349.aspx/1?Hosting+new+Webapi+cause+few+errors+Error+500+IIS7+5+Thu, 29 Mar 2012 21:50:13 -040017853494899796http://forums.asp.net/p/1785349/4899796.aspx/1?Hosting+new+Webapi+cause+few+errors+Error+500+IIS7+5+Hosting new Webapi cause few errors (Error 500, IIS7.5) <p>Hi, Im trying to deploy the new webapi to my local IIS.</p> <p>If i go to a normal MVC route it works (Home/Index etc)</p> <p>But if i try the Webapi route i get the error 500(api/category etc)</p> <p>Do i have to do somthing special to get the new Webapi to work with IIS 7.5?</p> <p>&nbsp;</p> <table border="0" cellspacing="0" cellpadding="0"> <tbody> <tr class="alt"> <th>Module</th> <td>ManagedPipelineHandler</td> </tr> <tr> <th>Notification</th> <td>ExecuteRequestHandler</td> </tr> <tr class="alt"> <th>Handler</th> <td>System.Web.Http.WebHost.HttpControllerHandler</td> </tr> <tr> <th>Error Code</th> <td>0x00000000</td> </tr> </tbody> </table> &lt;div id=&quot;details-right&quot;&gt; <table border="0" cellspacing="0" cellpadding="0"> <tbody> <tr class="alt"> <th>Requested URL</th> <td>http://json.zandparts.se:80/api/category</td> </tr> <tr> <th>Physical Path</th> <td>C:\Temp\Zandparts\WebshopAPI\api\category</td> </tr> <tr class="alt"> <th>Logon Method</th> <td>Anonymous</td> </tr> <tr> <th>Logon User</th> <td>Anonymous</td> </tr> </tbody> </table> &lt;/div&gt; <ul> <li>IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred. </li><li><strong>IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.</strong> </li><li>IIS was not able to process configuration for the Web site or application. </li><li><strong>The authenticated user does not have permission to use this DLL.</strong> </li><li>The request is mapped to a managed handler but the .NET Extensibility Feature is not installed. </li></ul> <p>The bold parts i have fixed already, And im not sure about the rest.</p> <p>&nbsp;</p> <p>Regards</p> <p>Joachim</p> 2012-03-26T14:18:56-04:004899816http://forums.asp.net/p/1785349/4899816.aspx/1?Re+Hosting+new+Webapi+cause+few+errors+Error+500+IIS7+5+Re: Hosting new Webapi cause few errors (Error 500, IIS7.5) <p>The file system security is preventing the web server (IIS) from accessing those files. Sounds like the files for the app are maybe on your desktop or in your &quot;my documents&quot; folder? If so, move these files out and somewhere else under C:\ or change the filesystem security for thae app directory to allow the IIS process to access (IIS_IUSRS group).</p> 2012-03-26T14:25:24-04:004899849http://forums.asp.net/p/1785349/4899849.aspx/1?Re+Hosting+new+Webapi+cause+few+errors+Error+500+IIS7+5+Re: Hosting new Webapi cause few errors (Error 500, IIS7.5) <p>Im hosting the app under</p> <p>&nbsp;&nbsp; C:\Temp\Map\WebshopAPI</p> <p>I've set all the Permissions already.</p> <p>The app works when im using normal MVC Urls</p> <pre class="prettyprint">routes.MapRoute( name: &quot;Default&quot;, url: &quot;{controller}/{action}/{id}&quot;, defaults: new { controller = &quot;Home&quot;, action = &quot;Index&quot;, id = UrlParameter.Optional } );</pre> <pre class="prettyprint">&nbsp;</pre> <pre class="prettyprint">But i get the error once i try the JSON Urls</pre> <pre class="prettyprint"> routes.MapHttpRoute( name: "ActionApi", routeTemplate: "api/{controller}/{action}/{id}", defaults: new { id = RouteParameter.Optional } ); routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); </pre> <p></p> <p>&nbsp;</p> 2012-03-26T14:44:09-04:004904979http://forums.asp.net/p/1785349/4904979.aspx/1?Re+Hosting+new+Webapi+cause+few+errors+Error+500+IIS7+5+Re: Hosting new Webapi cause few errors (Error 500, IIS7.5) <p>Bump.</p> <p>This is happening to me as well, GET works fine, but POST fails with all my controllers in the WebApi. Here is my trace detail:</p> <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tbody> <tr> <th>ModuleName</th> <td class="event-data">ManagedPipelineHandler</td> </tr> <tr class="alt"> <th>Notification</th> <td class="event-data">128</td> </tr> <tr> <th>HttpStatus</th> <td class="event-data">500</td> </tr> <tr class="alt"> <th>HttpReason</th> <td class="event-data">Internal Server Error</td> </tr> <tr> <th>HttpSubStatus</th> <td class="event-data">0</td> </tr> <tr class="alt"> <th>ErrorCode</th> <td class="event-data">0</td> </tr> <tr> <th>ConfigExceptionInfo</th> <td class="event-data"></td> </tr> <tr class="alt"> <th>Notification</th> <td>EXECUTE_REQUEST_HANDLER</td> </tr> <tr> <th>ErrorCode</th> <td>The operation completed successfully. (0x0)</td> </tr> </tbody> </table> 2012-03-28T23:27:57-04:004905353http://forums.asp.net/p/1785349/4905353.aspx/1?Re+Hosting+new+Webapi+cause+few+errors+Error+500+IIS7+5+Re: Hosting new Webapi cause few errors (Error 500, IIS7.5) <p>I managed to solve my problem, Had wrong connectionstring to the DB.</p> 2012-03-29T06:19:53-04:004906489http://forums.asp.net/p/1785349/4906489.aspx/1?Re+Hosting+new+Webapi+cause+few+errors+Error+500+IIS7+5+Re: Hosting new Webapi cause few errors (Error 500, IIS7.5) <p>Hmm, that's not working for me. I'm using the same connection string when I'm running in Visual Studio's Development Server as when I'm hosting on IIS (on local machine). I get a 500 even when trying to perform a post on a controller that doesn't access/require database access. Any other thoughts?</p> 2012-03-29T13:59:53-04:004907214http://forums.asp.net/p/1785349/4907214.aspx/1?Re+Hosting+new+Webapi+cause+few+errors+Error+500+IIS7+5+Re: Hosting new Webapi cause few errors (Error 500, IIS7.5) <p>Scratch that. This issue is because of my db connection string as well. I had a typo. I wish the error messages were more helpful.</p> 2012-03-29T21:50:13-04:00