none
Conditional file include based on a conditional compilation symbol

    Question

  • Hi All,


    How do I include a file into a Visual Studio Project only if the project's "conditional compilation symbols" include the RETAIL one ?

    We need to use this with MSBuild.


    Thanks in advance,

    Alberto
    Sunday, September 20, 2009 1:24 PM

Answers

  • This is because the the IsEvaluation property is set at BeforeBuild target while the EmbeddedResource and Compile itemgroups are set at the initial time of msbuild execution.

    The solution is to remove those items in BeforeBuild target instead of exclude when defining them:

      <Target Name="BeforeBuild">
        <MSBuild.ExtensionPack.Framework.TextString TaskAction="Compare" Comparison="Contains" String1="$(DefineConstants)" String2="STANDARD" IgnoreCase="true">
          <Output PropertyName="IsEvaluation" TaskParameter="Result" />
        </MSBuild.ExtensionPack.Framework.TextString>
        <Message Text="Is evaluation: $(IsEvaluation)" />
        <ItemGroup>
          <EmbeddedResource Remove="DeployLX\eyeshotRuntime.lic" Condition="$(IsEvaluation)==false" />
          <Compile Remove="EntityList.cs" Condition="$(IsEvaluation)==false" />
        </ItemGroup>
      </Target>
    Please remove any other IsEvaluation condition check at itemgroup definition.

     

    Hongye Sun [MSFT]

    MSDN Subscriber Support in Forum

    If you have any feedback on our support, please contact msdnmg at microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by devdept Wednesday, October 07, 2009 1:16 PM
    Wednesday, October 07, 2009 8:03 AM

