Msbuild: UWP: Cannot find "WindowsXaml\v11.0\Microsoft.Windows.UI.Xaml.CSharp.targets" file

Created on 25 Apr 2018  路  4Comments  路  Source: dotnet/msbuild

Steps to reproduce

Environment:

  • Windows 10 OS+ VS 2017 + Windows 10.0.14393 SDK + MSBuild 4.7.2556.0

Steps to build:

  • my project :ServerMonitor

  • Command line: MSBuild /maxcpucount /p:Configuration=Debug ServerMonitor-for-Windows10.sln

Project file

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <ProjectGuid>{7AF708E6-950F-4CCB-9ADD-9C5356D0EB12}</ProjectGuid>
    <OutputType>AppContainerExe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>ServerMonitor</RootNamespace>
    <AssemblyName>ServerMonitor</AssemblyName>
    <DefaultLanguage>en-US</DefaultLanguage>
    <TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
    <TargetPlatformVersion>10.0.16299.0</TargetPlatformVersion>
    <TargetPlatformMinVersion>10.0.14393.0</TargetPlatformMinVersion>
    <MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
    <FileAlignment>512</FileAlignment>
    <ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    <WindowsXamlEnableOverview>true</WindowsXamlEnableOverview>
    <PackageCertificateKeyFile>Minimal_TemporaryKey.pfx</PackageCertificateKeyFile>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
    <DebugSymbols>true</DebugSymbols>
    <OutputPath>bin\ARM\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
    <NoWarn>;2008</NoWarn>
    <DebugType>full</DebugType>
    <PlatformTarget>ARM</PlatformTarget>
    <UseVSHostingProcess>false</UseVSHostingProcess>
    <ErrorReport>prompt</ErrorReport>
    <Prefer32Bit>true</Prefer32Bit>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
    <OutputPath>bin\ARM\Release\</OutputPath>
    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
    <Optimize>true</Optimize>
    <NoWarn>;2008</NoWarn>
    <DebugType>pdbonly</DebugType>
    <PlatformTarget>ARM</PlatformTarget>
    <UseVSHostingProcess>false</UseVSHostingProcess>
    <ErrorReport>prompt</ErrorReport>
    <Prefer32Bit>true</Prefer32Bit>
    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
    <DebugSymbols>true</DebugSymbols>
    <OutputPath>bin\x64\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
    <NoWarn>;2008</NoWarn>
    <DebugType>full</DebugType>
    <PlatformTarget>x64</PlatformTarget>
    <UseVSHostingProcess>false</UseVSHostingProcess>
    <ErrorReport>prompt</ErrorReport>
    <Prefer32Bit>true</Prefer32Bit>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
    <OutputPath>bin\x64\Release\</OutputPath>
    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
    <Optimize>true</Optimize>
    <NoWarn>;2008</NoWarn>
    <DebugType>pdbonly</DebugType>
    <PlatformTarget>x64</PlatformTarget>
    <UseVSHostingProcess>false</UseVSHostingProcess>
    <ErrorReport>prompt</ErrorReport>
    <Prefer32Bit>true</Prefer32Bit>
    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
    <DebugSymbols>true</DebugSymbols>
    <OutputPath>bin\x86\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
    <NoWarn>;2008</NoWarn>
    <DebugType>full</DebugType>
    <PlatformTarget>x86</PlatformTarget>
    <UseVSHostingProcess>false</UseVSHostingProcess>
    <ErrorReport>prompt</ErrorReport>
    <Prefer32Bit>true</Prefer32Bit>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
    <OutputPath>bin\x86\Release\</OutputPath>
    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
    <Optimize>true</Optimize>
    <NoWarn>;2008</NoWarn>
    <DebugType>pdbonly</DebugType>
    <PlatformTarget>x86</PlatformTarget>
    <UseVSHostingProcess>false</UseVSHostingProcess>
    <ErrorReport>prompt</ErrorReport>
    <Prefer32Bit>true</Prefer32Bit>
    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
  </PropertyGroup>
  <ItemGroup>
    <None Include="Hamburger_TemporaryKey.pfx" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="App.xaml.cs">
      <DependentUpon>App.xaml</DependentUpon>
    </Compile>
    <Compile Include="Controls\BasicRequest.cs" />
    <Compile Include="Controls\DataHelper.cs" />
    <Compile Include="Controls\DBHelper.cs" />
    <Compile Include="Controls\DnsRequest.cs" />
    <Compile Include="Controls\IcmpPacket.cs" />
    <Compile Include="Controls\Request.cs" />
    <Compile Include="Controls\UnitTest.cs" />
    <Compile Include="CustomConverter.cs" />
    <Compile Include="MainPage.xaml.cs">
      <DependentUpon>MainPage.xaml</DependentUpon>
    </Compile>
    <Compile Include="Models\Contact.cs" />
    <Compile Include="Models\CustomHandler.cs" />
    <Compile Include="Models\ErrorLog.cs" />
    <Compile Include="Models\Log.cs" />
    <Compile Include="Models\Site.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="Services\SettingsServices\SettingsService.cs" />
    <Compile Include="ViewModels\AddMonitorViewModel.cs" />
    <Compile Include="ViewModels\AddServerPageViewModel.cs" />
    <Compile Include="ViewModels\AddWebsitePageViewModel.cs" />
    <Compile Include="ViewModels\AllServerViewModel.cs" />
    <Compile Include="ViewModels\AllServer_addserverViewModel.cs" />
    <Compile Include="ViewModels\ChartPageViewModel.cs" />
    <Compile Include="ViewModels\ContactViewModel.cs" />
    <Compile Include="ViewModels\MainPageViewModel.cs" />
    <Compile Include="ViewModels\DetailPageViewModel.cs" />
    <Compile Include="ViewModels\SettingsPageViewModel.cs" />
    <Compile Include="ViewModels\SiteDetailViewModel.cs" />
    <Compile Include="Views\AddMonitor.xaml.cs">
      <DependentUpon>AddMonitor.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\AddServerPage.xaml.cs">
      <DependentUpon>AddServerPage.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\AddWebsitePage.xaml.cs">
      <DependentUpon>AddWebsitePage.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\AllServer.xaml.cs">
      <DependentUpon>AllServer.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\AllServer_addserver.xaml.cs">
      <DependentUpon>AllServer_addserver.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\BackupPage.xaml.cs">
      <DependentUpon>BackupPage.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\Busy.xaml.cs">
      <DependentUpon>Busy.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\Chart.xaml.cs">
      <DependentUpon>Chart.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\Contact.xaml.cs">
      <DependentUpon>Contact.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\DetailPage.xaml.cs">
      <DependentUpon>DetailPage.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\MainPage.xaml.cs">
      <DependentUpon>MainPage.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\SettingsPage.xaml.cs">
      <DependentUpon>SettingsPage.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\Shell.xaml.cs">
      <DependentUpon>Shell.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\SiteDetail.xaml.cs">
      <DependentUpon>SiteDetail.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\Splash.xaml.cs">
      <DependentUpon>Splash.xaml</DependentUpon>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <AppxManifest Include="Package.appxmanifest">
      <SubType>Designer</SubType>
    </AppxManifest>
  </ItemGroup>
  <ItemGroup>
    <Content Include="Assets\BadgeLogo.scale-100.png" />
    <Content Include="Assets\BadgeLogo.scale-125.png" />
    <Content Include="Assets\BadgeLogo.scale-150.png" />
    <Content Include="Assets\BadgeLogo.scale-200.png" />
    <Content Include="Assets\BadgeLogo.scale-400.png" />
    <Content Include="Assets\LargeTile.scale-100.png" />
    <Content Include="Assets\LargeTile.scale-125.png" />
    <Content Include="Assets\LargeTile.scale-150.png" />
    <Content Include="Assets\LargeTile.scale-200.png" />
    <Content Include="Assets\LargeTile.scale-400.png" />
    <Content Include="Assets\SmallTile.scale-100.png" />
    <Content Include="Assets\SmallTile.scale-125.png" />
    <Content Include="Assets\SmallTile.scale-150.png" />
    <Content Include="Assets\SmallTile.scale-200.png" />
    <Content Include="Assets\SmallTile.scale-400.png" />
    <Content Include="Assets\SplashScreen.scale-100.png" />
    <Content Include="Assets\SplashScreen.scale-125.png" />
    <Content Include="Assets\SplashScreen.scale-150.png" />
    <Content Include="Assets\SplashScreen.scale-400.png" />
    <Content Include="Assets\Square150x150Logo.scale-100.png" />
    <Content Include="Assets\Square150x150Logo.scale-125.png" />
    <Content Include="Assets\Square150x150Logo.scale-150.png" />
    <Content Include="Assets\Square150x150Logo.scale-400.png" />
    <Content Include="Assets\Square44x44Logo.altform-unplated_targetsize-16.png" />
    <Content Include="Assets\Square44x44Logo.altform-unplated_targetsize-256.png" />
    <Content Include="Assets\Square44x44Logo.altform-unplated_targetsize-32.png" />
    <Content Include="Assets\Square44x44Logo.altform-unplated_targetsize-48.png" />
    <Content Include="Assets\Square44x44Logo.scale-100.png" />
    <Content Include="Assets\Square44x44Logo.scale-125.png" />
    <Content Include="Assets\Square44x44Logo.scale-150.png" />
    <Content Include="Assets\Square44x44Logo.scale-400.png" />
    <Content Include="Assets\Square44x44Logo.targetsize-16.png" />
    <Content Include="Assets\Square44x44Logo.targetsize-24.png" />
    <Content Include="Assets\Square44x44Logo.targetsize-256.png" />
    <Content Include="Assets\Square44x44Logo.targetsize-32.png" />
    <Content Include="Assets\Square44x44Logo.targetsize-48.png" />
    <Content Include="Assets\StoreLogo.scale-100.png" />
    <Content Include="Assets\StoreLogo.scale-125.png" />
    <Content Include="Assets\StoreLogo.scale-150.png" />
    <Content Include="Assets\StoreLogo.scale-200.png" />
    <Content Include="Assets\StoreLogo.scale-400.png" />
    <Content Include="Common\Config.xml" />
    <Content Include="Common\example-xmal.xml" />
    <Content Include="Common\README.txt" />
    <Content Include="Images\addphone.png" />
    <Content Include="Images\adduser.png" />
    <Content Include="Images\appbar.add.png" />
    <Content Include="Images\appbar.back.png" />
    <Content Include="Images\appbar.cancel.png" />
    <Content Include="Images\appbar.check.png" />
    <Content Include="Images\appbar.delete.png" />
    <Content Include="Images\appbar.eventlist.png" />
    <Content Include="Images\appbar.home.png" />
    <Content Include="Images\appbar.move.png" />
    <Content Include="Images\appbar.refresh.png" />
    <Content Include="Images\appbar.seeall.png" />
    <Content Include="Images\appbar.settings.png" />
    <Content Include="Images\error.png" />
    <Content Include="Images\head.png" />
    <Content Include="Images\ic.app.png" />
    <Content Include="Images\ic.edit.png" />
    <Content Include="Images\ic.email.png" />
    <Content Include="Images\ic.filter.png" />
    <Content Include="Images\ic.phone.png" />
    <Content Include="Images\ic.server.png" />
    <Content Include="Images\ic_website.png" />
    <Content Include="Images\ic_precheck.png" />
    <Content Include="Images\ic_server.png" />
    <Content Include="Images\iconfont_add.png" />
    <Content Include="Images\radio02.png" />
    <Content Include="Images\ServerMonitor_icon.png" />
    <Content Include="Images\Server_Ico.jpg" />
    <Content Include="Images\splash-sdk.png" />
    <Content Include="Images\valley.png" />
    <Content Include="Properties\Default.rd.xml" />
    <Content Include="Assets\LockScreenLogo.scale-200.png" />
    <Content Include="Assets\SplashScreen.scale-200.png" />
    <Content Include="Assets\Square150x150Logo.scale-200.png" />
    <Content Include="Assets\Square44x44Logo.scale-200.png" />
    <Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
    <Content Include="Assets\Wide310x150Logo.scale-200.png" />
    <Content Include="README.txt" />
  </ItemGroup>
  <ItemGroup>
    <ApplicationDefinition Include="App.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </ApplicationDefinition>
  </ItemGroup>
  <ItemGroup>
    <Page Include="MainPage.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Styles\Custom.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Page>
    <Page Include="Views\AddMonitor.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Page Include="Views\AddServerPage.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Page Include="Views\AddWebsitePage.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Page Include="Views\AllServer.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Views\AllServer_addserver.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Page Include="Views\BackupPage.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Views\Busy.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Views\Chart.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Views\Contact.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Views\DetailPage.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Page Include="Views\MainPage.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Views\SettingsPage.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Page Include="Views\Shell.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Page Include="Views\SiteDetail.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Page Include="Views\Splash.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="Heijden.Dns.Portable">
      <Version>2.0.19</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
      <Version>6.0.8</Version>
    </PackageReference>
    <PackageReference Include="MvvmLight">
      <Version>5.3.0</Version>
    </PackageReference>
    <PackageReference Include="MvvmLightLibs">
      <Version>5.3.0</Version>
    </PackageReference>
    <PackageReference Include="SQLite.Net-PCL">
      <Version>3.1.1</Version>
    </PackageReference>
    <PackageReference Include="SQLite.uwp">
      <Version>3.23.0</Version>
    </PackageReference>
    <PackageReference Include="SQLitePCL">
      <Version>3.8.7.2</Version>
    </PackageReference>
    <PackageReference Include="System.Net.Ping">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.Xml.ReaderWriter">
      <Version>4.3.1</Version>
    </PackageReference>
    <PackageReference Include="Telerik.UI.for.UniversalWindowsPlatform">
      <Version>1.0.0.9</Version>
    </PackageReference>
    <PackageReference Include="Template10">
      <Version>1.1.12</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.Xaml.Behaviors.Uwp.Managed">
      <Version>1.1.0</Version>
    </PackageReference>
    <PackageReference Include="Newtonsoft.Json">
      <Version>9.0.1</Version>
    </PackageReference>
  </ItemGroup>
  <ItemGroup>
    <SDKReference Include="Microsoft.VCLibs, version=14.0">
      <Name>Visual C++ 2015 Runtime for Universal Windows Platform Apps</Name>
    </SDKReference>
  </ItemGroup>
  <ItemGroup>
    <WCFMetadata Include="Connected Services\" />
  </ItemGroup>
  <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
    <VisualStudioVersion>14.0</VisualStudioVersion>
  </PropertyGroup>
  <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
  <Target Name="AfterBuild">
    <Message Importance="High" Text="Thank you for using Template 10. Find out more at http://aka.ms/template10" />
  </Target>
</Project>

Most helpful comment

Invoke the build using the copy of MSBuild from Visual Studio, not the (very old but not removable due to compat) copy in the .NET Framework. The easiest way to do so is to use a "Developer Command Prompt for VS 2017" window, or you can directly invoke MSBuild\15.0\Bin\MSBuild.exe from the VS installation.

All 4 comments

What should I do if I want to build it successfully?

Invoke the build using the copy of MSBuild from Visual Studio, not the (very old but not removable due to compat) copy in the .NET Framework. The easiest way to do so is to use a "Developer Command Prompt for VS 2017" window, or you can directly invoke MSBuild\15.0\Bin\MSBuild.exe from the VS installation.

Thank u so much, I will try it as soon as possible .

Problem had been solved ! Thx

Was this page helpful?
0 / 5 - 0 ratings