I’ve created a new Web Server API project in Visual Studio 2022 using .NET 8.0. Automatically, the WeatherForecast controller is generated. After compiling and publishing without making any changes, I configured the project on IIS, and everything works fine.
Later, I changed the target platform to x86.
I compiled and published again without receiving any errors. I also tried setting the runtime target to x86 and x64.
However, after configuring the project on IIS, I’m getting a 500.30 error when trying to access the created controller.
When I run the project in Debug/Release mode directly from Visual Studio, everything works fine.
After enabling logging, I receive this error:
Event Log: ‘Application ‘/LM/W3SVC/3/ROOT’ with physical root ‘C:inetpubwwwrootrestapi’ hit unexpected managed exception, exception code = ‘0xe0434352′. Please check the stderr logs for more information.’
End Event Log Message.
Can someone help me resolve this issue? Thanks in advance for any suggestions.