Represents a .csproj file at a specific file location. Provides access to common project properties such as sources, references and more.
More...
|
static CSharpProjectFile | ParseFile (string filePath) |
| Parse a .csproj from the specified file path. This method will thrown an exception if anything goes wrong while parsing.
|
|
static bool | TryParseFile (string filePath, out CSharpProjectFile projectFile) |
| Try to parse a .csproj from the specified file path. This method will not throw an excepion. Use ParseException to access any exception that were thrown.
|
|
static CSharpProjectFile | ParseUnityFile (UnityCSharpProjectFile unityProjectFile) |
|
static bool | TryParseUnityFile (UnityCSharpProjectFile unityProjectFile, out CSharpProjectFile projectFile) |
|
static CSharpProjectFile | ParseUnityFile (string assemblyNameOnly) |
|
static bool | TryParseUnityFile (string assemblyNameOnly, out CSharpProjectFile projectFile) |
|
static string | GetUnityProjectFileLocation (UnityCSharpProjectFile unityProjectFile) |
| Try to get the file path for the specified Unity build in C# project. The return value will be null if the project file could not be found. This usually means that Unity has not generated the project yet, or your project does not require the specifed C# project to be created (No editor scripts for example).
|
|
static CSharpProject | ParseText (string csharpProjectText) |
| Parse a .csproj from the specified string containing the raw xml data. This method will thrown an exception if anything goes wrong while parsing.
|
|
static bool | TryParseText (string csharpProjectText, out CSharpProject project) |
| Try to parse a .csproj from the specified string containing the raw xml data. This method will not throw an excepion. Use ParseException to access any exception that were thrown.
|
|
|
| CSharpProjectFile (string projectPath) |
|
|
static string | UnityProjectDirectory [get] |
| Get the folder path where the current Unity project is located. This will always be the parent folder to 'Assets'.
|
|
string | ProjectPath [get] |
| Get the file path where this project file was loaded from.
|
|
string | ProjectDirectory [get] |
| Get the folder path where this project file exists.
|
|
string | AssemblyName [get] |
| Get the name of the assembly for the C# project.
|
|
IReadOnlyList< string > | Sources [get] |
| Get a collection of all C# source file paths included in this project.
|
|
IReadOnlyList< string > | References [get] |
| Get a collection of all C# reference assembly paths included in this project. The 'HintPath' node for the reference will be used if it is available.
|
|
IReadOnlyList< string > | ProjectReferences [get] |
| Get a collection of all C# project names that are referenced in this project. Project references are used to reference another .csproj.
|
|
IReadOnlyList< string > | Defines [get] |
| Get a collection of all compiler define symbols that are used in this project.
|
|
Exception | ParseException [get, set] |
| Get an exception that wa thrown while trying to parse the project.
|
|
Represents a .csproj file at a specific file location. Provides access to common project properties such as sources, references and more.
◆ GetMetadataReferences()
Get all project references for this project as IMetadataReferenceProvider that can be passed straight to the compiler. Project references will not be resolved by their full path, only name and file extension.
- Returns
Reimplemented from RoslynCSharp.Project.CSharpProject.
◆ GetProjectReferences()
Get all CSharpProjectFile that are referenced by this project.
- Returns
◆ GetUnityProjectFileLocation()
static string RoslynCSharp.Project.CSharpProjectFile.GetUnityProjectFileLocation |
( |
UnityCSharpProjectFile |
unityProjectFile | ) |
|
|
inlinestatic |
Try to get the file path for the specified Unity build in C# project. The return value will be null if the project file could not be found. This usually means that Unity has not generated the project yet, or your project does not require the specifed C# project to be created (No editor scripts for example).
- Parameters
-
unityProjectFile | The UnityCSharpProjectFile to try and find the path for |
- Returns
- A file path if the project was found or null if not
◆ ParseFile()
static CSharpProjectFile RoslynCSharp.Project.CSharpProjectFile.ParseFile |
( |
string |
filePath | ) |
|
|
inlinestatic |
Parse a .csproj from the specified file path. This method will thrown an exception if anything goes wrong while parsing.
- Parameters
-
filePath | The file path of the .csproj file to parse |
- Returns
- A CSharpProject representing the loaded project file
◆ TryParseFile()
static bool RoslynCSharp.Project.CSharpProjectFile.TryParseFile |
( |
string |
filePath, |
|
|
out CSharpProjectFile |
projectFile |
|
) |
| |
|
inlinestatic |
Try to parse a .csproj from the specified file path. This method will not throw an excepion. Use ParseException to access any exception that were thrown.
- Parameters
-
filePath | The file path of the .csproj file to parse |
project | A CSharpProject representing the loaded project file |
- Returns
- True if parsing was successful or false if not
The documentation for this class was generated from the following file:
- C:/Transhuman/S2/Assets/Plugins/RoslynCSharp/Scripts/RoslynCSharp/Runtime/Project/CSharpProjectFile.cs