esat akpo
esat akpo

Reputation: 45

why do I get parameter targetplatformversion cannot be null in microsoft visual studio

Hi Guys I am trying to migrate a Windows phone 8.1 application to Windows 10 and I have followed the instructions carefully but I always get the error Prameter targetplatformVersion cannot be null. But it is not null and here is my code from my .csproj file

    <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <TargetPlatformVersion>10.0.10586.0</TargetPlatformVersion>
    <TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
    <TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
    <MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
    <ProductVersion>10.0.20506</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{7C06E7B5-5C0A-4D9E-BA59-D2A359546261}</ProjectGuid>
    <ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>MedeTraxAlert_Phase2</RootNamespace>
    <AssemblyName>MedeTraxAlert_Phase2</AssemblyName>
    <SilverlightVersion>
    </SilverlightVersion>
    <SilverlightApplication>true</SilverlightApplication>
    <SupportedCultures>
    </SupportedCultures>
    <XapOutputs>true</XapOutputs>
    <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
    <XapFilename>MedeTraxAlert_Phase2_$(Configuration)_$(Platform).xap</XapFilename>
    <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
    <SilverlightAppEntry>MedeTraxAlert_Phase2.App</SilverlightAppEntry>
    <ValidateXaml>true</ValidateXaml>
    <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
    <ExpressionBlendVersion>5.0.40218.0</ExpressionBlendVersion>
    <TargetFrameworkProfile />
    <DefaultLanguage>en-US</DefaultLanguage>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>Bin\x86\Debug</OutputPath>
    <DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
    <NoStdLib>true</NoStdLib>
    <NoConfig>true</NoConfig>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <PlatformTarget />
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>Bin\x86\Release</OutputPath>
    <DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
    <NoStdLib>true</NoStdLib>
    <NoConfig>true</NoConfig>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <PlatformTarget />
    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|ARM' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>Bin\ARM\Debug</OutputPath>
    <DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
    <NoStdLib>true</NoStdLib>
    <NoConfig>true</NoConfig>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <PlatformTarget />
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|ARM' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>Bin\ARM\Release</OutputPath>
    <DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
    <NoStdLib>true</NoStdLib>
    <NoConfig>true</NoConfig>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <PlatformTarget />
    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
  </PropertyGroup>
  <ItemGroup>
    <Compile Include="App.xaml.cs">
      <DependentUpon>App.xaml</DependentUpon>
    </Compile>
    <Compile Include="Common\CommonVariables.cs" />
    <Compile Include="Converters\AVPUResponseConverter.cs" />
    <Compile Include="Common\NeuroResponseConverter.cs" />
    <Compile Include="Converters\AlertListTextForegroundConverter.cs" />
    <Compile Include="Converters\AVPUResponseConvertor.cs" />
    <Compile Include="Converters\BooleanToColSpanConverter.cs" />
    <Compile Include="Converters\BooleanToVisibilityConverter.cs" />
    <Compile Include="Converters\ConcernConvertor.cs" />
    <Compile Include="Converters\ConsciousConvertor.cs" />
    <Compile Include="Converters\OxygenConvertor.cs" />
    <Compile Include="Converters\PupilSizeConvertor.cs" />
    <Compile Include="Converters\RespirationDistressConvertor.cs" />
    <Compile Include="Converters\LimbMovementConvertor.cs" />
    <Compile Include="Converters\GCSBestMotorResponseConvertor.cs" />
    <Compile Include="Converters\GCSBestVerbalResponseConvertor.cs" />
    <Compile Include="Converters\GCSEyesOpenResponseConvertor.cs" />
    <Compile Include="LocalizedStrings.cs" />
    <Compile Include="MainPage.xaml.cs">
      <DependentUpon>MainPage.xaml</DependentUpon>
    </Compile>
    <Compile Include="Models\AlertModel.cs" />
    <Compile Include="Models\AuthenticateUserModel.cs" />
    <Compile Include="Models\AcknowledgeModel.cs" />
    <Compile Include="Models\HistoryModel.cs" />
    <Compile Include="Models\HistoryRequestModel.cs" />
    <Compile Include="Models\UidAndUrlModel.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="Resources\AppResources.Designer.cs">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>AppResources.resx</DependentUpon>
    </Compile>
    <Compile Include="UI\AlertsPage.xaml.cs">
      <DependentUpon>AlertsPage.xaml</DependentUpon>
    </Compile>
    <Compile Include="UI\AuthorisationPage.xaml.cs">
      <DependentUpon>AuthorisationPage.xaml</DependentUpon>
    </Compile>
    <Compile Include="Converters\CustomDateTimeAxis.cs" />
    <Compile Include="UI\HistoryDetailsPage.xaml.cs">
      <DependentUpon>HistoryDetailsPage.xaml</DependentUpon>
    </Compile>
    <Compile Include="UI\MessageDetailsPage.xaml.cs">
      <DependentUpon>MessageDetailsPage.xaml</DependentUpon>
    </Compile>
    <Compile Include="UI\RegistrationLoginPage.xaml.cs">
      <DependentUpon>RegistrationLoginPage.xaml</DependentUpon>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <ApplicationDefinition Include="App.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </ApplicationDefinition>
    <Page Include="MainPage.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Page Include="UI\AlertsPage.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Page Include="UI\AuthorisationPage.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Page Include="UI\HistoryDetailsPage.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Page Include="UI\MessageDetailsPage.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Page Include="UI\RegistrationLoginPage.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <None Include="Fonts\SIXTY.TTF" />
    <AppxManifest Include="Package.appxmanifest">
      <SubType>Designer</SubType>
    </AppxManifest>
    <None Include="project.json" />
    <None Include="Properties\AppManifest.xml" />
    <None Include="Properties\WMAppManifest.xml">
      <SubType>Designer</SubType>
    </None>
  </ItemGroup>
  <ItemGroup>
    <Content Include="Assets\alarm.mp3" />
    <Content Include="Assets\AlignmentGrid.png" />
    <Content Include="Assets\ApplicationIcon.png">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
    <Content Include="Assets\BadgeLogo.png" />
    <Content Include="Assets\Logo.png" />
    <Content Include="Assets\SplashScreen.png" />
    <Content Include="Assets\SquareTile150x150.png" />
    <Content Include="Assets\SquareTile71x71.png" />
    <Content Include="Assets\StoreLogo.png" />
    <Content Include="Assets\Tiles\FlipCycleTileLarge.png">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
    <Content Include="Assets\Tiles\FlipCycleTileMedium.png">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
    <Content Include="Assets\Tiles\FlipCycleTileSmall.png">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
    <Content Include="Assets\Tiles\IconicTileMediumLarge.png">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
    <Content Include="Assets\Tiles\IconicTileSmall.png">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
    <Content Include="Assets\DrApp_AppIcon.png" />
    <Content Include="Assets\WideLogo.png" />
    <Content Include="Images\alarmIcon.png" />
    <Content Include="Images\BG_1080.png" />
    <Content Include="Images\ExclamationMark.png" />
    <Content Include="ReadMe.Coding4Fun.Toolkit.txt" />
    <Content Include="README_FIRST.txt" />
    <Content Include="Toolkit.Content\ApplicationBar.Add.png" />
    <Content Include="Toolkit.Content\ApplicationBar.Cancel.png" />
    <Content Include="Toolkit.Content\ApplicationBar.Check.png" />
    <Content Include="Toolkit.Content\ApplicationBar.Delete.png" />
    <Content Include="Toolkit.Content\ApplicationBar.Select.png" />
    <Content Include="Properties\default.rd.xml" />
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="Resources\AppResources.resx">
      <Generator>PublicResXFileCodeGenerator</Generator>
      <LastGenOutput>AppResources.Designer.cs</LastGenOutput>
      <SubType>Designer</SubType>
    </EmbeddedResource>
  </ItemGroup>

  <ItemGroup>
    <BlendEmbeddedFont Include="Fonts\segoeuil.ttf">
      <IsSystemFont>True</IsSystemFont>
      <All>True</All>
      <AutoFill>True</AutoFill>
    </BlendEmbeddedFont>
    <BlendEmbeddedFont Include="Fonts\seguili.ttf">
      <IsSystemFont>True</IsSystemFont>
      <All>True</All>
      <AutoFill>True</AutoFill>
    </BlendEmbeddedFont>
  </ItemGroup>
  <ItemGroup>
    <WCFMetadata Include="Service References\" />
  </ItemGroup>
  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" Condition="false"/>

  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" Condition="true" />
  <!-- 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>
  -->
  <ProjectExtensions />
  <Import Project="$(MSBuildExtensionsPath)\Microsoft\Expression\Blend\WindowsPhone\v8.0\Microsoft.Expression.Blend.WindowsPhone.targets" />
    <Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">
    <Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.10\tools\Microsoft.Bcl.Build.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />
    <Error Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.10\tools\Microsoft.Bcl.Build.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />
  </Target>
