postsharp / Metalama

Metalama is a Roslyn-based meta-programming framework. Use this repo to report bugs or ask questions.
164 stars 4 forks source link

Feature request: option to disable the creation of the LamaDebug build configuration #189

Closed gfraiteur closed 8 months ago

gfraiteur commented 11 months ago

Any chance we can get a way to disable the definition of the LambaDebug MSBuild configuration? It adds it to all the possible configuration options in the UI's, and actually breaks VS for Mac if you use any custom configuration/platform combinations (i.e. not Release/Debug + AnyCPU).

PostSharpBot commented 11 months ago

Hello @gfraiteur, thank you for submitting this issue. We will try to get back to you as soon as possible. Note to the PostSharp team, this ticket is being tracked in our dashboard under ID TP-33579.

jahmai-ca commented 11 months ago

May I suggest to convert LamaDebug to a MSBuild property only that can be true rather than a Configuration? Often projects have important existing configuration that wont be set when selecting LamaDebug and compilation can fail.

Alternatively there is a trick to allowing a configuration condition without the configuration being automagically imported into the UI etc that I know of and use myself.

gfraiteur commented 11 months ago

The reason we chose this approach (the LamaDebug configuration) is that it is automatically imported into the UI.

It is a shortcut for three MSBuild properties. See https://doc.metalama.net/conceptual/configuration/msbuild-properties#build-configurations

jahmai-ca commented 11 months ago

I see. The problem is that all our builds require other properties to be set to build correctly, so LamaDebug will never actually build. I imagine this is fairly common, since build configurations are vital to building your project correctly, and LamaDebug only contains properties for Metalama.

prochan2 commented 8 months ago

An MSBuild property MetalamaCreateLamaDebugConfiguration has been introduced in Metalama 2023.4.4-preview. Set this property to false to avoid adding the LamaDebug configuration. You can also set the required properties for the LamaDebug build configuration in your .csproj file or Directory.Build.Props as follows:

<PropertyGroup Condition="'$(Configuration)'=='LamaDebug'">
    <MyProperty>Value</MyProperty>
</PropertyGroup>