dotnet / dotnet/msbuild

How to create multiple assets (dll) for one project with msbuild depend on Constans value?

Open
#5,108 1 comment 0 reactions 0 assignees View on GitHub
triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

ITNOA

I have a question in [stackoverflow](https://stackoverflow.com/q/60068638/1539100) but I think this place can make better for get better answer to my question.

I have Visual Studio 2019.

I know we can build one project with multiple configurations, and have a dll per configuration, for example we can have one dll for the Debug configuration of our project and we can have one dll for the Release configuration of our project.

But my question is how to have multiple dlls for one project based on `DefineConstants`, for example one dll when we `ML_HOOSHANG` and have another dll for this project without define this constant?

Another question is how to package this project with hold all of these dlls per definition of our define constants?

Another question is, can I force Visual Studio (msbuild) to generate all dlls per build request?

Is [UsingTask](https://docs.microsoft.com/en-us/visualstudio/msbuild/usingtask-element-msbuild?view=vs-2019) useful for this purpose? or not?

Is there anyway to change `DefineConstants` per `UsingTask`?

Thanks a lot

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.