none
Problem with porting custom build rule

    Question

  • Good day.

    I have a VS 2005 solution where some projects use CORBA and have custom build rule in order to process .idl files. After port to VS 2010 projects that contains only 1-2 .idl file processed correctly. But there is problem with project that contains more than 2 .idl file (I don't think that quantity is problem, possibly it is coincidence).

    There is error message:

    1>_OmgIdl:
    1>  Processing IDL file BlobIterator...
    1>  tao-idli_hv79UH.cpp
    1>  processing C:\Projects\ngp\CIS\InfraServer_IDL\BlobIterator.idl
    1>C:\Projects\ngp\Primitives\VSProps\OmgIdl.targets(45,5): error MSB3721: The command "tao_idl -IC:\SDK\ACE_wrappers_1.6a_p11/TAO -IC:\SDK\ACE_wrappers_1.6a_p11/TAO/orbsvcs/orbsvcs -IC:\Projects\ngp\Primitives     -Wb,export_macro=INFRA_SERVER_CLASS_DECLSPEC -Wb,export_include=InfraServerExports.h     -o C:\Projects\ngp\CIS\InfraServer_IDL\ C:\Projects\ngp\CIS\InfraServer_IDL\BlobIterator.idl
    1>C:\Projects\ngp\Primitives\VSProps\OmgIdl.targets(45,5): error MSB3721: C:\SDK\IIOPNet.src.1.9.0.sp1\IDLToCLSCompiler\IDLCompiler\bin\IDLToCLSCompiler -d IIOP_NET_IDL -idir C:\SDK\ACE_wrappers_1.6a_p11\TAO\orbsvcs\orbsvcs -idir C:\SDK\ACE_wrappers_1.6a_p11\TAO  -r C:\Projects\ngp\Primitives\ovsoft.ngp.Common\CosProperty_cs.dll;C:\Projects\ngp\Primitives\ovsoft.ngp.Common\CosTrading_cs.dll;C:\Projects\ngp\Notification\bin\Notification_cs.dll -o C:\Projects\ngp\CIS\InfraServer_IDL\..\bin BlobIterator_cs C:\Projects\ngp\CIS\InfraServer_IDL\BlobIterator.idl
    1>C:\Projects\ngp\Primitives\VSProps\OmgIdl.targets(45,5): error MSB3721: C:\SDK\IIOPNet.src.1.9.0.sp1\IDLToCLSCompiler\IDLCompiler\bin\IDLToCLSCompiler -d IIOP_NET_IDL -idir C:\SDK\ACE_wrappers_1.6a_p11\TAO\orbsvcs\orbsvcs -idir C:\SDK\ACE_wrappers_1.6a_p11\TAO  -r C:\Projects\ngp\Primitives\ovsoft.ngp.Common\CosProperty_cs.dll;C:\Projects\ngp\Primitives\ovsoft.ngp.Common\CosTrading_cs.dll;C:\Projects\ngp\Notification\bin\Notification_cs.dll -mapAnyToCont -o C:\Projects\ngp\CIS\InfraServer_IDL\..\bin BlobIterator_ac_cs C:\Projects\ngp\CIS\InfraServer_IDL\BlobIterator.idl" exited with code 1.
    1>
    1>Build FAILED.

     

    Targets file:

    <?xml version="1.0" encoding="utf-8"?>
    <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <ItemGroup>
        <PropertyPageSchema
          Include="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml" />
        <AvailableItemName
          Include="OmgIdl">
          <Targets>_OmgIdl</Targets>
        </AvailableItemName>
      </ItemGroup>
      <UsingTask
        TaskName="OmgIdl"
        TaskFactory="XamlTaskFactory"
        AssemblyName="Microsoft.Build.Tasks.v4.0">
        <Task>$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml</Task>
      </UsingTask>
      <Target
        Name="_OmgIdl"
        BeforeTargets="$(OmgIdlBeforeTargets)"
        AfterTargets="$(OmgIdlAfterTargets)"
        Condition="'@(OmgIdl)' != ''"
        DependsOnTargets="$(OmgIdlDependsOn);ComputeOmgIdlOutput"
        Outputs="%(OmgIdl.Outputs)"
        Inputs="%(OmgIdl.Identity);%(OmgIdl.AdditionalDependencies);$(MSBuildProjectFile)">
        <ItemGroup
          Condition="'@(SelectedFiles)' != ''">
          <OmgIdl
            Remove="@(OmgIdl)"
            Condition="'%(Identity)' != '@(SelectedFiles)'" />
        </ItemGroup>
        <ItemGroup>
          <OmgIdl_tlog
            Include="%(OmgIdl.Outputs)"
            Condition="'%(OmgIdl.Outputs)' != '' and '%(OmgIdl.ExcludedFromBuild)' != 'true'">
            <Source>@(OmgIdl, '|')</Source>
          </OmgIdl_tlog>
        </ItemGroup>
        <Message
          Importance="High"
          Text="%(OmgIdl.ExecutionDescription)" />
        <WriteLinesToFile
          Condition="'@(OmgIdl_tlog)' != '' and '%(OmgIdl_tlog.ExcludedFromBuild)' != 'true'"
          File="$(IntDir)$(ProjectName).write.1.tlog"
          Lines="^%(OmgIdl_tlog.Source);@(OmgIdl_tlog-&gt;'%(Fullpath)')" />
        <OmgIdl
          Condition="'@(OmgIdl)' != '' and '%(OmgIdl.ExcludedFromBuild)' != 'true'"
          CommandLineTemplate="%(OmgIdl.CommandLineTemplate)"
          GenerateAMI="%(OmgIdl.GenerateAMI)"
          GenerateAMH="%(OmgIdl.GenerateAMH)"
          SuppressThruPoaCollocatedStubs="%(OmgIdl.SuppressThruPoaCollocatedStubs)"
          ExportMacro="%(OmgIdl.ExportMacro)"
          ExportInclude="%(OmgIdl.ExportInclude)"
          StubExportMacro="%(OmgIdl.StubExportMacro)"
          StubExportInclude="%(OmgIdl.StubExportInclude)"
          SkelExportMacro="%(OmgIdl.SkelExportMacro)"
          SkelExportInclude="%(OmgIdl.SkelExportInclude)"
          IncludeTaoIdl="%(OmgIdl.IncludeTaoIdl)"
          IncludeIdlToCls="%(OmgIdl.IncludeIdlToCls)"
          ReferenceIdlToCls="%(OmgIdl.ReferenceIdlToCls)"
          AdditionalOptions="%(OmgIdl.AdditionalOptions)"
          Inputs="%(OmgIdl.Identity)" />
      </Target>
      <PropertyGroup>
        <ComputeLinkInputsTargets>
                $(ComputeLinkInputsTargets);
                ComputeOmgIdlOutput;
              </ComputeLinkInputsTargets>
        <ComputeLibInputsTargets>
                $(ComputeLibInputsTargets);
                ComputeOmgIdlOutput;
              </ComputeLibInputsTargets>
      </PropertyGroup>
      <Target
        Name="ComputeOmgIdlOutput"
        Condition="'@(OmgIdl)' != ''">
        <ItemGroup>
          <OmgIdlDirsToMake
            Condition="'@(OmgIdl)' != '' and '%(OmgIdl.ExcludedFromBuild)' != 'true'"
            Include="%(OmgIdl.Outputs)" />
          <Link
            Include="%(OmgIdlDirsToMake.Identity)"
            Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" />
          <Lib
            Include="%(OmgIdlDirsToMake.Identity)"
            Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" />
          <ImpLib
            Include="%(OmgIdlDirsToMake.Identity)"
            Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" />
        </ItemGroup>
        <MakeDir
          Directories="@(OmgIdlDirsToMake-&gt;'%(RootDir)%(Directory)')" />
      </Target>
    </Project>

     

    Props file:

    <?xml version="1.0" encoding="utf-8"?>
    <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <PropertyGroup
        Condition="'$(OmgIdlBeforeTargets)' == '' and '$(OmgIdlAfterTargets)' == '' and '$(ConfigurationType)' != 'Makefile'">
        <OmgIdlBeforeTargets>Midl</OmgIdlBeforeTargets>
        <OmgIdlAfterTargets>CustomBuild</OmgIdlAfterTargets>
      </PropertyGroup>
      <PropertyGroup>
        <OmgIdlDependsOn
          Condition="'$(ConfigurationType)' != 'Makefile'">_SelectedFiles;$(OmgIdlDependsOn)</OmgIdlDependsOn>
      </PropertyGroup>
      <ItemDefinitionGroup>
        <OmgIdl>
          <GenerateAMI>False</GenerateAMI>
          <GenerateAMH>False</GenerateAMH>
          <SuppressThruPoaCollocatedStubs>False</SuppressThruPoaCollocatedStubs>
          <CommandLineTemplate>tao_idl -I$(ACE_ROOT)/TAO -I$(ACE_ROOT)/TAO/orbsvcs/orbsvcs -I$(PRIM_HOME) [IncludeTaoIdl] [GenerateAMI] [GenerateAMH] [SuppressThruPoaCollocatedStubs] [ExportMacro] [ExportInclude] [StubExportMacro] [StubExportInclude] [SkelExportMacro] [SkelExportInclude] -o %(RootDir)%(Directory) %(FullPath)
    $(IIOPNET_HOME)\IDLToCLSCompiler\IDLCompiler\bin\IDLToCLSCompiler -d IIOP_NET_IDL -idir $(ACE_ROOT)\TAO\orbsvcs\orbsvcs -idir $(ACE_ROOT)\TAO [IncludeIdlToCls] [ReferenceIdlToCls] -o $(OutBinDir) %(Filename)_cs %(FullPath)
    $(IIOPNET_HOME)\IDLToCLSCompiler\IDLCompiler\bin\IDLToCLSCompiler -d IIOP_NET_IDL -idir $(ACE_ROOT)\TAO\orbsvcs\orbsvcs -idir $(ACE_ROOT)\TAO [IncludeIdlToCls] [ReferenceIdlToCls] -mapAnyToCont -o $(OutBinDir) %(Filename)_ac_cs %(FullPath)</CommandLineTemplate>
          <Outputs>%(RootDir)%(Directory)/%(Filename)C.h;%(RootDir)%(Directory)/%(Filename)C.cpp;%(RootDir)%(Directory)/%(Filename)C.inl;%(RootDir)%(Directory)/%(Filename)S.h;%(RootDir)%(Directory)/%(Filename)S.cpp;%(RootDir)%(Directory)/%(Filename)S.inl;$(OutBinDir)/%(Filename)_cs.dll;$(OutBinDir)/%(Filename)_ac_cs.dll</Outputs>
          <ExecutionDescription>Processing IDL file %(Filename)...</ExecutionDescription>
          <ShowOnlyRuleProperties>false</ShowOnlyRuleProperties>
        </OmgIdl>
      </ItemDefinitionGroup>
    </Project>

     

    Can anyone help me to resolve this problem? Thanks in advance.

    Friday, January 13, 2012 10:30 AM

Answers

  • Thanks for answers. I tried the offered solution and found that some list properties were generated incorrectly. I changed my xml file and compiled successfully.
    • Marked as answer by Vashme Tuesday, January 31, 2012 12:39 PM
    Tuesday, January 31, 2012 12:38 PM

All replies

  • Does running tao_idl from the command line succeed?

    As I see it MSBuild in this case is merely a wrapper that automates the build, not the cause of the failure.

    Friday, January 13, 2012 6:34 PM
  • Hi Vashme,

    Thank you for your question.

    I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.

    Thank you for your understanding and support.

     

    Best regards,

    Lucy


    Lucy Liu [MSFT]
    MSDN Community Support | Feedback to us
    Tuesday, January 17, 2012 9:03 AM
  • Thank you very much for response. I am waiting with impatience for the answer.

    Tuesday, January 17, 2012 11:45 AM
  • Hello Vashme,

    MSB3721 means the command exited with code 1, please first check if you can call tao_idl without any error.

    As VS 2005 works, you may try to use the Exec Task (http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/8b13b9c1-b9f2-4d04-94b5-ffa25a75e481) and call the VS2005 version of VCBuild.exe to build this project, does it work?

    Thanks & Regards,

    Jian-Wei Yu [MSFT]

    Microsoft Online Community Support

     

    --------------------------------------------------------------------------------

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

     

     

     


    Tuesday, January 24, 2012 8:21 AM
  • Thanks for answers. I tried the offered solution and found that some list properties were generated incorrectly. I changed my xml file and compiled successfully.
    • Marked as answer by Vashme Tuesday, January 31, 2012 12:39 PM
    Tuesday, January 31, 2012 12:38 PM
  • Hi.  I am having a similar problem with building my ARM project with a custom build setup, using an IAR compiler (although I get an error code 2).  I also migrated from Visual Studio 2005 to 2010.  In VS 2005, it built fine. Can you please post your solution (and any relevant steps required to arrive there)?

    FYI, here is my error message:

    1>C:\temp2\Devices\Device\BuildTools\iccarm.targets(45,5): error MSB3721: The command ""C:\Program Files\IAR Systems\Embedded Workbench 4.0\ARM\bin\iccarm" --silent -z9 --debug --cpu_mode thumb --endian little --cpu ARM7TDMI --stack_align 4 --interwork -e --fpu None -I "C:\Program Files\IAR Systems\Embedded Workbench 4.0\ARM\inc"  Cstartup_SAM7.c-o Release\Cstartup_SAM7.r79" exited with code 2.

    My target and props files here for download:

    target file:

    https://docs.google.com/open?id=0BzxmXlsPps22NTA0YTVhMmUtZDA0Zi00YWUxLTlmMjMtZWJmZjU3OTMxMmEw

    props file:

    https://docs.google.com/open?id=0BzxmXlsPps22NGU2YmIwZDUtOTJkOC00M2FjLTgyZGEtYjI0OWJiZWJiOGZi

    Thanks in advance!

    Will


    • Edited by wkhan69 Tuesday, January 31, 2012 11:29 PM added link to target and props files
    Tuesday, January 31, 2012 11:21 PM
  • Hi, Will

    I think you may execute steps offered by Jian-Wei Yu to understand your problem. In my case there was an error during generating a stringlistproperty.

    Generated property:

    <StringListProperty
          Name="ReferenceIdlToCls"
          Subcategory="Dependencies"
          HelpContext="0"
          DisplayName="Reference assemblies"
          Description="Specify additional assemblies that target assembly, that will be generated by IDLtoCLS, should reference."

          Separator=";"
          Switch="-r [value] "

    />

    Corrected property:

    <StringListProperty
          Name="ReferenceIdlToCls"
          Subcategory="Dependencies"
          HelpContext="0"
          DisplayName="Reference assemblies"
          Description="Specify additional assemblies that target assembly, that will be generated by IDLtoCLS, should reference."
          Switch="-r "

    />

    Best regards

    Thursday, February 02, 2012 8:16 AM
  • Hi Vashme,

    I'm looking at what Jian-Wei Yu suggested and I'm not sure how to call tao_idl (where and exactly how?). 

    As well, the link on  Jian-Wei Y's post just goes back to this forum thread.  How do you incorporate the call to the VS2005 version of VCBuild.exe into the project configuration?  (I looked for a setting to call a specific VCBuild.ex, but could not find one).

    Also, out of interest, When I upgraded the project from VS2005 to VS2010, I noticed VS2010 produced extra files (iccarm.targets, iccarm.props, iccarm.rules, and iccarm.xml), where as VS2005 only has iccarm.rules (which is the same as the VS2010 version).  If I remove one of these files, the project does not load.

    -I'm still learning all this stuff, so please bear with my questions if they are basic -

    Thanks again,

    Will

    Thursday, February 02, 2012 11:00 PM
  • Hi Vashme,

    I think I have it fixed.  The problem turned out to be very similar to yours.  In my project, there were several files (iccarm.targets, iccarm.rules, xlink.rules, and xlink.xml) that referenced:

    Switch="-o [value]"

    which is incorrect.  The correct line should be:

    Switch=" -o [value]"

    (note the space before the -o.  Also note that this Switch directive is for the ObjectFileName or ExecutableFileName, and not for extra output or other options.  The build command was getting confused by the syntax of having the -o directly after the command.  I'm guessing this is a glitch with Visual Studio 2010 that upgrades older projects and parses this particular command incorrectly).

    Thanks again for your help.

    Will

    Thursday, February 02, 2012 11:41 PM