C
C#17mo ago
skyslide22

✅ How to get build date of a asp.net app?

i want to display the YYYYMMDD in a blazor wasm app, how can i get the build date to display? i have tried this
<PropertyGroup>
<PreBuildEvent>date +"%Y %m %d" > "$(ProjectDir)wwwroot\BuildDate.txt"</PreBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PreBuildEvent>date +"%Y %m %d" > "$(ProjectDir)wwwroot\BuildDate.txt"</PreBuildEvent>
</PropertyGroup>
but that creates a file "\wwwroot\BuildDate.txt", not a file IN wwwroot... ????
5 Replies
Omnissiah
Omnissiah17mo ago
i used <WriteLinesToFile File="$(ProjectDir)\Properties\BuildDate.txt"
skyslide22
skyslide22OP17mo ago
how do i access Properties then in c#? i have seen mutliple examples with that but nowhere a hint where Properties comes from, no namespace named
Omnissiah
Omnissiah17mo ago
you mean the settings? you should create a settings file
Accord
Accord17mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
skyslide22
skyslide22OP17mo ago
found my solution
<PropertyGroup>
<PreBuildEvent>date +"%Y %m %d" > $(pwd)/Client/wwwroot/BuildDate.txt</PreBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PreBuildEvent>date +"%Y %m %d" > $(pwd)/Client/wwwroot/BuildDate.txt</PreBuildEvent>
</PropertyGroup>
Want results from more Discord servers?
Add your server