DEV Community

Calin Baenen
Calin Baenen

Posted on

How do I set the release mode (e.g. "debug", "release") for a CSharp file in `X.csproj`

We're getting ever closer to the release of the new and improved Janky in CSharp. However, I face a new challenge, I'm using CLI tools to do building, and a lot of the tutorials I find when searching are for VSCode building.
Since I'm not using VSCode, I was wondering if there is some option in X.csproj (language.csproj) that would let me achieve this.

Currently, I'm using the default csproj file, since it's in XML (ewwwwww.... (any alternatives to the XML format?)), and I don't know what any of the tags do.
This is currently what it looks like:

<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <TargetFramework>net5.0</TargetFramework>
        <OutputType>Exe</OutputType>
    </PropertyGroup>
</Project>
Enter fullscreen mode Exit fullscreen mode

Thanks!
Cheers!

Top comments (4)

Collapse
 
rmaurodev profile image
Ricardo

I don't think you can use the csproj to define that
In the cli command you define if is release or debug
E.g. dotnet publish -c Release

Checkout this docs, maybe it helps
docs.microsoft.com/pt-br/dotnet/co...

Collapse
 
calinzbaenen profile image
Calin Baenen

Can this be used with build?

Collapse
 
calinzbaenen profile image
Calin Baenen

Nevermind, it does.

Collapse
 
calinzbaenen profile image
Calin Baenen

Thanks! Cheers!