Table of Contents

Class VSProjectHelper

Namespace
Stride.Core.Assets
Assembly
Stride.Core.Assets.dll
public static class VSProjectHelper
Inheritance
object
VSProjectHelper

Methods

CompileProjectAssemblyAsync(string, ILogger, string, string, string, Dictionary<string, string>?, BuildRequestDataFlags)

public static ICancellableAsyncBuild? CompileProjectAssemblyAsync(string fullProjectLocation, ILogger logger, string targets = "Build", string configuration = "Debug", string platform = "AnyCPU", Dictionary<string, string>? extraProperties = null, BuildRequestDataFlags flags = BuildRequestDataFlags.None)

Parameters

fullProjectLocation string
logger ILogger
targets string
configuration string
platform string
extraProperties Dictionary<string, string>
flags BuildRequestDataFlags

Returns

ICancellableAsyncBuild

GenerateRestoreGraphFile(ILogger, string)

public static Task<DependencyGraphSpec> GenerateRestoreGraphFile(ILogger logger, string projectPath)

Parameters

logger ILogger
projectPath string

Returns

Task<DependencyGraphSpec>

GetOrCompileProjectAssembly(string, ILogger, string, bool, string, string, Dictionary<string, string>?, bool, BuildRequestDataFlags)

public static string GetOrCompileProjectAssembly(string fullProjectLocation, ILogger logger, string targets, bool autoCompileProject, string configuration, string platform = "AnyCPU", Dictionary<string, string>? extraProperties = null, bool onlyErrors = false, BuildRequestDataFlags flags = BuildRequestDataFlags.None)

Parameters

fullProjectLocation string
logger ILogger
targets string
autoCompileProject bool
configuration string
platform string
extraProperties Dictionary<string, string>
onlyErrors bool
flags BuildRequestDataFlags

Returns

string

GetPlatformTypeFromProject(Project)

public static PlatformType? GetPlatformTypeFromProject(Project project)

Parameters

project Project

Returns

PlatformType?

GetProjectGuid(Project)

public static Guid GetProjectGuid(Project project)

Parameters

project Project

Returns

Guid

GetProjectPropertyValue(string, string, string?)

Reads a property explicitly declared in the project file (not SDK/import defaults), or null if absent. Only matches an element carrying the given condition (empty for an unconditioned one), so a Windows-scoped value isn't confused with a portable-TFM default.

public static string? GetProjectPropertyValue(string fullProjectLocation, string propertyName, string? condition = null)

Parameters

fullProjectLocation string
propertyName string
condition string

Returns

string

GetProjectTypeFromProject(Project)

public static ProjectType GetProjectTypeFromProject(Project project)

Parameters

project Project

Returns

ProjectType

LoadProject(string, string, string, Dictionary<string, string>?)

public static Project LoadProject(string fullProjectLocation, string configuration = "Debug", string platform = "AnyCPU", Dictionary<string, string>? extraProperties = null)

Parameters

fullProjectLocation string
configuration string
platform string
extraProperties Dictionary<string, string>

Returns

Project

Reset()

public static void Reset()

RestoreNugetPackages(ILogger, string, bool)

public static Task RestoreNugetPackages(ILogger logger, string projectPath, bool tolerateDowngrade = false)

Parameters

logger ILogger
projectPath string
tolerateDowngrade bool

Suppress NU1605 (package downgrade) for this restore — used by the in-place upgrade flow, where the graph is transiently mixed. Off for normal loads so real downgrades fail.

Returns

Task

SetProjectPropertyValue(string, string, string?, string?)

Writes a property (carrying the given condition) to the project file, or removes it when value is null/empty. Preserves formatting and only saves when something changed.

public static void SetProjectPropertyValue(string fullProjectLocation, string propertyName, string? value, string? condition = null)

Parameters

fullProjectLocation string
propertyName string
value string
condition string