Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
231 views
in Technique[技术] by (71.8m points)

.net core - Reference linked directories instead of hard coding them in my C# project

I've a pactnet test in my C# project. This is the configuration it currently has:

var pactConfig = new PactConfig
{
    SpecificationVersion = "2.0.0",
    PactDir = @"..........pacts",
    LogDir = @".pact_logs"
};

I don't like that PactDir and LogDir are hardcoded and I believe it's possible to add these as a linked reference in my .csproj file and reference them in some way.

I think I need something like this in .csproj(the like is 3 levels up):

<ItemGroup>
    <Folder Include="....pacts" />
</ItemGroup>

Is that correct and even if it is, how do I reference it in my pactConfig?

question from:https://stackoverflow.com/questions/65923499/reference-linked-directories-instead-of-hard-coding-them-in-my-c-sharp-project

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...