Not able to find a way to use perfview (without GUI) from powershell in windows server core 2019
We are moving from windows server to windows server core, but not able to find a way to replace perfview. Because there is no GUI available in core and perfview isn't executable from powershell in windows server core.
We tried to go with this approach as well: Execute this from the command line and create a ETL file for you to look at on another machine. But can't find a way to generate a ETL file for our IIS application.
Can someone please guide how we can replace the perfview usage with our change to windows server core!
If you don't have access to a GUI, as in this case, you can run PerfViewCollect, which is effectively a non-GUI version of the collection capabilities in PerfView. We don't currently build and ship it, but it is available in this repo and is built if you run build.cmd. Would this work for you?
I tried to build it, but getting this error. Don't know exactly what's i need to change on my setup.
Error --> C:\Users\vipul.malik\.nuget\packages\microsoft.build.tasks.git\1.0.0-beta-63127-02\build\Microsoft.Build.Tasks.Git.targets(20,5): error : Unable to locate repository containing directory 'D:\perfview-main\src\PerfViewCollect'.
I checked this file Microsoft.Build.Tasks.Git.targets , seems fine, not sure if i need to make any change in it.
Just to confirm, did you clone the repo, or did you download the source as a zip file? This package assumes that you cloned it using git. It probably also needs git to be on your path.
I downloaded it as a zip file. I'm trying again by installing git on my server.
It worked and had build the solution.
I can see the PerfviewCollect application on this path C:\Users\vipul.malik\perfview\src\PerfViewCollect\bin\Release\netcoreapp3.1\win-x64
Is this what we need to deploy? And where i can find the usage of it like the commands we can execute from powershell for data collection? because i'm opening it and get close in like milliseconds.
Also, i can see release of Perfview application as well on this path C:\Users\vipul.malik\perfview\src\PerfView\bin\Release\net462
You likely want to run dotnet publish -c Release -r win-x64 --self-contained and then copy the entire publish directory at C:\Users\vipul.malik\perfview\src\PerfViewCollect\bin\Release\netcoreapp3.1\win-x64\publish. This will ensure that you don't have to have a copy of the .NET Core 3.1 runtime installed on the machine. The self-contained publish will carry all of the dependenceis that you need. You should be able to run PerfViewCollect /? to get the command line help.
While running dotnet publish -c Release -r win-x64 --self-contained I'm getting such error:

Also, will it make any difference if we're on .NET 4.8 or 6 and this requires .NET 3.1?
As long as you have the .NET Core 3.1 SDK installed, you should be fine. These errors don't look SDK specific to me. What directory are you running this in?
I'm running this on root directory of repository D:\perfview-main
I believe you will need to build from the PerfViewCollect directory. I get similar failures when building at the root. I got another failure building in the PerfViewCollect directory, but haven't had time to debug it yet. If you get a GIT failure, we may need to update the package as there has been a change to upgrade to .NET Core 3.1 that may have caused this.