.NET Core Profiler Crashing on 32 bit Application Environment

Duraikannu Jeyamani 6 Reputation points

Hi Team.

I have developed my own .NET core profiler using VS 2019. To load my profiler, I have set the environment entry in the web.config file.
<environmentVariable name="CORECLR_ENABLE_PROFILING" value="1" />
<environmentVariable name="CORECLR_PROFILER" value="{cf0d821e-299b-5307-a3d8-b283c03916dd}" />
<environmentVariable name="CORECLR_PROFILER_PATH_64" value="C:\apps\Publish_3.0\Publish_3.0\ClrProfiler.dll" />
<environmentVariable name="CORECLR_PROFILER_PATH_32" value="C:\apps\Publish_3.0\Publish_3.0\ClrProfiler32.dll" />

I am able to profile a 64 bit .NET core application that is hosted in IIS.
But, When I try to run 32 bit .NET core application got the below exception due to my profiler.
[aspnetcorev2_inprocess.dll] Event Log: 'Application '/LM/W3SVC/5/ROOT' with physical root 'E:\netcoreapp\bin\Release\netcoreapp3.1\publish\' hit unexpected managed exception, exception code = '0xe0434352'. First 30KB characters of captured stdout and stderr logs:
Unhandled exception. System.BadImageFormatException: Bad binary signature. (0x80131192)
at net core azure.Program.Main(String[] args)
End Event Log Message.

Then I have enabled the debug logs in my .NET core profiler. The below line of code has the problem. (il_writer.cpp, 636)

Please help me why this line of code gives the problem.
NOTE: My Helperassembly.dll builds in AnyCPU architecture. [2]: /api/attachments/186417-capture.jpg?platform=QnA

Internet Information Services
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,130 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Duraikannu Jeyamani 1 Reputation point

    Hi @Bruce Zhang-MSFT

    Sorry for the delay response. Thank you for your understanding. When you test it in VS2019, can it run 32-bit application? No. Application not running from VS 2019 for x86 application.

    When you deploy it on IIS, how did you set IIS application pool? Did you enable 32-bit application in it?
    Yes. I followed the same in IIS server. Kindly give your input.

    0 comments No comments