</Project>

What have I done wrong?

Upvotes: 1

Views: 3640

Answers (3)

XAD
XAD

Reputation: 1

Bumping here.. It seems the same problem is with me when I install Visual Studio 2015 community with update 3 from ISO image along with standalone 14393.33 sdk.

I have two machines on which the same set of development softwares are installed.

And I get the above mentioned issue with one machine and none with another.

I suspect this to be a network issue.

Why am I saying this? Because Windows SDK was also having issues when installing via same network on which I am facing this target platformversion issue. Then I overcame the SDK install issue by just switching to a VPN on existing network and sdk was installed correctly. But unfortunately I could not continue rest of VS install over VPN.

Now for my second machine I installed the same software but this time I was using my office network and visual studio installed correctly with no issues related to targetPlatformVersion reported.

Now for a twist on the same machine which is facing issue , I can confirm that the same issue is not reported with Visual Studio 15 preview 4.

Upvotes: 0

Unni Ravindranathan
Unni Ravindranathan

Reputation: 444

Looking at some of the entries in the .csproj example that you pasted above, it looks like you are trying to migrate a Windows Phone 8.0 or Windows Phone 8.1 application to UWP. Nothing everything has been migrated correctly, and is hence tripping up the Visual Studio project system (for example, the tag).

Have you followed all the steps in this MSDN article? https://msdn.microsoft.com/en-us/library/mt148501.aspx#MigrateCSharp

I have found the simplest way to migrate to be to add a blank new UWP project to the solution, and then copy the C#/XAML files, other assets, etc. Alternatively, create a blank UWP app, and then diff the .csproj with the one you have - the differences should immediately pop out.

Upvotes: 1

Daniel Krzyczkowski
Daniel Krzyczkowski

Reputation: 3157

I had possibly the same issue also connected with Platform version and SDK tools. Please try to download standalone SDK from this page:

https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk

Once you reinstall it, the problem should disappear.

Upvotes: 0

Related Questions