System.Diagnostics.Trace Application Logging Log Stream on Azure App Service Function App

Azure App Service Benjamin Perkins
Azure App Service Benjamin Perkins

Here is what I wanted to do. Add some code like this to my ASP.NET application. Then I wanted to write those logs out to the Application Logging (File System), Figure 1, Application Logging (Blob), Figure 2 and to the Log stream window in the portal, Figure 3. Figure 1, how to write System.Diagnostics.Trace logs…

0

ASP.NET Compilation Azure App Service, Web Project, Web Site

ASP.NET Benjamin Perkins
ASP.NET Benjamin Perkins

There are numerous flavors of ASP.NET modules, for example Web Forms (Web Sites and Web Applications), Web Pages, Model-View-Controller (MVC) and the newest one Core.  In this article I want to discuss some learnings about the difference between the compilations of an ASP.NET Web Site (Figure 1) and an ASP.NET Web Application (Figure 2). Figure…

0

Implementing custom cultures, CultureInfo, localize Azure App Service

Azure App Service Benjamin Perkins
Azure App Service Benjamin Perkins

You cannot, at this moment, create a custom culture on an Azure App Service.  Cultures are part of the standard operating system and require changes to the registry to modify or add them.  An Azure App Service runs in a sandbox which does not allow code or script to modify the registry.  I do not…

0

Beginning C# 7 Programming with Visual Studio 2017, co-author Benjamin Perkins

Beginning C# 7 Programming Benjamin Perkins
Beginning C# 7 Programming Benjamin Perkins

Beginning C# 7 Programming with Visual Studio 2017, co-author Benjamin Perkins The Beginning C# 7 Programming with Visual Studio 2017 book is now available, check it out here.  I had again an opportunity to contribute some chapters to this book.  What an awesome experience!  There are lots of examples, experiences, discussions and reviews of the…

0

Server Error 0x800004005 Request timed out.

C# Benjamin Perkins
C# Benjamin Perkins

I wrote this post and this lab about the impact of having debug=true in your web.config file.  The fact is, when you are running in a production environment, you do not want to have debug=true.  However, I was writing a series of NETSH tracing posts: Capturing a NETSH network trace Analyze NETSH traces with Wireshark…

0

Configuration error, targetFramework 4.7

Microsoft .NET Benjamin Perkins
Microsoft .NET Benjamin Perkins

I was deploying some code to one of my IIS servers and got this YSOD as seen in Figure 1.  I had coded in Visual Studio 2017 with the .NET Framework 4.7 targeted from my ASP.NET Web Forms application I wrote. Figure 1, Server Error, targetFramework=”4.7” I like to look at the version of the…

0

Targeting a specific version of the .NET Framework

Microsoft .NET Benjamin Perkins
Microsoft .NET Benjamin Perkins

I find numerous opinions and understandings about side-by-side and in-place installations of the .NET Framework.  Here is my favorite explanation of this “.NET Versioning and Multi-Targeting – .NET 4.5 is an in-place upgrade to .NET 4.0”.  I also link to that same article in one of my IIS labs here, “Lab 5: Basic and Advanced…

0

What is the current .NET version on an Azure App Service

Microsoft .NET Benjamin Perkins
Microsoft .NET Benjamin Perkins

I have an App Service here (currentdotnetversion) that shows the output of the current (when I wrote this article) .NET version using C# code.  Here is a partial code snippet: I took the code from here and I got the Microsoft.Win32 assembly via a NuGet package, see Figure 1. Figure 1, where to get the…

0

Why is my Azure App Service down?

Azure App Service Benjamin Perkins
Azure App Service Benjamin Perkins

Why is my Azure App Service Slow?  Why does my Azure App Service consume so much CPU?  Why does my Azure App Service consume so much memory?  Why does my Azure App Service restart?  Why does my Azure App Service open so many TCP connections? If you have ever asked any of those questions, look…

0

How to disable preloadEnabled on an Azure App Service

ASP.NET Benjamin Perkins
ASP.NET Benjamin Perkins

I wrote this article here that describes the requirements for creating an XDT file which will allow the configuration of attributes that must happen in the applicationHost.config file.  As you know, you cannot simply / directly make a change to that file (applicationHost.config) on the Azure App Service, you have to extend it via this…

0

A route named ‘*’ is already in the route collection, Azure Web App

ASP.NET Benjamin Perkins
ASP.NET Benjamin Perkins

I was deploying an ASP.NET Web API to an Azure App Service Web App and I got this error: Server Error in ‘/’ Application. A route named ‘HelpPage_Default’ is already in the route collection. Route names must be unique. Parameter name: name Description: An unhandled exception occurred during the execution of the current web request….

0

Always get “Authorization has been denied for this request.” ASP.NET Web API

ASP.NET Benjamin Perkins
ASP.NET Benjamin Perkins

I was creating an ASP.NET Web API today and when I called one of the Web APIs (/api/values) I got the following response: {“Message”:”Authorization has been denied for this request.”} It turns out by default ‘Individual User Accounts” authentication is enabled by default.  See Figure 1. Figure 1, {“Message”:”Authorization has been denied for this request.”}…

0

Cannot read Failed Request Log, unformatted and unreadable

IIS Internet Information Services
IIS Internet Information Services

I often get Failed Request Trace logs via email that when I open them I only see the data, I mean it is not nicely formatted like that shown in Figure 1, rather I see what is in Figure 2.   Figure 1, nice Failed Request Trace log Figure 2, not nice Failed Request Trace…

0

Capture a StackOverflowException and make a dump 0xc00000fd

WinDbg Debugging Benjamin Perkins
WinDbg Debugging Benjamin Perkins

I read in this article that “Starting with the .NET Framework 2.0, you can’t catch a StackOverflowException object with a try/catch block, and the corresponding process is terminated by default. Consequently, you should write your code to detect and prevent a stack overflow.”  That is the reason why the following code was crashing my process…

1

Machine Keys on an Azure App Service, machineKey multiple instances Azure

Azure App Service Benjamin Perkins
Azure App Service Benjamin Perkins

When you run an ASP.NET application on multiple instances of an App Service Plan (ASP) you do not need to worry about machineKeys as the App Service Platform will use the same one across all your instances and therefore will not need to make any changes to your application. I found this sample code and…

1