-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_minimal_deployment.bat
More file actions
65 lines (58 loc) · 2.63 KB
/
create_minimal_deployment.bat
File metadata and controls
65 lines (58 loc) · 2.63 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
@echo off
echo =========================================================
echo WebSpark Minimal IIS Deployment Helper
echo =========================================================
echo This script creates a minimal deployment without trimming or optimization
echo to resolve 502.5 ANCM Out-Of-Process Startup Failure issues.
echo.
echo Creating minimal deployment directory...
if not exist C:\MinimalPublish mkdir C:\MinimalPublish
echo.
echo Publishing applications with minimal optimization...
for %%p in (WebSpark.Web WebSpark.Portal DataSpark.Web) do (
echo.
echo Publishing %%p...
dotnet publish C:\WebSpark\%%p -c Release -o c:\MinimalPublish\%%p --no-self-contained
echo Creating enhanced web.config for %%p...
(
echo ^<?xml version="1.0" encoding="utf-8"?^>
echo ^<configuration^>
echo ^<location path="."^>
echo ^<system.webServer^>
echo ^<handlers^>
echo ^<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" /^>
echo ^</handlers^>
echo ^<aspNetCore processPath="dotnet" arguments=".\%%p.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="OutOfProcess"^>
echo ^<environmentVariables^>
echo ^<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Production" /^>
echo ^</environmentVariables^>
echo ^<handlerSettings^>
echo ^<handlerSetting name="debugFile" value=".\logs\ancm.log" /^>
echo ^<handlerSetting name="debugLevel" value="FILE,TRACE" /^>
echo ^</handlerSettings^>
echo ^</aspNetCore^>
echo ^</system.webServer^>
echo ^</location^>
echo ^</configuration^>
) > "C:\MinimalPublish\%%p\web.config"
if not exist "C:\MinimalPublish\%%p\logs" mkdir "C:\MinimalPublish\%%p\logs"
echo Creating test batch file for %%p...
(
echo @echo off
echo echo Testing %%p standalone execution...
echo dotnet %%p.dll
echo pause
) > "C:\MinimalPublish\%%p\test_app.bat"
)
echo.
echo =========================================================
echo Minimal deployment completed!
echo Applications are in C:\MinimalPublish\
echo.
echo To deploy to IIS:
echo 1. Create application pools with "No Managed Code" setting
echo 2. Create websites/applications pointing to C:\MinimalPublish\[AppName]
echo 3. Ensure ASP.NET Core Module v2 is installed
echo 4. Run test_app.bat in each folder to verify standalone execution
echo =========================================================
pause