Environment Setup

Get started with AtlasX Web Service

ระบบปฏิบัติการที่รองรับ

OSVersionArchitectures
Windows11 23H2, 11 22H2, 10 22H2, 11 21H2 (E), 10 21H2 (E), 10 21H2 (IoT), 10 1809 (E), 10 1607 (E)Arm64, x64, x86
Windows Server23H2, 2022, 2019, 2016, 2012-R2, 2012x64, x86
macOS14, 13, 12x64, Arm64, x64
Ubuntu24.04, 23.10, 22.04, 20.04Arm32, Arm64, x64

สำหรับข้อมูลเพิ่มเติมเกี่ยวกับระบบปฏิบัติการที่รองรับ .NET 8 การเผยแพร่ และนโยบายระยะเวลาสนับสนุน สามารถดูได้ที่ .NET 8 – Supported OS versions

ติดตั้ง Visual Studio Code สำหรับเขียน .NET 8

  1. ดาวน์โหลดและติดตั้ง Visual Studio Code https://code.visualstudio.com/Download
  2. ดาวน์โหลดและติดตั้ง .NET SDK https://dotnet.microsoft.com/en-us/download/dotnet
  3. ติดตั้ง C# Extension จาก Visual Studio Code Marketplace https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp

ตรวจสอบว่า .NET 8 ถูกติดตั้งแล้ว

dotnet --list-sdks

ถ้าติดตั้ง .NET 8 แล้วจะแสดงรายการเวอร์ชั่นที่ได้ติดตั้งไว้

8.0.300 [C:\Program Files\dotnet\sdk]

เพิ่ม Package Source

โปรเจคเทมเพลตของ AtlasX Web Service ให้บริการดาวน์โหลดและติดตั้งผ่าน AtlasX Nuget จำเป็นต้องเพิ่ม Package source ของ AtlasX ในเครื่องของ Developer ก่อนจึงจะสามารถดาวน์โหลดได้ โดยการเพิ่ม Package source ทำแค่ครั้งเดียว ถ้าเคยเพิ่มแล้ว ให้ข้ามขั้นตอนนี้

AtlasX Nuget

dotnet nuget add source https://atlasx.cdg.co.th/nexus/repository/nuget-hosted \
  --name portal-atlasx.cdg.co.th \
  --username [USERNAME] \
  --password [PASSWORD] \
  --store-password-in-clear-text
Note

ติดต่อ Technology Team(si_apt_tech@cdg.co.th) เพื่อสร้าง Account สำหรับใช้งาน AtlasX Nuget

Telerik Nuget (Optional)

dotnet nuget add source https://nuget.telerik.com/nuget \
  --name nuget.telerik.com \
  --username [EMAIL] \
  --password [PASSWORD] \
  --store-password-in-clear-text
Note
  • AtlasX.Web.Service เวอร์ชั่น 5.1.0 เป็นต้นไป Telerik Nuget ถูกคอนฟิกไปกับไฟล์ nuget.config เรียบร้อยแล้ว
  • ไม่ต้องสมัครบัญชีของ Telerik ใหม่
  • ติดต่อ altasx@cdg.co.th เพื่อขอ [EMAIL] และ [PASSWORD] ของ Telerik Reporting เวอร์ชันทดลองใช้งาน (ถ้าจำเป็น)

ตรวจสอบ Package Source

dotnet nuget list source

ดาวน์โหลดและติดตั้ง

AtlasX Web Service สามารถดาวน์โหลดและติดตั้งได้อย่างง่ายผ่าน .NET CLI ที่ถูก Built-in มากับ .NET SDK โดย Developer สามารถดาวน์โหลดเทมเพลตมาติดตั้งไว้ที่เครื่องด้วยคำสั่ง

dotnet new install AtlasX.Web.Service.Templates \
  --nuget-source portal-atlasx.cdg.co.th

ตัวอย่างผลลัพธ์เมื่อดาวน์โหลดสำเร็จ

The following template packages will be installed:
   AtlasX.Web.Service.Templates

Warning: Failed to load NuGet source portal-atlasx.cdg.co.th: the source is not valid. It will be skipped in further processing.
Warning: Failed to scan C:\Users\tech_dev.
Details: Access to the path 'C:\Users\tech_dev\Application Data' is denied.
Success: AtlasX.Web.Service.Templates::5.1.1 installed the following templates:
Template Name       Short Name  Language  Tags
------------------  ----------  --------  ----------
AtlasX Web Service  axws        [C#]      Web/WebAPI

กรณีที่ Developer เคยติดตั้งแล้วอยากจะอัพเดทเป็นเวอร์ชั่นใหม่ สามารถใช้คำสั่งดังต่อไปนี้เพื่อลบเทมเพลตเดิมออกจากเครื่องและติดตั้งเวอร์ชั่นใหม่

# ถอนเวอรชันทีอยูในเครือง Developer
dotnet new uninstall AtlasX.Web.Service.Templates

# ติดตังแบบระบุเวอรชั
dotnet new install AtlasX.Web.Service.Templates::5.1.1 \
  --nuget-source portal-atlasx.cdg.co.th

จากนั้นสร้างโปรเจคเว็บเซอร์วิสด้วยคำสั่ง

dotnet new axws --name MyWebService

อัพเดท AtlasX License จากนั้น ทดสอบรันเว็บเซอร์วิส

cd MyWebService
dotnet run

เปิดเว็บบราวเซอร์แล้วเข้าไปที่ https://localhost:5001/applogin