View Single Post
  #1  
Old 08-27-2007, 01:27 PM
teognost teognost is online now
Registered User
 
Join Date: 05-25-2004
Location: Prague,Czech Republic
Posts: 200
Get AssemblyName\OutputType from a csproj file

I need to get from a csproj file the assembly version and output type.
The file looks like this:
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion> <AssemblyName>AutoTrader.BICManagement</AssemblyName>
<OutputType>Library</OutputType>
pLocation>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>..\..\..\bin\Debug\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
</PropertyGroup>
</Project>

I tried to read it as an xml,having a 'Set Macro' step for CURRENT_ASSEMBLY_NAME:
%READ_XML(%CURRENT_FILE_LOCALFULLPATH%,Project/PropertyGroup/AssemblyName)%
but nothing is set...
However I noticed if the csproj doesn't contain the part
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"-it is read correctly.
But this does not help me ,I need to read the csproj file as it is ,with
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
part inside.
Any idea how can I do it?

Last edited by teognost; 08-28-2007 at 04:41 AM.
Reply With Quote