DEV Community

loading...

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

baenencalin profile image Calin Baenen ・1 min read

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!

Discussion (4)

pic
Editor guide
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
baenencalin profile image
Calin Baenen Author

Can this be used with build?

Collapse
baenencalin profile image
Calin Baenen Author

Nevermind, it does.

Collapse
baenencalin profile image
Calin Baenen Author

Thanks! Cheers!