# dotnet application name 在 .net core 3.1 以後的專案中應該多少都有用到以下這一個屬性 ``` PlatformServices.Default.Application.ApplicationName ``` 這個屬性是 Microsoft.Extensions.PlatformAbstractions 這個套件的成員,但是其實這個套件已經被微軟標記過時,且將從微軟官方 nuget 套件庫移除。 因此,建議使用以下幾種成員代替 ``` Assembly.GetExecutingAssembly().GetName().Name Assembly.GetEntryAssembly().GetName().Name AppDomain.CurrentDomain.FriendlyName ``` 以上三種成員都可以取得與 PlatformServices.Default.Application.ApplicationName 相同的文字字串,則一使用即可。 備註:其實 PlatformServices.Default.Application.ApplicationName 背後調用的程式碼就是 Assembly.GetEntryAssembly().GetName().Name
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up