Skip to content

ProjectOptions en

Leksiqq edited this page Aug 25, 2023 · 10 revisions

Attention! This article, as well as this announcement, are automatically translated from Russian.

ProjectOptions class

A set of properties to create a project.

Properties

  • public string? name {get; set; } - part of the full name of the project file and the resulting assembly.

  • public string? namespace {get; set; } - part of the full name of the project file and the resulting assembly.

  • public string? FullName {get; set; } is the full name of the project file and the resulting assembly.

    Either FullName or Name and Namespace is specified (Namespace may be omitted).

  • public string? SDK { get; set; } - Sdk attribute value. If not set, the Microsoft.NET.Sdk project is created.

  • public string? TargetFramework {get; set; } is the value of the TargetFramework project property. If not set, a project is created for $"net{Environment.Version.Major}.{Environment.Version.Minor}".

  • public string? ProjectDir {get; set; } - folder containing the project file. If set, it can contain source files, otherwise the project is created as a temporary one, and all source files must be copied or created into it, and they will be deleted after the application ends.

  • public OutputType? OutputType { get; set; } - the value of the project's OutputType property. If not set, the Library project is created.

  • public bool? GeneratePackage { get; set; } - specifies whether to create the NuGet package at compile time. If true, a package is created with the name FullName and version 1.0.0: $"{FullName}.1.0.0.nupkg". The default value is false.

  • public string? PathToDotnetExe { get; set; } - location of the dotnet.exe file. Required only if not present in the PATH environment variable.

  • public string? BuildOutputLang { get; set; } - specifies the output language of dotnet.exe build .... Specified by either a two-character language code or a locale code ([two-character language code]-[two-character country code]). The default is the current Windows locale.

  • public string? Configuration {get; set; } - configuration value (for example, "Debug" or "Release"). The default value is "RAC".

  • public string? AdditionalDotnetOptions { get; set; } - allows you to specify additional options dotnet.exe build ....

  • public string? NoWarn {get; set; } - allows via ';' list the numbers of compiler warnings to be ignored during compilation.

  • public bool? IsVerbose { get; set; } - if set to true, specifies that the output of dotnet build ... is printed to the console.

  • public Encoding? LogEncoding {get; set; } - if set to true, the IsVerbose property allows you to achieve readable characters displayed on the console. The default is Encoding.UTF8.

  • public bool? ThrowAtBuildWarnings { get; set; } - indicates that if there are compiler warnings other than those listed in the NoWarn property, an exception should be thrown.

  • public Action<Project>? onProjectFileGenerated { get; set; } - a delegate property that is called after the project file is generated. Only the property of the project for which the Compile method is called is called, but for all projects included by the AddProject(Porject) method that are an argument.

Before: (Project) Start: (Overview) Next: (OutputType)