Bug 60090 - VS 2017 15.4 Will not load UWP projects
Summary: VS 2017 15.4 Will not load UWP projects
Status: RESOLVED ANSWERED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Xamarin.Forms ()
Version: 4.7.0 (15.4)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-10-10 14:45 UTC by Brian Macomber
Modified: 2017-10-11 21:04 UTC (History)
6 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Solution with UWP project that doesn't load (309.29 KB, application/x-zip-compressed)
2017-10-10 17:57 UTC, Brian Macomber
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Brian Macomber 2017-10-10 14:45:49 UTC
This very well could be an Visual Studio Issue (I'll try logging it there also), but on my main desktop after the VS 15.4 update I can no longer load my Forms UWP projects.  They get an null ref exception when loading.  Errors and the csproj file of one of the projects.  This same solution opens fine in VS 15.4 in a VM on my MacBook.  I tried doing a full repair of VS on the system, same problem.


C:\TFSSource\NextGen\AS.Mobile3\AS.Mobile.DealerTools\AS.Mobile.DealerTools.UWP\AS.Mobile.DealerTools.UWP.csproj : error  : Object reference not set to an instance of an object.

C:\TFSSource\NextGen\AS.Mobile3\AS.Mobile.Common.UWP\AS.Mobile.Common.UWP.csproj : error  : Object reference not set to an instance of an object.

C:\TFSSource\NextGen\AS.Mobile3\AS.Mobile.DealerTools\AS.Mobile.DealerTools.UWP\AS.Mobile.DealerTools.UWP.csproj : error  : Object reference not set to an instance of an object.


<?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>{4EDF579D-2531-4D03-AB3D-D36038BB0C10}</ProjectGuid>
    <OutputType>AppContainerExe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>AS.Mobile.DealerTools.UWP</RootNamespace>
    <AssemblyName>AS.Mobile.DealerTools.UWP</AssemblyName>
    <DefaultLanguage>en-US</DefaultLanguage>
    <TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
    <TargetPlatformVersion>10.0.15063.0</TargetPlatformVersion>
    <TargetPlatformMinVersion>10.0.15063.0</TargetPlatformMinVersion>
    <MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
    <EnableDotNetNativeCompatibleProfile>true</EnableDotNetNativeCompatibleProfile>
    <FileAlignment>512</FileAlignment>
    <ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    <PackageCertificateKeyFile>AS.Mobile.DealerTools.UWP_TemporaryKey.pfx</PackageCertificateKeyFile>
    <SccProjectName>SAK</SccProjectName>
    <SccLocalPath>SAK</SccLocalPath>
    <SccAuxPath>SAK</SccAuxPath>
    <SccProvider>SAK</SccProvider>
  </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>
    <!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
    <None Include="project.json" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="App.xaml.cs">
      <DependentUpon>App.xaml</DependentUpon>
    </Compile>
    <Compile Include="MainPage.xaml.cs">
      <DependentUpon>MainPage.xaml</DependentUpon>
    </Compile>
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <AppxManifest Include="Package.appxmanifest">
      <SubType>Designer</SubType>
    </AppxManifest>
    <None Include="AS.Mobile.DealerTools.UWP_TemporaryKey.pfx" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="account.png" />
    <Content Include="accounting.png" />
    <Content Include="accounting_invoice.png" />
    <Content Include="accounting_invoice_ach.png" />
    <Content Include="accounting_invoice_bad.png" />
    <Content Include="accounting_invoice_credit.png" />
    <Content Include="accounting_invoice_warning.png" />
    <Content Include="accounting_po.png" />
    <Content Include="accounting_po_bad.png" />
    <Content Include="accounting_po_scheduled.png" />
    <Content Include="accounting_po_warning.png" />
    <Content Include="accounting_pricelist.png" />
    <Content Include="accounting_pricelist_level.png" />
    <Content Include="actionitem.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\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="clients.png" />
    <Content Include="client_delete.png" />
    <Content Include="client_details.png" />
    <Content Include="client_edit.png" />
    <Content Include="client_new.png" />
    <Content Include="contact.png" />
    <Content Include="contacts.png" />
    <Content Include="contact_delete.png" />
    <Content Include="contact_edit.png" />
    <Content Include="contact_new.png" />
    <Content Include="dealers.png" />
    <Content Include="document.png" />
    <Content Include="documents.png" />
    <Content Include="equipmentlocker.png" />
    <Content Include="equipmentlocker_cart.png" />
    <Content Include="equipmentlocker_cart_add.png" />
    <Content Include="equipmentlocker_cart_delete.png" />
    <Content Include="equipmentlocker_history.png" />
    <Content Include="events.png" />
    <Content Include="events_invite.png" />
    <Content Include="fields.png" />
    <Content Include="field_delete.png" />
    <Content Include="field_details.png" />
    <Content Include="field_edit.png" />
    <Content Include="field_new.png" />
    <Content Include="files.png" />
    <Content Include="home.png" />
    <Content Include="inventorytransfers.png" />
    <Content Include="item_add.png" />
    <Content Include="item_delete.png" />
    <Content Include="item_download.png" />
    <Content Include="item_edit.png" />
    <Content Include="item_error.png" />
    <Content Include="item_important.png" />
    <Content Include="item_message.png" />
    <Content Include="item_new.png" />
    <Content Include="item_reports.png" />
    <Content Include="item_save.png" />
    <Content Include="item_share.png" />
    <Content Include="item_undo.png" />
    <Content Include="logout.png" />
    <Content Include="maps.png" />
    <Content Include="maps_full_extent.png" />
    <Content Include="maps_zoom_in.png" />
    <Content Include="maps_zoom_out.png" />
    <Content Include="map_layers.png" />
    <Content Include="missing.png" />
    <Content Include="news.png" />
    <Content Include="news_calendar.png" />
    <Content Include="Properties\Default.rd.xml" />
    <Content Include="Assets\LockScreenLogo.scale-100.png" />
    <Content Include="Assets\LockScreenLogo.scale-125.png" />
    <Content Include="Assets\LockScreenLogo.scale-150.png" />
    <Content Include="Assets\LockScreenLogo.scale-200.png" />
    <Content Include="Assets\LockScreenLogo.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-200.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-200.png" />
    <Content Include="Assets\Square150x150Logo.scale-400.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-200.png" />
    <Content Include="Assets\Square44x44Logo.scale-400.png" />
    <Content Include="Assets\Square44x44Logo.targetsize-16_altform-unplated.png" />
    <Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
    <Content Include="Assets\Square44x44Logo.targetsize-32_altform-unplated.png" />
    <Content Include="Assets\Square44x44Logo.targetsize-48_altform-unplated.png" />
    <Content Include="Assets\Square44x44Logo.targetsize-256_altform-unplated.png" />
    <Content Include="Assets\StoreLogo.png" />
    <Content Include="Assets\Wide310x150Logo.scale-100.png" />
    <Content Include="Assets\Wide310x150Logo.scale-125.png" />
    <Content Include="Assets\Wide310x150Logo.scale-150.png" />
    <Content Include="Assets\Wide310x150Logo.scale-200.png" />
    <Content Include="Assets\Wide310x150Logo.scale-400.png" />
    <Content Include="recs.png" />
    <Content Include="recs_new.png" />
    <Content Include="settings.png" />
    <Content Include="soiltests.png" />
  </ItemGroup>
  <ItemGroup>
    <ApplicationDefinition Include="App.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </ApplicationDefinition>
    <Page Include="MainPage.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\..\AS.Mobile.Common.UWP\AS.Mobile.Common.UWP.csproj">
      <Project>{f65a34d4-1239-43f5-94f4-9dbf5f7cd17a}</Project>
      <Name>AS.Mobile.Common.UWP</Name>
    </ProjectReference>
    <ProjectReference Include="..\..\AS.Mobile.Common\AS.Mobile.Common.csproj">
      <Project>{97e1e199-01a3-4564-a863-4b2e057eaabd}</Project>
      <Name>AS.Mobile.Common</Name>
    </ProjectReference>
    <ProjectReference Include="..\AS.Mobile.DealerTools\AS.Mobile.DealerTools.csproj">
      <Project>{c4840a58-42f6-4310-8b53-1df6aa62dcaf}</Project>
      <Name>AS.Mobile.DealerTools</Name>
    </ProjectReference>
  </ItemGroup>
  <!--<ItemGroup>
    <SDKReference Include="SQLite.UWP.2015, Version=3.14.1">
      <Name>SQLite for Universal Windows Platform %28SQLite.UWP.2015, Version=3.14.1%29</Name>
    </SDKReference>
  </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" />
</Project>
Comment 1 Jimmy [MSFT] 2017-10-10 16:43:38 UTC
That's odd, does it fail to load a non-Forms UWP solution as well? Do you have another machine that you can try opening it in?

Nothing in the csproj stands out as an obvious issue, but I was able to reproduce the error by making one of the Imports point to an invalid path. I would confirm that these imports do actually exist on the machine:

>   <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
>   <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />

On my machine the paths resolved to:

> C:\Program Files (x86)\MSBuild\14.0
> C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v14.0
Comment 2 Brian Macomber 2017-10-10 16:47:06 UTC
All the PCL projects and iOS and Android open fine.  It does open fine in VS 15.4 in a Win 10 VM on my MacBool.  I thought something was likely missing also, which is why I tried the full VS repair.

I also tried commenting out the various Import tags in the csproj file also, since I ran across an issue with web projects with a similar error when searching for solutions.

I'll check the paths.
Comment 3 Brian Macomber 2017-10-10 16:54:39 UTC
I have the paths on my machine and the files they reference.

I tried another very simple test solution I had, and the UWP project fails to load there also.  There must be something wrong on this machine.
Comment 4 Brian Macomber 2017-10-10 17:06:58 UTC
I added the following to my csproj file and manually called msbuild.  They appear to be resolving to a different location...unless I'm doing something wrong.

 <Target Name="ResolveTest">
    <Message Text="Paths" Importance="High"></Message>
    <Message Text="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)" Importance="High"></Message>
    <Message Text="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)" Importance="High"></Message>
  </Target>

Project "C:\TFSSource\NextGen\AS.Mobile3\AS.Mobile.DealerTools\AS.Mobile.DealerTools.UWP\AS.Mobile.DealerTools.UWP.csproj" on node 1 (ResolveTest tar
get(s)).
ResolveTest:
  Paths
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\WindowsXaml\v15.0
Done Building Project "C:\TFSSource\NextGen\AS.Mobile3\AS.Mobile.DealerTools\AS.Mobile.DealerTools.UWP\AS.Mobile.DealerTools.UWP.csproj" (ResolveTest
 target(s)).
Comment 5 Brian Macomber 2017-10-10 17:09:46 UTC
I also verified that the referenced files at those paths do exist
Comment 6 Brian Macomber 2017-10-10 17:48:13 UTC
whats also odd is that if I create a new UWP app project (not xamarin) it works fine.

I also created a new XF app, and UWP project loads also...but two different existing XF projects would not load????

I'm going to try to compare the csproj file of the just created against the ones that won't load.

Could it be a Window 10 version targeting issue?...SDK missing maybe.
Comment 7 Brian Macomber 2017-10-10 17:52:02 UTC
Changing the Target Platform got it to load

It was

<TargetPlatformVersion>10.0.15063.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.14393.0</TargetPlatformMinVersion>

When I copied the values out of the new XF UWP project of

<TargetPlatformVersion>10.0.16299.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10586.0</TargetPlatformMinVersion>

Then it would load.  Work on both the Executable project and the library project.
Comment 8 Brian Macomber 2017-10-10 17:57:17 UTC
Created attachment 25255 [details]
Solution with UWP project that doesn't load
Comment 9 Brian Macomber 2017-10-10 17:57:52 UTC
I uploaded a small solution that at least on my desktop machine produces the error in case it helps...but at least right now I'm back in business.

Thanks for the ideas to check!
Comment 10 Brian Macomber 2017-10-11 13:38:31 UTC
Replay from my Visual Studio Post that could explain what happened

https://developercommunity.visualstudio.com/content/problem/128532/project-load-failed.html

"I have the same issue with my UWP projects after upgrading to VS 15.4.

EDIT: I went back and checked the installer and found that the Windows 10 Creators Update Build 15063 had somehow been uninstalled. Checking this and modifying the installation fixed the issue."
Comment 11 Jimmy [MSFT] 2017-10-11 21:04:47 UTC
Interesting that that was the issue. I didn't consider that because from what I've seen, when a UWP project targets an SDK version not on the machine Visual Studio will prompt you to update your installation, not just fail to load it. Glad to hear you got this sorted out though!