My Project
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes | Properties | List of all members
RoslynCSharp.Project.CSharpProject Class Reference

Represents a .csproj file contents and provides access to common project properties such as sources, references and more. More...

Inheritance diagram for RoslynCSharp.Project.CSharpProject:
RoslynCSharp.Project.CSharpProjectFile

Public Member Functions

virtual IMetadataReferenceProvider[] GetMetadataReferences ()
 Get all references for this project as IMetadataReferenceProvider that can be passed straight to the compiler.
 

Static Public Member Functions

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.
 

Protected Attributes

IMetadataReferenceProvider[] compilerReferences = null
 

Properties

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.
 

Detailed Description

Represents a .csproj file contents and provides access to common project properties such as sources, references and more.

Member Function Documentation

◆ GetMetadataReferences()

virtual IMetadataReferenceProvider[] RoslynCSharp.Project.CSharpProject.GetMetadataReferences ( )
inlinevirtual

Get all references for this project as IMetadataReferenceProvider that can be passed straight to the compiler.

Returns

Reimplemented in RoslynCSharp.Project.CSharpProjectFile.

◆ ParseText()

static CSharpProject RoslynCSharp.Project.CSharpProject.ParseText ( string  csharpProjectText)
inlinestatic

Parse a .csproj from the specified string containing the raw xml data. This method will thrown an exception if anything goes wrong while parsing.

Parameters
csharpProjectTextA string containing .csproj formatted data
Returns
A CSharpProject for the specified project string

◆ TryParseText()

static bool RoslynCSharp.Project.CSharpProject.TryParseText ( string  csharpProjectText,
out CSharpProject  project 
)
inlinestatic

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.

Parameters
csharpProjectTextA string containing .csproj formatted data
projectA CSharpProject for the specified project string
Returns
True if parsing was successful or false if not

The documentation for this class was generated from the following file: