HTTPError Exception Message not displaying when webapi is run on Server vs being run locally

I found that these needed to be turned on in the GlobalConfiguration for the webapi itself: 1: config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.LocalOnly; 2: config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always; 3: config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Never; The server actually determines how much detail to display, the default is LocalOnly. Our logging method is not considered local, I guess because it is not actually … Read more

How to convert .crt cetificate file to .pfx

I have solved this issue by converting this .crt file into a .pfx file using following method. To convert .crt to .pfx, we need CSA certificate (Private Key) provided by hosting provider. Below are the steps to convert this: Download and install OpenSSL software from below link based on your system type https://slproweb.com/products/Win32OpenSSL.html Run the … Read more

How do I protect static files with ASP.NET form authentication on IIS 7.5?

If you application pool is running in Integrated mode then you can do the following. Add the following to your top level web.config. <system.webServer> <modules> <add name=”FormsAuthenticationModule” type=”System.Web.Security.FormsAuthenticationModule” /> <remove name=”UrlAuthorization” /> <add name=”UrlAuthorization” type=”System.Web.Security.UrlAuthorizationModule” /> <remove name=”DefaultAuthentication” /> <add name=”DefaultAuthentication” type=”System.Web.Security.DefaultAuthenticationModule” /> </modules> </system.webServer> Now you can use the standard ASP.NET permissions in your … Read more

Validation type names in unobtrusive client validation rules must be unique

JimmiTh’s comment on the question provided a key insight for me to resolve this for myself. In my case, I definitely did add an additional provider to ModelValidatorProviders. I added a custom validation factory (using Fluent Validation) with this code in my Global.asax.cs file: ModelValidatorProviders.Providers.Add( new FluentValidationModelValidatorProvider(validatorFactory)); But using multiple providers isn’t necessarily problematic. What … Read more

How to stop/start IIS 7 application through command line?

http://www.windowsnetworking.com/articles_tutorials/Configuring-IIS-7-command-line-Appcmdexe-Part1.html Put this into a file with .bat extension. @echo off appcmd start sites “site1” appcmd stop sites “site2” Update Just ensure that appcmd is available anywhere by adding %windir%\system32\inetsrv\ to the PATH environment variable of your system. Alternatively, you can use the full path to appcmd.exe in the batch file.

How to config application pool in IIS 7.5 automatically re-start when it was stopped?

You will need to change the startMode for the application pool your website is running on from onDemand to AlwaysRunning. By default IIS sets all application pools to onDemand. In IIS Manager, click computer name in the Connection pane. Switch to Features View if the view is not active. Double-click Configuration Editor in the Management … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)