“MIDL”任务的“Source”参数。无法将多个项目传递给“Microsoft.Build.Framework.ITaskItem”类型的参数

时间:2010-07-20 07:39:46

标签: visual-studio-2010 migration

我正在尝试将VS2008中早期的一个项目迁移到VS2010。在构建时,我收到以下错误

C:\ Program Files \ MSBuild \ Microsoft.Cpp \ v4.0 \ Microsoft.CppCommon.targets(317,7):错误MSB4094:“hdxBinding.idl; hdxBlinking.idl; HDXCommandObject.idl; hdxds.idl; HSCProcessStatus.idl; HSCSelectableWindow.idl“是”MIDL“任务的”Source“参数的无效值。多个项目无法传递到“Microsoft.Build.Framework.ITaskItem”类型的参数中。

单击此错误,它会转到C:\ Program Files \ MSBuild \ Microsoft.Cpp \ v4.0 \ Microsoft.CppCommon.targets文件中的Source =“@(Midl)”行

Microsoft.CppCommon.targets文件中的代码片段:

<ItemGroup>
  <Midl Condition="'@(Midl)' != ''">
    <MinimalRebuildFromTracking   Condition="'$(BuildType)' != 'Build' or '$(ForceRebuild)' == 'true'">false</MinimalRebuildFromTracking>
  </Midl>
</ItemGroup>

<PropertyGroup>
  <MidlToolArchitecture Condition="'$(MidlToolArchitecture)' == ''">$(DefaultToolArchitecture)</MidlToolArchitecture>
</PropertyGroup>

<MIDL
  Condition                           ="'%(Midl.ExcludedFromBuild)'!='true'"
  Source                              ="@(Midl)"

  AdditionalIncludeDirectories        ="%(Midl.AdditionalIncludeDirectories)"
  AdditionalOptions                   ="%(Midl.AdditionalOptions)"
  ApplicationConfigurationMode        ="%(Midl.ApplicationConfigurationMode)"
  ClientStubFile                      ="%(Midl.ClientStubFile)"
  CPreprocessOptions                  ="%(Midl.CPreprocessOptions)"
  DefaultCharType                     ="%(Midl.DefaultCharType)"
  DllDataFileName                     ="%(Midl.DllDataFileName)"
  EnableErrorChecks                   ="%(Midl.EnableErrorChecks)"
  ErrorCheckAllocations               ="%(Midl.ErrorCheckAllocations)"
  ErrorCheckBounds                    ="%(Midl.ErrorCheckBounds)"
  ErrorCheckEnumRange                 ="%(Midl.ErrorCheckEnumRange)"
  ErrorCheckRefPointers               ="%(Midl.ErrorCheckRefPointers)"
  ErrorCheckStubData                  ="%(Midl.ErrorCheckStubData)"
  ExcludedInputPaths                  ="$(ExcludePath)"
  GenerateClientFiles                 ="%(Midl.GenerateClientFiles)"
  GenerateServerFiles                 ="%(Midl.GenerateServerFiles)"
  GenerateStublessProxies             ="%(Midl.GenerateStublessProxies)"
  GenerateTypeLibrary                 ="%(Midl.GenerateTypeLibrary)"
  HeaderFileName                      ="%(Midl.HeaderFileName)"
  IgnoreStandardIncludePath           ="%(Midl.IgnoreStandardIncludePath)"
  InterfaceIdentifierFileName         ="%(Midl.InterfaceIdentifierFileName)"
  LocaleID                            ="%(Midl.LocaleID)"
  MkTypLibCompatible                  ="%(Midl.MkTypLibCompatible)"
  OutputDirectory                     ="%(Midl.OutputDirectory)"
  PreprocessorDefinitions             ="%(Midl.PreprocessorDefinitions)"
  ProxyFileName                       ="%(Midl.ProxyFileName)"
  RedirectOutputAndErrors             ="%(Midl.RedirectOutputAndErrors)"
  ServerStubFile                      ="%(Midl.ServerStubFile)"
  StructMemberAlignment               ="%(Midl.StructMemberAlignment)"
  SuppressCompilerWarnings            ="%(Midl.SuppressCompilerWarnings)"
  SuppressStartupBanner               ="%(Midl.SuppressStartupBanner)"
  TargetEnvironment                   ="%(Midl.TargetEnvironment)"
  TypeLibFormat                       ="%(Midl.TypeLibFormat)"
  TypeLibraryName                     ="%(Midl.TypeLibraryName)"
  UndefinePreprocessorDefinitions     ="%(Midl.UndefinePreprocessorDefinitions)"
  ValidateAllParameters               ="%(Midl.ValidateAllParameters)"
  WarnAsError                         ="%(Midl.WarnAsError)"
  WarningLevel                        ="%(Midl.WarningLevel)"

  TrackerLogDirectory                 ="%(Midl.TrackerLogDirectory)"
  MinimalRebuildFromTracking          ="%(Midl.MinimalRebuildFromTracking)"
  ToolArchitecture                    ="$(MidlToolArchitecture)"
  TrackerFrameworkPath                ="$(MidlTrackerFrameworkPath)"
  TrackerSdkPath                      ="$(MidlTrackerSdkPath)"

  TLogReadFiles                       ="@(MIDLTLogReadFiles)"
  TLogWriteFiles                      ="@(MIDLTLogWriteFiles)"
  ToolExe                             ="$(MIDLToolExe)"
  ToolPath                            ="$(MIDLToolPath)"
  TrackFileAccess                     ="$(TrackFileAccess)"

  AcceptableNonZeroExitCodes          ="%(Midl.AcceptableNonZeroExitCodes)"
  YieldDuringToolExecution            ="$(MidlYieldDuringToolExecution)"
  >
</MIDL>

有人可以告诉我这里出了什么问题。这让我发疯了!!!!!!

5 个答案:

答案 0 :(得分:2)

我遇到了这个问题,尝试使用Visual Studio 2010从TMG SDK构建DataMonitor示例。我能说的问题是MIDL&gt;项目中的输出设置 - 头文件,IID文件,代理文件和类型库被设置为“DataMonitor ...”,这迫使这些设置应用于所有包含的IDL文件(而不仅仅是项目生成的文件) )。

将这些设置更改为使用%(文件名),而项目构建正常。

答案 1 :(得分:1)

答案 2 :(得分:1)

当我从VS 2008转换到VS 2010的项目中有多个IDL文件时,出现此错误。由于我有一个IDL被包含在另一个中。我禁用了包含的IDL文件的构建,它解决了这个错误。

答案 3 :(得分:0)

迁移到VS2010时会出现这些错误,因为VS2010迁移器不会迁移.idl文件属性。我收到了类似的错误并通过手动将这些参数添加到VS2010来解决了这个问题。完成后,您将能够摆脱这些构建错误。

答案 4 :(得分:0)

我也遇到了同样的问题。修复是(非常混乱)在vcxproj文件中删除空。我没有时间,并没有到底为什么它有帮助 - 定义不空HeaderFileName也修复了问题,其他空元素不会导致这个问题(例如DllDataFileName)。 如果你想重现我的调查的bug或过程,只需创建hello world并添加两个idl文件。它应该工作。但是,如果使用Midl.HeaderFileName添加ItemGroupDefinition,它应该开始失败。一个疯狂的猜测是它与批处理任务有关(工作示例分别为每个文件调用MIDL任务)。