1

I have a csproj with some folders with code from different clients. When i publish my app i get something like this:

  • Client1Folder
  • Client2Folder
  • Client3Folder
  • Client3Folder2
  • SomeCommonFilesAndFolders
  • SomeFileThatNeedToBeDeleted

So in order to give it to client 3 i have to delete some files and end like this:

  • Client3Folder
  • Client3Folder2
  • SomeCommonFilesAndFolders

Whats the best way to aproach this? I searched something like project configuration like "Debug" and "Release" but i dont know if thats ok and how to specify the folders.

1 Answer 1

2

You can add a configuration per client and then in your csproj do something like this:

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Client3|AnyCPU'">
    <OutputPath>bin\Client3\</OutputPath>
    <ExcludeFilesFromDeployment>SomeFileThatNeedToBeDeleted</ExcludeFilesFromDeployment>
    <ExcludeFoldersFromDeployment>Client1Folder;Client2Folder</ExcludeFoldersFromDeployment>
</PropertyGroup>

Publish

dotnet publish -c Client3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.