none
MSB4096 does not define a value for metadata "Platform" RRS feed

  • Question

  • I have this problem in a huge solution, but I managed to recreate the same problem with just some new practically empty projects.

    There are 3 projects
    1: "prjA"------------------is a console application
    2: "prjFuscate"----------is a DotFuscator project, whose input is "prjA"
    3: "prjInstall"-------------is a IS2016 basic msi project whose input is prjFuscate

    in the VS Configuration manager, they all have "Release", defined under "Configuration". 
    Under "Platform" prjA has "Any CPU" defined, prjFuscate and MSI6000, are blank, since it's not possible to select.

    This builds fine in VS2017



    My solution file is called "prjA.sln"

    I run MSbuild with these parameters:
    "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" "C:\TEST\prjA\prjA.sln" /target:build /p:"Configuration=Release" /p:WarningLevel=0

    And it all fails with:

    C:\Program Files (x86)\MSBuild\InstallShield\2016\InstallShield.targets(14,3):
    error MSB4096: The item "..\prjA\prjFuscate.dotfuproj" in item list "_ConfiguredProjectReference" does not define a value for metadata "Platform". 
    In order to use this metadata, either qualify it by specifying %(_ConfiguredProjectReference.Platform), or ensure that all items in this list define a value for this metadata. [C:\TEST\prjA\MSI6000\prjInstall.isproj]

    I've been googling all day and trying out stuff, but with no luck.

    Today i tried removing the installshield project and replace it with a "Visual Studio Installer" type project. I added the output from prjFuscate, and it built fine.

    I figure there is an error in either the 

    Installshield project file

    or 

    InstallShield.targets  file(which is added by Installshield to MSBuild folder)

    this is the Installshield project file

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    	<PropertyGroup>
    		<!-- Select a Product Configuration -->
    		<InstallShieldProductConfiguration>Default Configuration</InstallShieldProductConfiguration>
    		<!-- Select a Visual Studio Configuration / InstallShield Release -->
    		<Configuration>Debug</Configuration>
    		<InstallShieldRelease>$(Configuration)</InstallShieldRelease>
    	</PropertyGroup>
    	<ItemGroup>
    		<!-- The InstallShieldProject item selects the project to build -->
    		<InstallShieldProject Include="$(MSBuildProjectDirectory)\$(MSBuildProjectName).ism"/>
    		<!-- The InstallShieldReleaseFlags sets Release Flags -->
    		<!--<InstallShieldReleaseFlags Include=""/>-->
    		<!-- The InstallShieldMergeModulePath specifies what directories are
    		searched for Merge Modules -->
    		<!--<InstallShieldMergeModulePath Include=""/>-->
    	</ItemGroup>
    	<ItemGroup>
    		<!-- The ProjectReference items refer to any Visual Studio solutions you want to automatically probe for Project Output Groups.  -->
    	</ItemGroup>
    	<ItemGroup>
    		<!-- The TaggedOutputs items allow you to explicitly add extra files to output groups. Each item must include both Name and OutputGroup, as well as TargetPath metadata values. -->
    		<!--<TaggedOutputs Include="C:\My Test Exe.exe">
    			<Name>My Test Project</Name>
    			<OutputGroup>Primary output</OutputGroup>
    			<TargetPath>My Test Exe.exe</TargetPath>
    		</TaggedOutputs> -->
    	</ItemGroup>
    	<Import Project="$(MSBuildExtensionsPath32)\InstallShield\2016\InstallShield.targets"/>
    	<ItemGroup>
    		<ProjectReference Include="..\prjFuscate\prjFuscate.dotfuproj">
    			<Name>prjFuscate</Name>
    			<Project>{0511A28A-D1A9-4453-AD47-9E6CA4C3900F}</Project>
    		</ProjectReference>
    	</ItemGroup>
    </Project>

    this is the installshield.targets file

    <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    	<UsingTask TaskName="InstallShield.Tasks.InstallShield" AssemblyFile="InstallShield.Tasks.dll"></UsingTask>
    	<UsingTask TaskName="Microsoft.Build.Tasks.AssignProjectConfiguration" AssemblyName="Microsoft.Build.Tasks.v3.5" Condition="'$(MsBuildToolsVersion)'=='3.5'"></UsingTask>
    	<UsingTask TaskName="Microsoft.Build.Tasks.AssignProjectConfiguration" AssemblyName="Microsoft.Build.Tasks.v4.0" Condition="'$(MsBuildToolsVersion)'=='4.0'"></UsingTask>
    	<PropertyGroup>
    		<InstallShieldPath Condition=" '$(InstallShieldPath)' == '' ">C:\Program Files (x86)\InstallShield\2016\System</InstallShieldPath>
    	</PropertyGroup>
    	<Target Name="Build" DependsOnTargets="$(InstallShieldBuildDependsOn)">
    		<!-- Ensure other projects are built -->
    		<Error Text="MSBuild v3.5 or higher is required. Make sure the ToolsVerion property is set properly in your .isproj file or use the MSBuild /tv command line switch." Condition="'$(MSBuildToolsVersion)' &lt; '3.5'"></Error>
    		<AssignProjectConfiguration ProjectReferences="@(ProjectReference)" SolutionConfigurationContents="$(CurrentSolutionConfigurationContents)" Condition=" '$(BuildingSolutionFile)' == 'true' and '@(ProjectReference)' != '' ">
    			<Output TaskParameter="AssignedProjects" ItemName="_ConfiguredProjectReference"></Output>
    		</AssignProjectConfiguration>
    		<MSBuild Projects="@(_ConfiguredProjectReference)" Condition=" '@(_ConfiguredProjectReference)' != '' " Properties="SkipInvalidConfigurations=true;Configuration=%(Configuration);Platform=%(Platform)" Targets="Build"></MSBuild>
    		<!-- Resolve Project Output Groups.
    		For each OutputGroup type:
    			1) Generate the Output Group for all ProjectReferences
    			  a) This preserves the project Name metadata by project file
    			  b) This creates metadata including TargetName per output file
    			2) Add the OutputGroup tag type, appending items to _TaggedProjectOutputs
    		-->
    		<MSBuild Projects="@(_ConfiguredProjectReference)" Condition=" '@(_ConfiguredProjectReference)' != '' " Properties="SkipInvalidConfigurations=true;Configuration=%(Configuration);Platform=%(Platform)" Targets="BuiltProjectOutputGroup">
    			<Output ItemName="_PrimaryOutput" TaskParameter="TargetOutputs"></Output>
    		</MSBuild>
    		<CreateItem Include="@(_PrimaryOutput)" Condition=" '@(_PrimaryOutput)' != '' " AdditionalMetadata="OutputGroup=Built">
    			<Output ItemName="_TaggedProjectOutputs" TaskParameter="Include"></Output>
    		</CreateItem>
    		<MSBuild Projects="@(_ConfiguredProjectReference)" Condition=" '@(_ConfiguredProjectReference)' != '' " Properties="SkipInvalidConfigurations=true;Configuration=%(Configuration);Platform=%(Platform)" Targets="DebugSymbolsProjectOutputGroup">
    			<Output ItemName="_DebugSymbols" TaskParameter="TargetOutputs"></Output>
    		</MSBuild>
    		<CreateItem Include="@(_DebugSymbols)" Condition=" '@(_DebugSymbols)' != '' " AdditionalMetadata="OutputGroup=symbols">
    			<Output ItemName="_TaggedProjectOutputs" TaskParameter="Include"></Output>
    		</CreateItem>
    		<MSBuild Projects="@(_ConfiguredProjectReference)" Condition=" '@(_ConfiguredProjectReference)' != '' " Properties="SkipInvalidConfigurations=true;Configuration=%(Configuration);Platform=%(Platform)" Targets="DocumentationProjectOutputGroup">
    			<Output ItemName="_Documentation" TaskParameter="TargetOutputs"></Output>
    		</MSBuild>
    		<CreateItem Include="@(_Documentation)" Condition=" '@(_Documentation)' != '' " AdditionalMetadata="OutputGroup=Documentation">
    			<Output ItemName="_TaggedProjectOutputs" TaskParameter="Include"></Output>
    		</CreateItem>
    		<MSBuild Projects="@(_ConfiguredProjectReference)" Condition=" '@(_ConfiguredProjectReference)' != '' " Properties="SkipInvalidConfigurations=true;Configuration=%(Configuration);Platform=%(Platform)" Targets="SatelliteDllsProjectOutputGroup">
    			<Output ItemName="_Satellites" TaskParameter="TargetOutputs"></Output>
    		</MSBuild>
    		<CreateItem Include="@(_Satellites)" Condition=" '@(_Satellites)' != '' " AdditionalMetadata="OutputGroup=LocalizedResourceDlls">
    			<Output ItemName="_TaggedProjectOutputs" TaskParameter="Include"></Output>
    		</CreateItem>
    		<MSBuild Projects="@(_ConfiguredProjectReference)" Condition=" '@(_ConfiguredProjectReference)' != '' " Properties="SkipInvalidConfigurations=true;Configuration=%(Configuration);Platform=%(Platform)" Targets="SourceFilesProjectOutputGroup">
    			<Output ItemName="_SourceFiles" TaskParameter="TargetOutputs"></Output>
    		</MSBuild>
    		<CreateItem Include="@(_SourceFiles)" Condition=" '@(_SourceFiles)' != '' " AdditionalMetadata="OutputGroup=SourceFiles">
    			<Output ItemName="_TaggedProjectOutputs" TaskParameter="Include"></Output>
    		</CreateItem>
    		<MSBuild Projects="@(_ConfiguredProjectReference)" Condition=" '@(_ConfiguredProjectReference)' != '' " Properties="SkipInvalidConfigurations=true;Configuration=%(Configuration);Platform=%(Platform)" Targets="ContentFilesProjectOutputGroup">
    			<Output ItemName="_ContentFiles" TaskParameter="TargetOutputs"></Output>
    		</MSBuild>
    		<CreateItem Include="@(_ContentFiles)" Condition=" '@(_ContentFiles)' != '' " AdditionalMetadata="OutputGroup=ContentFiles">
    			<Output ItemName="_TaggedProjectOutputs" TaskParameter="Include"></Output>
    		</CreateItem>
    		<!--
    		<MSBuild Projects="@(_ConfiguredProjectReference)" Condition=" '@(_ConfiguredProjectReference)' != '' " Properties="SkipInvalidConfigurations=true;Configuration=%(Configuration);Platform=%(Platform)" Targets="SGenFilesProjectOutputGroup">
    			<Output ItemName="_SGenFiles" TaskParameter="TargetOutputs"/>
    		</MSBuild>
    		<CreateItem Include="@(_SGenFiles)" Condition=" '@(_SGenFiles)' != '' " AdditionalMetadata="OutputGroup=SGen Files">
    			<Output ItemName="_TaggedProjectOutputs" TaskParameter="Include"/>
    		</CreateItem>
    		-->
    		<CreateItem Include="%(ProjectFolderReference.Identity)\**\*.*" Condition=" '@(ProjectFolderReference)' != '' " AdditionalMetadata="OutputGroup=ContentFiles;Name=%(Name);Project=%(Project)">
    			<Output ItemName="_TaggedProjectOutputs" TaskParameter="Include"></Output>
    		</CreateItem>
    		<!-- Verify output groups by uncommenting the Message task -->
    		<!-- <Message Text="Project Output Files:@(_TaggedProjectOutputs->' %(Name).%(OutputGroup):%(FileName)%(Extension)')"/> -->
    		<ItemGroup>
    			<_VSSolutionFolderDefined Include="True" Condition=" '%(InstallShieldPathVariableOverrides.PathVariable)' == 'VSSolutionFolder'"></_VSSolutionFolderDefined>
    		</ItemGroup>
    		<CreateItem Include="$([MSBuild]::Unescape($(SolutionDir).\))" Condition=" '%(_VSSolutionFolderDefined.Identity)' != 'True' " AdditionalMetadata="PathVariable=VSSolutionFolder">
    			<Output ItemName="InstallShieldPathVariableOverrides" TaskParameter="Include"></Output>
    		</CreateItem>
    		<InstallShield InstallShieldPath="$(InstallShieldPath)" Project="@(InstallShieldProject)" ProductConfiguration="$(InstallShieldProductConfiguration)" ReleaseConfiguration="$(InstallShieldRelease)" PatchConfiguration="$(InstallShieldPatchConfiguration)" ReleaseFlags="@(InstallShieldReleaseFlags)" OutputGroups="@(_TaggedProjectOutputs)" MergeModulePath="@(InstallShieldMergeModulePath)" ProductVersion="$(InstallShieldProductVersion)" PropertyOverrides="@(InstallShieldPropertyOverrides)" PathVariables="@(InstallShieldPathVariableOverrides)" PreprocessorDefines="@(InstallShieldPreprocessorDefines)" PrerequisitePath="@(InstallShieldPrerequisitePath)" RunMsiValidator="@(InstallShieldMsiValidators)" InstallShieldVerboseOutput="$(InstallShieldVerboseOutput)"></InstallShield>
    		<ItemGroup>
    			<ISOutDir Include="$(MSBuildProjectDirectory)\$(MSBuildProjectName)\$(InstallShieldProductConfiguration)\$(InstallShieldRelease)\Disk*mages\**\*.*" Condition="Exists('$(MSBuildProjectDirectory)\$(MSBuildProjectName)\') And !Exists('$(MSBuildProjectDirectory)\$(MSBuildProjectName) Data\')"></ISOutDir>
    			<ISOutDir Include="$(MSBuildProjectDirectory)\$(MSBuildProjectName)\**\*.*" Condition="Exists('$(MSBuildProjectDirectory)\$(MSBuildProjectName)\') And Exists('$(MSBuildProjectDirectory)\$(MSBuildProjectName) Data\')"></ISOutDir>
    		</ItemGroup>
    		<!-- Uncomment to Debug
    	<Message Text="OutDir: $(OutDir)"/>
    	<Message Text="MSBuildProjectName: $(MSBuildProjectName)"/>
    	<Message Text="MSBuildProjectFile: $(MSBuildProjectFile)"/>
    	<Message Text="BuildUri: $(BuildUri)"/>
    	<Message Text="TeamFoundationServerUrl: $(TeamFoundationServerUrl)"/>
            <Message Text="ISOutDir: @(ISOutDir)"/>
    -->
    		<!-- Copy Installation to Binaries folder under TFS so Files are copied to DropFolder -->
    		<Copy Condition=" '$(OutDir)' != '' And '$(BuildUri)' != '' And '$(TeamFoundationServerUrl)' != '' And    '$(InstallShieldProductConfiguration)' != '' And    '$(InstallShieldRelease)' != '' And '@(ISOutDir)' != '' " SourceFiles="@(ISOutDir)" DestinationFiles="@(ISOutDir -&gt;'$(OutDir)\Install\%(RecursiveDir)%(Filename)%(Extension)')"></Copy>
    	</Target>
    	<Target Name="Clean" DependsOnTargets="$(InstallShieldCleanDependsOn)">
    		<Exec Condition=" '$(OutDir)' != '' And       '$(InstallShieldProductConfiguration)' != '' And       '$(InstallShieldRelease)' != '' " Command="rd /s /q &quot;$(OutDir)\$(InstallShieldProductConfiguration)\$(InstallShieldRelease)&quot;"></Exec>
    	</Target>
    	<Target Name="Rebuild" DependsOnTargets="Clean;Build"></Target>
    </Project>




    Wednesday, January 10, 2018 2:01 PM

All replies