views:

53

answers:

2

Hi All I am trying to migrate one of projects earlier in VS2008 to VS2010. On building I get the following error

C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(317,7): error MSB4094: "hdxBinding.idl;hdxBlinking.idl;HDXCommandObject.idl;hdxds.idl;HSCProcessStatus.idl;HSCSelectableWindow.idl" is an invalid value for the "Source" parameter of the "MIDL" task. Multiple items cannot be passed into a parameter of type "Microsoft.Build.Framework.ITaskItem".

On clicking this error, it takes me to the line Source ="@(Midl)" inside C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets file

A Code Snippet in Microsoft.CppCommon.targets file:

<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>

Can somebody please tell me whats going wrong here. This is driving me crazy!!!!!!

A: 

Need some response on this

Poulomi Deb
+1  A: 

Got a similar error today on a project that I am converting to VS2010. I don't have a good solution to the problem yet, but I have a workaround. In my case, the project contained 2 idl files. Call them A.idl and B.idl. A.idl is the main idl for the project. It includes B.Idl. The error I received was:

error MSB4094: "A.idl;B.idl" is an invalid value for the "Source" parameter of the "MIDL" task. Multiple items cannot be passed into a parameter of type "Microsoft.Build.Framework.ITaskItem".

It seems that the build system searched for all idl files in the project and made a single call to the MIDL compiler with all of them even though that was bound to fail. I don't know why VS2010 does that and earlier version didn't (or maybe earlier versions of MIDL could handle multiple inputs).

The workaround: grab the MIDL arguments off of MIDL Command Line page of the project's properties. Then run MIDL by hand in a VS2010 Command Prompt window using those args. In my case, since A.idl includes B.idl, I only needed to run one MIDL command:

MIDL options-copied-from-project-properties A.IDL

It looks like you have multiple idl files in your project (hdxBinding.idl, hdxBlinking.idl, etc.). So the same trick might work for you.

Good luck

nbauer