How to setup New Relic for ASP.NET Core 2.1 website application hosted in Windows & IIS

Help! I am stuck setting NewRelic for a ASP.NET Core 2.1 WebApi hosted in IIS on a Windows Server.

I am following the “ASP.NET Core application targeting .NET Core”, “Install for Windows:”, “Install agent with zip file” steps.

I have gone through the steps of downing and unpacking the zip file to a folder on the hosting web server. And I have added the appropriate environment variables and then Restarted IIS. And that’s all there is in the documentation. However, I fail to see how that will do anything. Simply putting a folder with some dlls in it somewhere on a web server doesn’t do anything.

Do I need to install the .NET Agent msi also? Do I need to install some nuget package in my Project and hook into a Middleware (similar to how Retrace works)? I need something more than just putting a folder
somewhere on the web server.

The environment variables are from Microsoft and tell the .NET CLR to load New Relic profiler into your process. That is the entire install process! Our other installers attempt to add the files and environment variables automatically for you. Note that these are variables for your processes and not your logged in user. Setting them system wide is an easy way to make sure all of your processes pick them up.

You might be having issues getting it reporting if the location you put the folder is not writable by your .NET Core processes. Some agent logs are generated in that location and the agent will not report if it cannot write these logs. Since you are using IIS the identity of the app pools will also be the identity of your .NET Core process (dotnet.exe). Generally, you can just give IIS_IUSRS group write permission and it will work though UAC can complicate things depending on the location of your folder. I recommend C:\ProgramData\

We also have a troubleshooting guide here:

3 Likes

Hi, we’ve been working on getting newrelic integrated into our Asp.Net Core 2.2 app deployed as an Azure Web App. After reading the newrelic documentation, and eventually having to put in a call to NewRelic support, we discovered that the only current way to get newrelic working is by downloading the relevant file from their server, creating a newrelic folder in the root via kudu, unzipping the contents of the newrelic package into the folder and then modifying the config file to include log path. Apparently the nuget package which we were using is only for 64bit .Net Core runtime, which is odd as the default installation is 32bit. Obviously trying to instrument this as part of the build process is not easy so was wondering why the 32bit verison of the package isn’t available via nuget?

Hey @damon.bedgood it looks like a colleague of yours currently has a support ticket open on exactly this and we’re going to submit this as a feature request.

I’m also going to tag this post for a feature idea for our mods to come back around and bring it to the community for a public vote!

1 Like