CustomErrors mode=”Off”

This has been driving me insane for the past few days and couldn’t get around it but have finally figured it out: In my machine.config file I had an entry under <system.web>: <deployment retail=”true” /> This seems to override any other customError settings that you have specified in a web.config file, so setting the above … Read more

.net localhost website consistently making get arterySignalR/poll?transport=longPolling&connectionToken= calls

This is working as intended. Artery aka BrowserLink is a real-time connection from Visual Studio to all browsers running your code. It essentially allows Visual Studio to interact with every browser. For instance if you have IE, Opera, Chrome and Firefox all running your code and you’re trying to ensure cross browser correctness; instead of … Read more

What is an IIS application pool?

Application pools allow you to isolate your applications from one another, even if they are running on the same server. This way, if there is an error in one app, it won’t take down other applications. Additionally, applications pools allow you to separate different apps which require different levels of security. Here’s a good resource: … Read more

Exposing localhost to the internet via tunneling (using ngrok): HTTP error 400: bad request; invalid hostname

Troubleshot this issue with ngrok. In the words of inconshrevable, some applications get angry when they see a different host header than expected. Running the following command should fix the problem: ngrok http [port] -host-header=”localhost:[port]” Depending on the version, you may also want to try: ngrok http [port] –host-header=”localhost:[port]”

WCF on IIS8; *.svc handler mapping doesn’t work

More specifically: Run Server Manager (on task bar and start menu) Choose the server to administer (probably local server) Scroll down to “Roles and Features” section. Choose “Add Role or Feature” from Tasks drop down On “Add Role or Feature Wizard” dialog, click down to “Features” in list of pages on the left. Expand “.Net … Read more

Accessing Session Using ASP.NET Web API

MVC For an MVC project make the following changes (WebForms and Dot Net Core answer down below): WebApiConfig.cs public static class WebApiConfig { public static string UrlPrefix { get { return “api”; } } public static string UrlPrefixRelative { get { return “~/api”; } } public static void Register(HttpConfiguration config) { config.Routes.MapHttpRoute( name: “DefaultApi”, routeTemplate: … Read more

Hidden Features of ASP.NET [closed]

While testing, you can have emails sent to a folder on your computer instead of an SMTP server. Put this in your web.config: <system.net> <mailSettings> <smtp deliveryMethod=”SpecifiedPickupDirectory”> <specifiedPickupDirectory pickupDirectoryLocation=”c:\Temp\” /> </smtp> </mailSettings> </system.net>

I just discovered why all ASP.Net websites are slow, and I am trying to work out what to do about it

If your page does not modify any session variables, you can opt out of most of this lock. <% @Page EnableSessionState=”ReadOnly” %> If your page does not read any session variables, you can opt out of this lock entirely, for that page. <% @Page EnableSessionState=”False” %> If none of your pages use session variables, just … Read more

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