Menu

Post image 1
Post image 2
Post image 3
1 / 3
0

Display project Attribute (C#)

DEV Community·Karen Payne·about 1 month ago
#bG3Ynro4
Reading 0:00
15s threshold

Introduction Learn how to read project properties stored in a C# project file. By storing property values in the project file rather than in code or appsettings.json. 💡 No tampering once pushed to production. Step 1 Add the following PropertyGroup to a .csproj file and replace values with your values. <PropertyGroup> <Product> Code sample </Product> <Description> A sample project demonstrating assembly metadata retrieval. </Description> <Company> Payne services </Company> <Copyright> 2019-$([System.DateTime]::Now.Year) </Copyright> </PropertyGroup> Enter fullscreen mode Exit fullscreen mode Step 2 Add the following project reference to the project Source code , which contains code to read values from the project file in step 1. Step 3 Display values in an ASP.NET Core project.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More