为什么我在microsoft visual studio中得到参数targetplatformversion不能为null

时间:2016-05-17 10:18:23

标签: c# windows-8 visual-studio-2015 win-universal-app windows-10-universal

嗨大家好我正在尝试将Windows Phone 8.1应用程序迁移到Windows 10,我已经仔细按照说明操作但我总是得到错误Prameter targetplatformVersion不能为空。但它不是null,这是我的.csproj文件中的代码

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

我做错了什么?

3 个答案:

答案 0 :(得分:1)

查看上面粘贴的.csproj示例中的一些条目,看起来您正在尝试将Windows Phone 8.0或Windows Phone 8.1应用程序迁移到UWP。没有任何东西已经正确迁移,因此绊倒了Visual Studio项目系统(例如,标签)。

您是否已按照此MSDN文章中的所有步骤操作? https://msdn.microsoft.com/en-us/library/mt148501.aspx#MigrateCSharp

我发现最简单的迁移方法是将一个空白的新UWP项目添加到解决方案中,然后复制C#/ XAML文件,其他资产等。或者,创建一个空白的UWP应用程序,然后进行差异化.csproj与你拥有的那个 - 差异应立即弹出。

答案 1 :(得分:0)

我可能还有与Platform版本和SDK工具相关的相同问题。 请尝试从此页面下载独立SDK:

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

重新安装后,问题就会消失。

答案 2 :(得分:0)

在这里碰到..当我使用ISO映像的更新3以及独立的14393.33 sdk安装Visual Studio 2015社区时,似乎同样的问题。

我有两台安装了相同开发软件的机器。

我用一台机器得到了上述问题而没有用另一台机器得到上述问题。

我怀疑这是一个网络问题。

我为什么这么说?因为Windows SDK在通过我面临此目标平台版本问题的同一网络进行安装时也存在问题。 然后我通过切换到现有网络上的VPN并且正确安装了sdk来克服SDK安装问题。 但不幸的是,我无法继续通过VPN继续安装VS.

现在,对于我的第二台机器,我安装了相同的软件,但这次我正在使用我的办公室网络和visual studio正确安装,没有报告与targetPlatformVersion相关的问题。

现在,对于面临问题的同一台机器上的扭曲,我可以确认Visual Studio 15预览4没有报告相同的问题。