IIS က Windows Optional Feature တစ်ခုပါ။
-
Control Panel → Programs → Programs and Features
-
ဘေးဘက်မှာ Turn Windows features on or off ကိုနှိပ်ပါ
(သို့) Run dialog (Win + R) →
optionalfeatures.exeလို့ရိုက်ပြီး Enter (Windows Features ပေါ်လာမယ်)
Windows Features dialog ထဲမှာ—
✅ Internet Information Services ကို check လုပ်ပါ
ပြီးရင် OK နှိပ် → Windows က components install လုပ်ပြီးပြီဆိုရင် restart တောင်းရင် restart လုပ်ပါ။
IIS ကို check လုပ်တဲ့အချိန် Expand လုပ်ပြီး အောက်ပါ items တွေကိုလည်း သေချာ check လုပ်ထားရင် အဆင်ပြေပါတယ်—
- Web Management Tools
- ✅ IIS Management Console
- World Wide Web Services
- ✅ Application Development Features (default လောက် OK)
- ✅ Common HTTP Features
သင်တန်း/Dev machine အတွက်တော့ အပေါ်ကလောက်နဲ့ လုံလောက်ပါတယ်။
Start menu မှာ IIS Manager လို့ရှာပြီးဖွင့်ပါ။
Browser မှာ http://localhost သွားကြည့်ရင် IIS default page ပေါ်လာရင် IIS OK ဖြစ်ပါပြီ။
ASP.NET Core app ကို IIS ပေါ် run မယ်ဆိုရင် ASP.NET Core Module (ANCM) လိုပါတယ်။
Microsoft က .NET Hosting Bundle ထဲမှာ Runtime + ANCM ကိုအတူတကွထည့်ပေးထားပါတယ်။ (Microsoft Learn)
Microsoft Learn / .NET download page ကနေ .NET 8 Hosting Bundle ကို download လုပ်ပါ (Windows အတွက် recommended)။ (Microsoft)
Downloaded installer ကို Run → Next → Install
Install ပြီးရင် IIS ကို restart လုပ်ပါ (အရေးကြီး)
-
CMD (Admin) →
iisreset(သို့) Server/PC restart
Hosting bundle က ASP.NET Core Module + Runtime ကို install လုပ်ပေးတာကြောင့် IIS restart လုပ်ရင် changes apply ဖြစ်ပါတယ်။ (Microsoft Learn)
Visual Studio မှာ—
- Project → Right click → Publish
- Folder ကိုရွေး
- Target folder တစ်ခု သတ်မှတ် (ဥပမာ
C:\Publish\MyApp) - Publish နှိပ်
IIS အတွက် သာမန်အားဖြင့် Framework-dependent publish လုပ်ပြီး Hosting Bundle ရှိရင် run လို့ရပါတယ်။
IIS Manager ဖွင့် → ဘယ်ဘက် tree မှာ
- Sites → Right click → Add Website…
- Site name:
MyDotNet8App - Physical path: publish folder (
C:\Publish\MyApp) - Port:
8080(ဥပမာ)
- Site name:
- OK
Default Web Site→ Right click → Add Application…- Alias:
myapp - Physical path: publish folder
- Alias:
- OK
ASP.NET Core (.NET 8) app က “ASP.NET Framework” မဟုတ်တဲ့အတွက် app pool ကို No Managed Code ထားရပါတယ်။
- IIS Manager → Application Pools
- သင့် app pool ကိုရွေး → Basic Settings…
- .NET CLR version = No Managed Code
- OK
ASP.NET Core app ကို IIS က ANCM တဆင့် Kestrel ကို forward လုပ်တာကြောင့် No Managed Code သုံးတာက standard ပါ။ (Microsoft Learn)
App folder ကို IIS worker process က read/execute လုပ်နိုင်ဖို့ permission လိုပါတယ်။
Publish folder (C:\Publish\MyApp) ကို right click → Properties → Security → Edit → Add
IIS_IUSRSကို add- Allow: Read & Execute, List folder contents, Read
Browser မှာ—
- New website port သုံးထားရင်:
http://localhost:8080 - Application alias သုံးထားရင်:
http://localhost/myapp
- Hosting Bundle မရှိ/မမှန်တာများပါတယ် → Hosting Bundle (.NET 8) install ပြန်စစ်ပါ (Microsoft Learn)
- Install ပြီးရင်
iisreset
- App start မဖြစ်လို့ crash ဖြစ်တတ်
- Event Viewer (Windows Logs → Application) စစ်ပါ
- Publish output folder မှာ
web.configရှိ/မရှိ စစ်ပါ (publish လုပ်ရင် auto ထွက်ပါတယ်)
web.config မှာ stdout log enable (temporary only) လုပ်လို့ရတတ်ပါတယ် (production မှာ disk fill မဖြစ်အောင် ပိတ်ထားတာကောင်းပါတယ်)
IIS hosting & deploy guide မှာ Troubleshooting/logging လမ်းညွှန်တွေပါပါတယ်။
✅ IIS enabled (IIS Manager ရ)
✅ IIS Management Console installed
✅ .NET 8 Hosting Bundle installed + iisreset လုပ်ပြီး
✅ App published to folder
✅ IIS site/app points to that folder
✅ App Pool = No Managed Code
✅ Folder permission ok