All replies

  • Hi Alberto,

    In VS project, the conditional compilation symbols are defined as:

    <

     

    DefineConstants>TRACE;DEBUG;RETAIL</DefineConstants>

    In MSBuild 3.5, you have to use other task to parse the text in the property. Please take a look at:
    http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/827eb72a-65fb-426c-862c-6095f71bd4bc

     

    Hongye Sun [MSFT]

    MSDN Subscriber Support in Forum

    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, September 21, 2009 10:13 AM
  • Thanks Hongye,


    Suppose you have the following item group in the visual studio project listing:

    <ItemGroup> 
    
    <Compile Include="FolderName\File.ext" /> 
    
    </ItemGroup> 
    


    What shall we add to include it only if the following includes the RETAIL symbol?


    <DefineConstants>TRACE;DEBUG;RETAIL</DefineConstants>
    

    Thanks,

    Alberto
    Monday, September 21, 2009 11:02 AM
  • Hi Alberto,

    Please first download msbuild extension pack at http://www.msbuildextensionpack.com/

    Importing its tasks, then use the following task:

    <MSBuild.ExtensionPack.Framework.TextString TaskAction="Compare" Comparison="Contains" String1="$(DefineConstants)" String2="RETAIL" IgnoreCase="false">
    <Output PropertyName="IsRetail" TaskParameter="Result"/>
    </MSBuild.ExtensionPack.Framework.TextString>
    
    <ItemGroup> 
    <Compile Include="FolderName\File.ext" Condition="$(IsRetail) == true" /> 
    </ItemGroup> 
    

     


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by devdept Wednesday, September 23, 2009 7:11 AM
    • Unmarked as answer by devdept Tuesday, September 29, 2009 12:41 PM
    • Marked as answer by devdept Tuesday, September 29, 2009 12:41 PM
    • Unmarked as answer by devdept Tuesday, October 06, 2009 1:34 PM
    Wednesday, September 23, 2009 2:05 AM
  • Importing its tasks, then use the following task:

    What do you mean with "importing" ?


    Thanks,

    Alberto
    Wednesday, September 23, 2009 4:55 AM
  • Using a task by UsingTask element
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Wednesday, September 23, 2009 5:08 AM
  • Thanks again,

    Alberto
    Wednesday, September 23, 2009 7:11 AM
  • Hi,

    I have unloaded my VStudio project, editied it and added the UsingTask and MSBuild.ExtensionPack.Framework.TextString tags below.

    I can't load back the project because of the following error: Task MSBuild.ExtensionPack.Framework.TextString is not defined. Why ?
     

    Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">

    <
    UsingTask TaskName="MSBuild.ExtensionPack.Framework.TextString" AssemblyName="C:\Program Files (x86)\MSBuild\ExtensionPack\MSBuild.ExtensionPack.dll"/>
    <
    MSBuild.ExtensionPack.Framework.TextString TaskAction="Compare" Comparison="Contains" String1="$(DefineConstants)" String2="RETAIL" IgnoreCase="false">
    <
    Output PropertyName="IsRetail" TaskParameter="Result"/>
    </
    MSBuild.ExtensionPack.Framework.TextString> 

    PropertyGroup>
    <
    Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <
    Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <
    ProductVersion>9.0.30729</ProductVersion>
    ....

    Tuesday, September 29, 2009 12:41 PM
  • MSBuild.ExtensionPack.Framework.TextString is a task. It should be placed at a target to run.

    For example in this case, you can write:

    <

     

     

    <

     

     

    Import Project="$(MSBuildExtensionsPath)\ExtensionPack\MSBuild.ExtensionPack.tasks"/>Target Name="BeforeBuild">

    <

     

    MSBuild.ExtensionPack.Framework.TextString TaskAction="Compare" Comparison="Contains" String1="$(DefineConstants)" String2="RETAIL" IgnoreCase="false">

    <

     

    Output PropertyName="IsRetail" TaskParameter="Result"/>

    </

     

    MSBuild.ExtensionPack.Framework.TextString>

    <I

     

    temGroup>

    <

     

    Compile Remove="Program.cs" Condition="$(IsRetail) == true" />

    </

     

    ItemGroup>

    </

     

    Target>

     

     

     

     

     

     

     

    If you experience any assembly loading problem, please try the following methods:
    1. Register the MSBuild.ExtensionPack.dll into GAC
    2. Run the command sn.exe -Vr *,10d297e8e737fe34 under C:\Program Files (x86)\MSBuild\ExtensionPack
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Wednesday, September 30, 2009 3:27 PM
  • Thanks, Now I try.

    Alberto
    Monday, October 05, 2009 1:39 PM
  • Hi Again


    Nothing to do, the files are never included, even if the string was successfully found! Why ?!?

    There are two files that need to be included if the $(IsEvaluation) variable is true. What else am I missing?


    The project:

    <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
      <UsingTask AssemblyFile="C:\Program Files (x86)\MSBuild\ExtensionPack\MSBuild.ExtensionPack.dll" TaskName="MSBuild.ExtensionPack.Framework.TextString"/>
      <PropertyGroup>
        <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
        <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
        <ProductVersion>9.0.30729</ProductVersion>
        <SchemaVersion>2.0</SchemaVersion>
        <ProjectGuid>{572E8F4E-3C4B-4E37-BFD3-2BB33B3FC1B5}</ProjectGuid>
        <OutputType>Library</OutputType>
        <AppDesignerFolder>Properties</AppDesignerFolder>
        <RootNamespace>xxxx.xxxx</RootNamespace>
        <AssemblyName>xxxx.xxxxNurbs</AssemblyName>
        <SignAssembly>true</SignAssembly>
        <AssemblyOriginatorKeyFile>xxxxNurbsStrongNameKey.snk</AssemblyOriginatorKeyFile>
        <FileUpgradeFlags>
        </FileUpgradeFlags>
        <UpgradeBackupLocation>
        </UpgradeBackupLocation>
        <OldToolsVersion>2.0</OldToolsVersion>
        <IsWebBootstrapper>false</IsWebBootstrapper>
        <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
        <PublishUrl>publish\</PublishUrl>
        <Install>true</Install>
        <InstallFrom>Disk</InstallFrom>
        <UpdateEnabled>false</UpdateEnabled>
        <UpdateMode>Foreground</UpdateMode>
        <UpdateInterval>7</UpdateInterval>
        <UpdateIntervalUnits>Days</UpdateIntervalUnits>
        <UpdatePeriodically>false</UpdatePeriodically>
        <UpdateRequired>false</UpdateRequired>
        <MapFileExtensions>true</MapFileExtensions>
        <ApplicationRevision>0</ApplicationRevision>
        <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
        <UseApplicationTrust>false</UseApplicationTrust>
        <BootstrapperEnabled>true</BootstrapperEnabled>
      </PropertyGroup>
      <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
        <DebugSymbols>true</DebugSymbols>
        <DebugType>full</DebugType>
        <Optimize>false</Optimize>
        <OutputPath>bin\Debug\</OutputPath>
        <DefineConstants>TRACE;DEBUG; STANDARD, PROFESSIONAL, NURBS, LICENSING, BETA, NURBS_COLOR_CODED</DefineConstants>
        <ErrorReport>prompt</ErrorReport>
        <WarningLevel>4</WarningLevel>
        <DocumentationFile>
        </DocumentationFile>
        <NoWarn>
        </NoWarn>
        <PlatformTarget>AnyCPU</PlatformTarget>
      </PropertyGroup>
      <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
        <DebugType>pdbonly</DebugType>
        <Optimize>true</Optimize>
        <OutputPath>bin\Release\</OutputPath>
        <DefineConstants>TRACE;STANDARD, PROFESSIONAL, NURBS</DefineConstants>
        <ErrorReport>prompt</ErrorReport>
        <WarningLevel>4</WarningLevel>
        <DocumentationFile>bin\Release\Nurbs\xxxx.xxxxNurbs.XML</DocumentationFile>
        <NoWarn>0618</NoWarn>
        <PlatformTarget>AnyCPU</PlatformTarget>
      </PropertyGroup>
      <ItemGroup>
        <Reference Include="System" />
        <Reference Include="System.Data" />
        <Reference Include="System.Drawing" />
        <Reference Include="System.Windows.Forms" />
        <Reference Include="System.Xml" />
      </ItemGroup>
      <ItemGroup>
        <Compile Include="Properties\Resource.Designer.cs">
          <AutoGen>True</AutoGen>
          <DesignTime>True</DesignTime>
          <DependentUpon>Resource.resx</DependentUpon>
        </Compile>
        <Compile Include="ViewportNurbs.cs">
          <SubType>Component</SubType>
        </Compile>
        <Compile Include="xxxxException.cs" />
        <Compile Include="Iges\IgesBoundaryEntity.cs" />
        <Compile Include="Iges\IgesBoundedSurfaceEntity.cs" />
        <Compile Include="Iges\IgesCompositeCurve.cs" />
        <Compile Include="Iges\IgesColor.cs" />
        <Compile Include="Iges\IgesCopiousData.cs" />
        <Compile Include="Iges\IgesCurveOnParametricSurface.cs" />
        <Compile Include="Iges\IgesEntity.cs" />
        <Compile Include="Iges\IgesLine.cs" />
        <Compile Include="Iges\IgesPoint.cs" />
        <Compile Include="Iges\IgesRationalBSplineCurve.cs" />
        <Compile Include="Iges\IgesRationalBSplineSurface.cs" />
        <Compile Include="Iges\IgesRuledSurface.cs" />
        <Compile Include="Iges\IgesSurfaceOfRevolution.cs" />
        <Compile Include="Iges\IgesTransformation.cs" />
        <Compile Include="Iges\IgesTrimmedParametricSurface.cs" />
        <Compile Include="Labels\LabelBase.cs" />
        <Compile Include="Labels\ImageOnly.cs" />
        <Compile Include="Labels\LeaderAndText.cs" />
        <Compile Include="MarchingCubes.cs" />
        <Compile Include="Nurbs\Surface.Draw.cs" />
        <Compile Include="Nurbs\Surface.Regen.cs" />
        <Compile Include="Viewport.cs">
          <SubType>Component</SubType>
        </Compile>
        <Compile Include="Viewport.Designer.cs">
          <DependentUpon>Viewport.cs</DependentUpon>
        </Compile>
        <Compile Include="Viewport.Mouse.cs">
          <DependentUpon>Viewport.cs</DependentUpon>
          <SubType>Component</SubType>
        </Compile>
        <Compile Include="Viewport.Draw.cs">
          <DependentUpon>Viewport.cs</DependentUpon>
          <SubType>Component</SubType>
        </Compile>
        <Compile Include="ViewportProfessional.cs">
          <SubType>Component</SubType>
        </Compile>
        <Compile Include="ViewportStandard.cs">
          <SubType>Component</SubType>
        </Compile>
        <Compile Include="Properties\AssemblyInfo.cs" />
        <Compile Include="Entities\Arc.cs" />
        <Compile Include="Entities\Bar.cs" />
        <Compile Include="Entities\Circle.cs" />
        <Compile Include="Entities\Entity.cs" />
        <Compile Include="Entities\Joint.cs" />
        <Compile Include="Entities\Line.cs" />
        <Compile Include="Entities\Mesh.Draw.cs" />
        <Compile Include="Entities\Point.cs" />
        <Compile Include="Entities\LinearPath.cs" />
        <Compile Include="Entities\Quad.cs" />
        <Compile Include="Entities\StlModel.cs" />
        <Compile Include="Entities\Triangle.cs" />
        <Compile Include="Texture.cs" />
      </ItemGroup>
      <ItemGroup>
        <EmbeddedResource Include="Cursors\pan.cur" />
        <EmbeddedResource Include="Cursors\rotate.cur" />
        <EmbeddedResource Include="Cursors\zoom.cur" />
      </ItemGroup>
      <ItemGroup>
        <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
          <Visible>False</Visible>
          <ProductName>.NET Framework Client Profile</ProductName>
          <Install>false</Install>
        </BootstrapperPackage>
        <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
          <Visible>False</Visible>
          <ProductName>.NET Framework 2.0 %28x86%29</ProductName>
          <Install>true</Install>
        </BootstrapperPackage>
        <BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
          <Visible>False</Visible>
          <ProductName>.NET Framework 3.0 %28x86%29</ProductName>
          <Install>false</Install>
        </BootstrapperPackage>
        <BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
          <Visible>False</Visible>
          <ProductName>.NET Framework 3.5</ProductName>
          <Install>false</Install>
        </BootstrapperPackage>
        <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
          <Visible>False</Visible>
          <ProductName>.NET Framework 3.5 SP1</ProductName>
          <Install>false</Install>
        </BootstrapperPackage>
      </ItemGroup>
      <ItemGroup>
        <EmbeddedResource Include="Cursors\smallBox.cur" />
      </ItemGroup>
      <ItemGroup>
        <None Include="xxxxNurbsStrongNameKey.snk" />
      </ItemGroup>
      <ItemGroup>
        <EmbeddedResource Include="Cursors\bigBox.cur" />
        <EmbeddedResource Include="Cursors\mediumBox.cur" />
      </ItemGroup>
      <ItemGroup>
        <Content Include="Images\origin.tif" />
        <EmbeddedResource Include="Viewport.bmp" />
      </ItemGroup>
      <ItemGroup>
        <COMReference Include="DWGdirectX">
          <Guid>{EE2303F2-4EF6-42F6-92AB-4241221FF278}</Guid>
          <VersionMajor>2</VersionMajor>
          <VersionMinor>7</VersionMinor>
          <Lcid>0</Lcid>
          <WrapperTool>tlbimp</WrapperTool>
          <Isolated>False</Isolated>
        </COMReference>
        <COMReference Include="OdaX">
          <Guid>{B51C79A0-B8BC-4904-8125-1ACBE8B55D46}</Guid>
          <VersionMajor>2</VersionMajor>
          <VersionMinor>7</VersionMinor>
          <Lcid>0</Lcid>
          <WrapperTool>tlbimp</WrapperTool>
          <Isolated>False</Isolated>
        </COMReference>
        <COMReference Include="stdole">
          <Guid>{00020430-0000-0000-C000-000000000046}</Guid>
          <VersionMajor>2</VersionMajor>
          <VersionMinor>0</VersionMinor>
          <Lcid>0</Lcid>
          <WrapperTool>primary</WrapperTool>
          <Isolated>False</Isolated>
        </COMReference>
      </ItemGroup>
      <ItemGroup>
        <EmbeddedResource Include="DeployLX\xxxxRuntime.lic" Condition="$(IsEvaluation) == true"/>
      </ItemGroup>
      <ItemGroup>
        <EmbeddedResource Include="ViewportProfessional.resx">
          <SubType>Designer</SubType>
          <DependentUpon>ViewportProfessional.cs</DependentUpon>
        </EmbeddedResource>
      </ItemGroup>
      <ItemGroup>
        <EmbeddedResource Include="DeployLX\DeployLX.Licensing.v3.resx">
          <SubType>Designer</SubType>
        </EmbeddedResource>
        <EmbeddedResource Include="Properties\Resource.resx">
          <SubType>Designer</SubType>
          <Generator>ResXFileCodeGenerator</Generator>
          <LastGenOutput>Resource.Designer.cs</LastGenOutput>
        </EmbeddedResource>
        <EmbeddedResource Include="Viewport.resx">
          <DependentUpon>Viewport.cs</DependentUpon>
          <SubType>Designer</SubType>
        </EmbeddedResource>
        <Reference Include="xxxx.Geometry, Version=1.0.436.0, Culture=neutral, PublicKeyToken=f0eaf7ee820156a1, processorArchitecture=MSIL">
          <SpecificVersion>False</SpecificVersion>
          <HintPath>..\Foundation\bin\Release\xxxx.Geometry.dll</HintPath>
        </Reference>
        <Reference Include="System.configuration" />
        <Reference Include="System.Core">
          <RequiredTargetFramework>3.5</RequiredTargetFramework>
        </Reference>
        <Reference Include="System.Design" />
        <Reference Include="System.Runtime.Remoting" />
        <Reference Include="System.Web" />
        <Reference Include="System.Web.Services" />
      </ItemGroup>
      <ItemGroup>
        <Compile Include="Block.cs" />
        <Compile Include="BlockList.cs" />
        <Compile Include="Camera.cs">
            <Compile Include="Entities\Mesh.cs" />
        <Compile Include="Entities\Mesh.ExtrudeRevolve.cs" />
        <Compile Include="Entities\BlockReference.cs" />
        <Compile Include="Entities\Mesh.EarClipping.cs" />
      </ItemGroup>
      <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
      <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
           Other similar extension points exist, see Microsoft.Common.targets.
      <Target Name="BeforeBuild">
      </Target>
      <Target Name="AfterBuild">
      </Target>
      -->
      <Target Name="BeforeBuild">
        <MSBuild.ExtensionPack.Framework.TextString TaskAction="Compare" Comparison="Contains" String1="$(DefineConstants)" String2="STANDARD" IgnoreCase="true">
          <Output PropertyName="IsEvaluation" TaskParameter="Result"/>
        </MSBuild.ExtensionPack.Framework.TextString>
        <Message Text="Is evaluation: $(IsEvaluation)"/>
      </Target>
    </Project>
     
    The output:
     Microsoft Windows [Version 6.0.6002]
    Copyright (c) 2006 Microsoft Corporation.  All rights reserved.
    C:\Users\Alberto>C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe c:\xxxx\
    nextxxxx\xxxx\xxxxNurbsRetail.sln /t:rebuild /p:OutDir=c:\xxxx\nextxxxx\xxxx\bin\Release\Nurbs\Retail\ /p:Configuration=release;WarningLevel=1
    ;DefineConstants="STANDARD, PROFESSIONAL, NURBS, LICENSING"
    Microsoft (R) Build Engine Version 3.5.30729.1
    [Microsoft .NET Framework, Version 2.0.50727.4016]
    Copyright (C) Microsoft Corporation 2007. All rights reserved.
    Build started 10/6/2009 3:29:47 PM.
    Project "c:\xxxx\nextxxxx\xxxx\xxxxNurbsRetail.sln" on node 0 (rebu
    ild target(s)).
      Building solution configuration "release|Any CPU".
    Project "c:\xxxx\nextxxxx\xxxx\xxxxNurbsRetail.sln" (1) is building
     "c:\xxxx\nextxxxx\xxxx\xxxxNurbsRetail.csproj" (2) on node 0 (Rebu
    ild target(s)).
      Deleting file "c:\xxxx\nextxxxx\xxxx\obj\Release\ResolveAssemblyRefe
      rence.cache".
      Deleting file "c:\xxxx\nextxxxx\xxxx\obj\Release\Interop.DWGdirectX.
      dll".
      Deleting file "c:\xxxx\nextxxxx\xxxx\obj\Release\Interop.OdaX.dll".
      Deleting file "c:\xxxx\nextxxxx\xxxx\obj\Release\xxxxNurbsRetail.
      csproj.ResolveComReference.cache".
      Deleting file "c:\xxxx\nextxxxx\xxxx\obj\Release\xxxx.xxxx.Dep
      loyLX.DeployLX.Licensing.v3.resources".
      Deleting file "c:\xxxx\nextxxxx\xxxx\obj\Release\xxxx.xxxx.Pro
      perties.Resource.resources".
      Deleting file "c:\xxxx\nextxxxx\xxxx\obj\Release\xxxx.xxxx.Vie
      wport.resources".
      Deleting file "c:\xxxx\nextxxxx\xxxx\obj\Release\xxxxNurbsRetail.
      csproj.GenerateResource.Cache".
      Deleting file "c:\xxxx\nextxxxx\xxxx\obj\Release\xxxx.xxxx.Vie
      wportProfessional.resources".
    EntityClean:
      Successfully cleaned the output for 0 EDMX files.
    EntityDeploy:
      Processing 0 EDMX files.
      Finished processing 0 EDMX files.
    BeforeBuild:
      Comparing String: STANDARD, PROFESSIONAL, NURBS, LICENSING [CONTAINS] STANDAR
      D
      Is evaluation: True
    C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning : Th
    e type library importer could not convert the signature for the member 'tagCALP
    OLESTR.pElems'.
    C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning : Th
    e type library importer could not convert the signature for the member 'tagCADW
    ORD.pElems'.
    CoreResGen:
      Processing resource file "ViewportProfessional.resx" into "obj\Release\devDep
      t.xxxx.ViewportProfessional.resources".
      Processing resource file "DeployLX\DeployLX.Licensing.v3.resx" into "obj\Rele
      ase\xxxx.xxxx.DeployLX.DeployLX.Licensing.v3.resources".
      Processing resource file "Properties\Resource.resx" into "obj\Release\xxxx
      .xxxx.Properties.Resource.resources".
      Processing resource file "Viewport.resx" into "obj\Release\xxxx.xxxx.Vi
      ewport.resources".
    DeployLX\DeployLX.Licensing.v3.cs(42,10): warning CS1030: #warning: 'Remember t
    hat you must use an authorized assembly encryption or obfuscation tool on the r
    esulting assembly when you embed the source code. '
    DeployLX\DeployLX.Licensing.v3.cs(43,10): warning CS1030: #warning: 'Visit http
    ://goto.xheo.com/authorizedenc.aspx to review the most recent list of authorize
    d tools.'
    DeployLX\DeployLX.Licensing.v3.cs(44,10): warning CS1030: #warning: 'Only the d
    eveloper(s) that have executed a signed EULA and obtained a license to use the
    source may view or compile the source code. You may not share the source with a
    ny other user (even at the same organization) or check in to any source control
     system that provides access to multiple users. '
    Nurbs\Surface.Draw.cs(24,55): error CS0246: The type or namespace name 'CharDat
    a' could not be found (are you missing a using directive or an assembly referen
    ce?)
    Nurbs\Surface.Regen.cs(15,53): error CS0246: The type or namespace name 'CharDa
    ta' could not be found (are you missing a using directive or an assembly refere
    nce?)
    Viewport.cs(102,18): error CS0246: The type or namespace name 'EntityList' coul
    d not be found (are you missing a using directive or an assembly reference?)
    Viewport.cs(111,16): error CS0246: The type or namespace name 'EntityList' coul
    d not be found (are you missing a using directive or an assembly reference?)
    Entities\Arc.cs(327,105): error CS0246: The type or namespace name 'CharData' c
    ould not be found (are you missing a using directive or an assembly reference?)
    Entities\Bar.cs(211,105): error CS0246: The type or namespace name 'CharData' c
    ould not be found (are you missing a using directive or an assembly reference?)
    Entities\Bar.cs(280,55): error CS0246: The type or namespace name 'CharData' co
    uld not be found (are you missing a using directive or an assembly reference?)
    Entities\Circle.cs(158,105): error CS0246: The type or namespace name 'CharData
    ' could not be found (are you missing a using directive or an assembly referenc
    e?)
    Entities\Entity.cs(524,94): error CS0246: The type or namespace name 'CharData'
     could not be found (are you missing a using directive or an assembly reference
    ?)
    Entities\Entity.cs(555,54): error CS0246: The type or namespace name 'CharData'
     could not be found (are you missing a using directive or an assembly reference
    ?)
    Entities\Joint.cs(325,105): error CS0246: The type or namespace name 'CharData'
     could not be found (are you missing a using directive or an assembly reference
    ?)
    Entities\Joint.cs(334,55): error CS0246: The type or namespace name 'CharData'
    could not be found (are you missing a using directive or an assembly reference?
    )
    Entities\Line.cs(147,95): error CS0246: The type or namespace name 'CharData' c
    ould not be found (are you missing a using directive or an assembly reference?)
    Entities\Mesh.Draw.cs(18,55): error CS0246: The type or namespace name 'CharDat
    a' could not be found (are you missing a using directive or an assembly referen
    ce?)
    Entities\Mesh.cs(451,105): error CS0246: The type or namespace name 'CharData'
    could not be found (are you missing a using directive or an assembly reference?
    )
    Entities\Quad.cs(98,105): error CS0246: The type or namespace name 'CharData' c
    ould not be found (are you missing a using directive or an assembly reference?)
    Entities\StlModel.cs(366,55): error CS0246: The type or namespace name 'CharDat
    a' could not be found (are you missing a using directive or an assembly referen
    ce?)
    Entities\Triangle.cs(105,105): error CS0246: The type or namespace name 'CharDa
    ta' could not be found (are you missing a using directive or an assembly refere
    nce?)
    Block.cs(419,105): error CS0246: The type or namespace name 'CharData' could no
    t be found (are you missing a using directive or an assembly reference?)
    Block.cs(433,55): error CS0246: The type or namespace name 'CharData' could not
     be found (are you missing a using directive or an assembly reference?)
    BlockList.cs(29,34): error CS0246: The type or namespace name 'CharData' could
    not be found (are you missing a using directive or an assembly reference?)
    BlockList.cs(131,90): error CS0246: The type or namespace name 'CharData' could
     not be found (are you missing a using directive or an assembly reference?)
    Entities\Picture.cs(96,105): error CS0246: The type or namespace name 'CharData
    ' could not be found (are you missing a using directive or an assembly referenc
    e?)
    Entities\Picture.cs(117,55): error CS0246: The type or namespace name 'CharData
    ' could not be found (are you missing a using directive or an assembly referenc
    e?)
    Nurbs\Curve.Draw.cs(15,55): error CS0246: The type or namespace name 'CharData'
     could not be found (are you missing a using directive or an assembly reference
    ?)
    Nurbs\Curve.cs(539,105): error CS0246: The type or namespace name 'CharData' co
    uld not be found (are you missing a using directive or an assembly reference?)
    Shadow.cs(180,30): error CS0246: The type or namespace name 'EntityList' could
    not be found (are you missing a using directive or an assembly reference?)
    Shadow.cs(565,33): error CS0246: The type or namespace name 'EntityList' could
    not be found (are you missing a using directive or an assembly reference?)
    Entities\ConicBar.cs(150,105): error CS0246: The type or namespace name 'CharDa
    ta' could not be found (are you missing a using directive or an assembly refere
    nce?)
    Entities\ConicBar.cs(264,55): error CS0246: The type or namespace name 'CharDat
    a' could not be found (are you missing a using directive or an assembly referen
    ce?)
    Entities\AlignedDim.cs(337,105): error CS0246: The type or namespace name 'Char
    Data' could not be found (are you missing a using directive or an assembly refe
    rence?)
    Entities\AlignedDim.cs(605,55): error CS0246: The type or namespace name 'CharD
    ata' could not be found (are you missing a using directive or an assembly refer
    ence?)
    Entities\Ellipse.cs(229,105): error CS0246: The type or namespace name 'CharDat
    a' could not be found (are you missing a using directive or an assembly referen
    ce?)
    Entities\PlanarEntity.cs(180,105): error CS0246: The type or namespace name 'Ch
    arData' could not be found (are you missing a using directive or an assembly re
    ference?)
    Entities\EllipticalArc.cs(273,105): error CS0246: The type or namespace name 'C
    harData' could not be found (are you missing a using directive or an assembly r
    eference?)
    Entities\BlockReference.cs(239,105): error CS0246: The type or namespace name '
    CharData' could not be found (are you missing a using directive or an assembly
    reference?)
    Entities\PointCloud.cs(236,105): error CS0246: The type or namespace name 'Char
    Data' could not be found (are you missing a using directive or an assembly refe
    rence?)
    Entities\PointCloud.cs(408,55): error CS0246: The type or namespace name 'CharD
    ata' could not be found (are you missing a using directive or an assembly refer
    ence?)
    Entities\Text.cs(370,105): error CS0246: The type or namespace name 'CharData'
    could not be found (are you missing a using directive or an assembly reference?
    )
    Entities\Text.cs(453,55): error CS0246: The type or namespace name 'CharData' c
    ould not be found (are you missing a using directive or an assembly reference?)
    Entities\Text.cs(483,59): error CS0246: The type or namespace name 'CharData' c
    ould not be found (are you missing a using directive or an assembly reference?)
    Done Building Project "c:\xxxx\nextxxxx\xxxx\xxxxNurbsRetail.csproj
    " (Rebuild target(s)) -- FAILED.
    Done Building Project "c:\xxxx\nextxxxx\xxxx\xxxxNurbsRetail.sln" (
    rebuild target(s)) -- FAILED.

    Build FAILED.
    "c:\xxxx\nextxxxx\xxxx\xxxxNurbsRetail.sln" (rebuild target) (1) ->
    "c:\xxxx\nextxxxx\xxxx\xxxxNurbsRetail.csproj" (Rebuild target) (2)
     ->
    (ResolveComReferences target) ->
      C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning :
    The type library importer could not convert the signature for the member 'tagCA
    LPOLESTR.pElems'.
      C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning :
    The type library importer could not convert the signature for the member 'tagCA
    DWORD.pElems'.

    "c:\xxxx\nextxxxx\xxxx\xxxxNurbsRetail.sln" (rebuild target) (1) ->
    "c:\xxxx\nextxxxx\xxxx\xxxxNurbsRetail.csproj" (Rebuild target) (2)
     ->
    (CoreCompile target) ->
      DeployLX\DeployLX.Licensing.v3.cs(42,10): warning CS1030: #warning: 'Remember
     that you must use an authorized assembly encryption or obfuscation tool on the
     resulting assembly when you embed the source code. '
      DeployLX\DeployLX.Licensing.v3.cs(43,10): warning CS1030: #warning: 'Visit ht
    tp://goto.xheo.com/authorizedenc.aspx to review the most recent list of authori
    zed tools.'
      DeployLX\DeployLX.Licensing.v3.cs(44,10): warning CS1030: #warning: 'Only the
     developer(s) that have executed a signed EULA and obtained a license to use th
    e source may view or compile the source code. You may not share the source with
     any other user (even at the same organization) or check in to any source contr
    ol system that provides access to multiple users. '

    "c:\xxxx\nextxxxx\xxxx\xxxxNurbsRetail.sln" (rebuild target) (1) ->
    "c:\xxxx\nextxxxx\xxxx\xxxxNurbsRetail.csproj" (Rebuild target) (2)
     ->
    (CoreCompile target) ->
      Nurbs\Surface.Draw.cs(24,55): error CS0246: The type or namespace name 'CharD
    ata' could not be found (are you missing a using directive or an assembly refer
    ence?)
      Nurbs\Surface.Regen.cs(15,53): error CS0246: The type or namespace name 'Char
    Data' could not be found (are you missing a using directive or an assembly refe
    rence?)
      Viewport.cs(102,18): error CS0246: The type or namespace name 'EntityList' co
    uld not be found (are you missing a using directive or an assembly reference?)
      Viewport.cs(111,16): error CS0246: The type or namespace name 'EntityList' co
    uld not be found (are you missing a using directive or an assembly reference?)
      Entities\Arc.cs(327,105): error CS0246: The type or namespace name 'CharData'
     could not be found (are you missing a using directive or an assembly reference
    ?)
      Entities\Bar.cs(211,105): error CS0246: The type or namespace name 'CharData'
     could not be found (are you missing a using directive or an assembly reference
    ?)
      Entities\Bar.cs(280,55): error CS0246: The type or namespace name 'CharData'
    could not be found (are you missing a using directive or an assembly reference?
    )
      Entities\Circle.cs(158,105): error CS0246: The type or namespace name 'CharDa
    ta' could not be found (are you missing a using directive or an assembly refere
    nce?)
      Entities\Entity.cs(524,94): error CS0246: The type or namespace name 'CharDat
    a' could not be found (are you missing a using directive or an assembly referen
    ce?)
      Entities\Entity.cs(555,54): error CS0246: The type or namespace name 'CharDat
    a' could not be found (are you missing a using directive or an assembly referen
    ce?)
      Entities\Joint.cs(325,105): error CS0246: The type or namespace name 'CharDat
    a' could not be found (are you missing a using directive or an assembly referen
    ce?)
      Entities\Joint.cs(334,55): error CS0246: The type or namespace name 'CharData
    ' could not be found (are you missing a using directive or an assembly referenc
    e?)
      Entities\Line.cs(147,95): error CS0246: The type or namespace name 'CharData'
     could not be found (are you missing a using directive or an assembly reference
    ?)
      Entities\Mesh.Draw.cs(18,55): error CS0246: The type or namespace name 'CharD
    ata' could not be found (are you missing a using directive or an assembly refer
    ence?)
      Entities\Mesh.cs(451,105): error CS0246: The type or namespace name 'CharData
    ' could not be found (are you missing a using directive or an assembly referenc
    e?)
      Entities\Quad.cs(98,105): error CS0246: The type or namespace name 'CharData'
     could not be found (are you missing a using directive or an assembly reference
    ?)
      Entities\StlModel.cs(366,55): error CS0246: The type or namespace name 'CharD
    ata' could not be found (are you missing a using directive or an assembly refer
    ence?)
      Entities\Triangle.cs(105,105): error CS0246: The type or namespace name 'Char
    Data' could not be found (are you missing a using directive or an assembly refe
    rence?)
      Block.cs(419,105): error CS0246: The type or namespace name 'CharData' could
    not be found (are you missing a using directive or an assembly reference?)
      Block.cs(433,55): error CS0246: The type or namespace name 'CharData' could n
    ot be found (are you missing a using directive or an assembly reference?)
      BlockList.cs(29,34): error CS0246: The type or namespace name 'CharData' coul
    d not be found (are you missing a using directive or an assembly reference?)
      BlockList.cs(131,90): error CS0246: The type or namespace name 'CharData' cou
    ld not be found (are you missing a using directive or an assembly reference?)
      Entities\Picture.cs(96,105): error CS0246: The type or namespace name 'CharDa
    ta' could not be found (are you missing a using directive or an assembly refere
    nce?)
      Entities\Picture.cs(117,55): error CS0246: The type or namespace name 'CharDa
    ta' could not be found (are you missing a using directive or an assembly refere
    nce?)
      Nurbs\Curve.Draw.cs(15,55): error CS0246: The type or namespace name 'CharDat
    a' could not be found (are you missing a using directive or an assembly referen
    ce?)
      Nurbs\Curve.cs(539,105): error CS0246: The type or namespace name 'CharData'
    could not be found (are you missing a using directive or an assembly reference?
    )
      Shadow.cs(180,30): error CS0246: The type or namespace name 'EntityList' coul
    d not be found (are you missing a using directive or an assembly reference?)
      Shadow.cs(565,33): error CS0246: The type or namespace name 'EntityList' coul
    d not be found (are you missing a using directive or an assembly reference?)
      Entities\ConicBar.cs(150,105): error CS0246: The type or namespace name 'Char
    Data' could not be found (are you missing a using directive or an assembly refe
    rence?)
      Entities\ConicBar.cs(264,55): error CS0246: The type or namespace name 'CharD
    ata' could not be found (are you missing a using directive or an assembly refer
    ence?)
      Entities\AlignedDim.cs(337,105): error CS0246: The type or namespace name 'Ch
    arData' could not be found (are you missing a using directive or an assembly re
    ference?)
      Entities\AlignedDim.cs(605,55): error CS0246: The type or namespace name 'Cha
    rData' could not be found (are you missing a using directive or an assembly ref
    erence?)
      Entities\Ellipse.cs(229,105): error CS0246: The type or namespace name 'CharD
    ata' could not be found (are you missing a using directive or an assembly refer
    ence?)
      Entities\PlanarEntity.cs(180,105): error CS0246: The type or namespace name '
    CharData' could not be found (are you missing a using directive or an assembly
    reference?)
      Entities\EllipticalArc.cs(273,105): error CS0246: The type or namespace name
    'CharData' could not be found (are you missing a using directive or an assembly
     reference?)
      Entities\BlockReference.cs(239,105): error CS0246: The type or namespace name
     'CharData' could not be found (are you missing a using directive or an assembl
    y reference?)
      Entities\PointCloud.cs(236,105): error CS0246: The type or namespace name 'Ch
    arData' could not be found (are you missing a using directive or an assembly re
    ference?)
      Entities\PointCloud.cs(408,55): error CS0246: The type or namespace name 'Cha
    rData' could not be found (are you missing a using directive or an assembly ref
    erence?)
      Entities\Text.cs(370,105): error CS0246: The type or namespace name 'CharData
    ' could not be found (are you missing a using directive or an assembly referenc
    e?)
      Entities\Text.cs(453,55): error CS0246: The type or namespace name 'CharData'
     could not be found (are you missing a using directive or an assembly reference
    ?)
      Entities\Text.cs(483,59): error CS0246: The type or namespace name 'CharData'
     could not be found (are you missing a using directive or an assembly reference
    ?)
        5 Warning(s)
        41 Error(s)
    Time Elapsed 00:00:05.22


    Thanks,

    Alberto

    • Edited by devdept Tuesday, May 24, 2011 8:21 AM
    Tuesday, October 06, 2009 1:33 PM
  • This is because the the IsEvaluation property is set at BeforeBuild target while the EmbeddedResource and Compile itemgroups are set at the initial time of msbuild execution.

    The solution is to remove those items in BeforeBuild target instead of exclude when defining them:

      <Target Name="BeforeBuild">
        <MSBuild.ExtensionPack.Framework.TextString TaskAction="Compare" Comparison="Contains" String1="$(DefineConstants)" String2="STANDARD" IgnoreCase="true">
          <Output PropertyName="IsEvaluation" TaskParameter="Result" />
        </MSBuild.ExtensionPack.Framework.TextString>
        <Message Text="Is evaluation: $(IsEvaluation)" />
        <ItemGroup>
          <EmbeddedResource Remove="DeployLX\eyeshotRuntime.lic" Condition="$(IsEvaluation)==false" />
          <Compile Remove="EntityList.cs" Condition="$(IsEvaluation)==false" />
        </ItemGroup>
      </Target>
    Please remove any other IsEvaluation condition check at itemgroup definition.

     

    Hongye Sun [MSFT]

    MSDN Subscriber Support in Forum

    If you have any feedback on our support, please contact msdnmg at microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by devdept Wednesday, October 07, 2009 1:16 PM
    Wednesday, October 07, 2009 8:03 AM