settings file properites

essamce 621 Reputation points
2020-10-22T11:29:58.213+00:00

hi,
i'm using VS2019 C#, WPF .NETCore3.1 app,
first time to use setting files, (pic attached)

Q1: in file properties what should i select as Build Action and Copt To Output Directory,
Q2: can i do that in code without using Properties widow.

thanks in advance, any help will be appreciated.

34263-newitems.png

34352-properties.png

Developer technologies | Windows Presentation Foundation
{count} votes

Answer accepted by question author
  1. DaisyTian-1203 11,651 Reputation points Moderator
    2020-10-23T05:43:14.977+00:00

    A1:The Build Action selections depends on your needs, you can refer to this table (Build action values) to see the usage of the items. The selections for Copt To Output Directory, when you choose Copy always means, the file will be copyed in bin/debug always when the project be built. For more details, you can see the options part in Visual Studio: Copying files to Debug or Release folder

    A2:You can set the above settings in the .csproj. eg: If you want to make Copy always for Copy To Output Directory in the .csproj as <CopyToOutputDirectory>Always</CopyToOutputDirectory>


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.