-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_aspnetcore_iis.bat
More file actions
66 lines (60 loc) · 2.26 KB
/
check_aspnetcore_iis.bat
File metadata and controls
66 lines (60 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
@echo off
echo =========================================================
echo ASP.NET Core Module for IIS Check
echo =========================================================
echo This script checks if the ASP.NET Core Module v2 is properly installed.
echo.
echo 1. Checking if AspNetCoreModuleV2 is registered in IIS...
%windir%\system32\inetsrv\appcmd list modules /name:AspNetCoreModuleV2
if %errorlevel% neq 0 (
echo.
echo ERROR: AspNetCoreModuleV2 is not registered in IIS!
echo.
echo You need to install the ASP.NET Core Hosting Bundle from:
echo https://dotnet.microsoft.com/download/dotnet/9.0
echo.
echo After installation, run 'iisreset' from an administrator command prompt.
) else (
echo.
echo SUCCESS: AspNetCoreModuleV2 is properly registered in IIS.
)
echo.
echo 2. Checking for .NET Core Runtime installation...
dotnet --list-runtimes | findstr "Microsoft.AspNetCore.App 9."
if %errorlevel% neq 0 (
echo.
echo WARNING: .NET 9.0 AspNetCore runtime might not be installed!
echo This could cause 502.5 errors in IIS.
echo.
echo You need to install the .NET 9.0 Runtime from:
echo https://dotnet.microsoft.com/download/dotnet/9.0
) else (
echo.
echo SUCCESS: .NET 9.0 AspNetCore runtime is installed.
)
echo.
echo 3. Testing if IIS can access the dotnet executable...
where dotnet
if %errorlevel% neq 0 (
echo.
echo ERROR: dotnet executable not found in PATH!
echo This will prevent IIS from launching your application.
echo.
echo Ensure the .NET SDK or Runtime is properly installed and in the system PATH.
) else (
echo.
echo SUCCESS: dotnet executable is in PATH.
)
echo.
echo 4. Checking Application Pool settings...
echo Running as IIS Admin account? Make sure application pools are set to:
echo - No Managed Code (.NET CLR Version)
echo - Appropriate identity with permissions to the application folders
echo.
echo 5. If you're still seeing 502.5 errors:
echo a. Check the logs in the application's logs folder
echo b. Run the test_app.bat script in each application folder
echo c. Verify all required connection strings are correct
echo d. Try setting ASPNETCORE_ENVIRONMENT to Development temporarily
echo e. Check Event Viewer (Windows Logs -^> Application) for errors
pause