dotnet / dotnet/core

Set a class private string parameter with some value at build time in .net core 3.1 class library project

Open
#4,942 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
PowerShell
Stars
22k
Forks
4.9k
Avg merge
5d 5h
Merged PRs (30d)
29

Description

I have a class in my .net core 3.1 library project where i want to initialize a key at compile time

```
using System.Text;

namespace MyNamespace
{
public class Myclass
{
private string key;

....
}
}
```

I am publishing my library via simple publish command

`dotnet publish -c release -r linux-x64 `
I am exploring an option where i could pass some attribute during compilation which will be set in key property after compilation. I am also obfuscating my dll as well after inital compilation via some third party tool

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.