Method | Description | |
---|---|---|
ReadProject ( string filename ) : |
This method is called to read the specified .csproj file and retrieve all the data needed for UI or compilation. It loads the project file as an XML and then get the value of the relevant nodes. Note! It does not get every information available in .csproj. It only retrieves the information considered relevant for UI and compilation. Attention! There may be information in .csproj that are important for the compilation and I may be unaware of these or I may deliberately choose to ignore them. For example, I decided not to support projects that contain references to other projects.
|
Method | Description | |
---|---|---|
GetConfigs ( |
Gets the config files. Config files are found in: < project > < ItemGroup > < None > Then: get name from the attribute "Include", get CopyToOutputDirectory from child element "CopyToOutputDirectory"
|
|
GetContent ( |
Gets the content files. Content files are found in: < project > < ItemGroup > < Content > Then: get name from the attribute "Include", get CopyToOutputDirectory from child element "CopyToOutputDirectory"
|
|
GetCrtConfigurationNode ( |
It is used to get the node that contains the configuration-specific settings for the Configuration and Platform specified. Currently it looks for the section with the "Condition" attribute like: '$(Configuration)|$(Platform)' == '[Configuration]|[Platform]' The node should look like: < PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " > ... < PropertyGroup />
|
|
GetCrtConfigurationValue ( |
It is used to retrieve the value of a property from the configuration-specific section.
|
|
GetPropertyValue ( |
It is used to retrieve the value of a property from the generic properties section (as opposite to configuration-specific section).
|
|
GetReferences ( |
Gets the list of referenced assemblies. Referenced assemblies are found in: < project > < ItemGroup > < Reference >
|
|
GetResources ( |
Gets the resource files. Resource files are found in: < project > < ItemGroup > < EmbeddedResource > Then: get name from the attribute "Include", get DependentUpon from child element "DependentUpon", get CopyToOutputDirectory from child element "CopyToOutputDirectory"
|
|
GetSettings ( |
It is used to read the project settings. It reads general settings (framework version, project type winexe/dll/console...,assembly name etc) and the settings for the active configuration (debug/release...) (output folder, warning level etc). Notes! 1. Form the general section it gets the Configuration and Platform (aka Debug/Release, AnyCPU) and the searches for the section having the condition: '$(Configuration)|$(Platform)' == '[Configuration]|[Platform]' That section is used to get configuration-specific settings. 2. Some important settings like .Net framework version and file alignment were added after .Net 2.0. So when these nodes are missing the values "v2.0" and "512" are used.
|
|
GetSources ( |
Gets the source files. Source files are found in: < project > < ItemGroup > < Compile > Then: get name from the attribute "Include", get DependentUpon from child element "DependentUpon", get CopyToOutputDirectory from child element "CopyToOutputDirectory"
|
public ReadProject ( string filename ) : |
||
filename | string | The name (and path) of the .csproj file. |
return |