Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

NCrunch Failing to comple .Windows & .WindowsPhone projects inside Universal Application solution
abeech
#1 Posted : Wednesday, April 16, 2014 1:43:23 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/16/2014(UTC)
Posts: 4
Location: United Kingdom

I'm using Ncrunch with one of the new Universal Apps in VS2013 Update 2 RC.

Although other PCL projects in the same solution compile and test fine, the .Windows & .WindowsPhone projects in the solution fail to compile in Ncrunch. (they compile fine outside ncrunch)

I am new to Ncrunch but have done my best to try altering the settings in the configuration lists for these projects but no luck.

Errors are:

for the .Windows project:

NCrunch: If you are experiencing problems in getting this project to build, have a look at http://www.ncrunch.net/d...ing_project-build-issues
..\..\..\..\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v12.0\8.1\Microsoft.Windows.UI.Xaml.Common.targets (476): Unable to copy file "obj\Debug\C:\Users\alan.beech\AppData\Local\NCrunch\11844\7\MPTracker\MPTracker.Shared\App.xbf" to "bin\Debug\C:\Users\alan.beech\AppData\Local\NCrunch\11844\7\MPTracker\MPTracker.Shared\App.xbf". The given path's format is not supported.


for the .WindowsPhone project:

NCrunch: If you are experiencing problems in getting this project to build, have a look at http://www.ncrunch.net/d...ing_project-build-issues
..\..\..\..\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v12.0\8.1\Microsoft.Windows.UI.Xaml.Common.targets (476): Unable to copy file "obj\Debug\C:\Users\alan.beech\AppData\Local\NCrunch\11844\10\MPTracker\MPTracker.Shared\App.xbf" to "bin\Debug\C:\Users\alan.beech\AppData\Local\NCrunch\11844\10\MPTracker\MPTracker.Shared\App.xbf". The given path's format is not supported.

Alan
Remco
#2 Posted : Wednesday, April 16, 2014 10:55:01 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,135

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi Alan,

It looks like something is wrong here with the OutputPath or AssemblyName property inside the project's build XML. Were these projects created from the standard PCL template in Visual Studio?

If you can get me a copy/paste of the active set of properties inside the project build XML, I might be able to help you dig a bit deeper. For example:

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{AEDF6510-11DC-416E-89C4-412099399F58}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SampleProject</RootNamespace>
<AssemblyName>SampleProject</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>

abeech
#3 Posted : Thursday, April 17, 2014 7:41:09 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/16/2014(UTC)
Posts: 4
Location: United Kingdom

The projects was created using the template for the new Universal App type:

Visual C#/Store Apps/Universal Apps/Hub App (Universal Apps)

It creates a solution with 3 projects '<xxx>.Windows', '<xxx>.WindowsPhone' & '<xxx>.Shared'. NCrunch seems ok with the .Shared project. Unlike normal solutions it puts these 3 in a subfolder named the same as the project files rather than in the root of the solution.. I don't know if that is causing the problem.

for the .Windows project we have:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="(- BROKEN LINK -)">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{2B20B0AA-D76C-4697-919D-2BF25B75C1FF}</ProjectGuid>
<OutputType>AppContainerExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MPTracker</RootNamespace>
<AssemblyName>MPTracker.Store</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformVersion>8.1</TargetPlatformVersion>
<MinimumVisualStudioVersion>12</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SynthesizeLinkMetadata>true</SynthesizeLinkMetadata>
<PackageCertificateKeyFile>MPTracker.Windows_TemporaryKey.pfx</PackageCertificateKeyFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_APP</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_APP</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_APP</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_APP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_APP</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_APP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_APP</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_APP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
<ProjectReference Include="..\..\MPTracker.Core\MPTracker.Core.csproj">
<Project>{5417d9e2-f4a5-4387-b768-a55ab776c6b9}</Project>
<Name>MPTracker.Core</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="HubPage.xaml.cs">
<DependentUpon>HubPage.xaml</DependentUpon>
</Compile>
<Compile Include="SectionPage.xaml.cs">
<DependentUpon>SectionPage.xaml</DependentUpon>
</Compile>
<Compile Include="ItemPage.xaml.cs">
<DependentUpon>ItemPage.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
<None Include="MPTracker.Windows_TemporaryKey.pfx" />
</ItemGroup>
<ItemGroup>
<Content Include="Assets\Logo.scale-100.png" />
<Content Include="Assets\SmallLogo.scale-100.png" />
<Content Include="Assets\SplashScreen.scale-100.png" />
<Content Include="Assets\StoreLogo.scale-100.png" />
<Content Include="Assets\WideLogo.scale-100.png" />
</ItemGroup>
<ItemGroup>
<Page Include="HubPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SectionPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ItemPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '12.0' ">
<VisualStudioVersion>12.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="..\MPTracker.Shared\MPTracker.Shared.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<!-- 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>
-->
</Project>

for the .WindowsPhone project:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="(- BROKEN LINK -)">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{EFEE0FF3-7ED7-4372-B4E0-F29A012E4F5B}</ProjectGuid>
<OutputType>AppContainerExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MPTracker</RootNamespace>
<AssemblyName>MPTracker.WindowsPhone</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformVersion>8.1</TargetPlatformVersion>
<MinimumVisualStudioVersion>12</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{76F1466A-8B6D-4E39-A767-685A06062A39};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SynthesizeLinkMetadata>true</SynthesizeLinkMetadata>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_PHONE_APP</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_PHONE_APP</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_PHONE_APP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
<OutputPath>bin\ARM\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_PHONE_APP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_PHONE_APP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_PHONE_APP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
<ProjectReference Include="..\..\MPTracker.Core\MPTracker.Core.csproj">
<Project>{5417d9e2-f4a5-4387-b768-a55ab776c6b9}</Project>
<Name>MPTracker.Core</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="HubPage.xaml.cs">
<DependentUpon>HubPage.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SectionPage.xaml.cs">
<DependentUpon>SectionPage.xaml</DependentUpon>
</Compile>
<Compile Include="ItemPage.xaml.cs">
<DependentUpon>ItemPage.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
</ItemGroup>
<ItemGroup>
<Content Include="Assets\Logo.scale-240.png" />
<Content Include="Assets\SmallLogo.scale-240.png" />
<Content Include="Assets\SplashScreen.scale-240.png" />
<Content Include="Assets\Square71x71Logo.scale-240.png" />
<Content Include="Assets\StoreLogo.scale-240.png" />
<Content Include="Assets\WideLogo.scale-240.png" />
<Content Include="Assets\HubBackground.theme-dark.png" />
<Content Include="Assets\HubBackground.theme-light.png" />
</ItemGroup>
<ItemGroup>
<Page Include="HubPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SectionPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ItemPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '12.0' ">
<VisualStudioVersion>12.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="..\MPTracker.Shared\MPTracker.Shared.projitems" Label="Shared" />
<PropertyGroup Condition=" '$(TargetPlatformIdentifier)' == '' ">
<TargetPlatformIdentifier>WindowsPhoneApp</TargetPlatformIdentifier>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<!-- 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>
-->
</Project>
Remco
#4 Posted : Thursday, April 17, 2014 1:31:42 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,135

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi,

Can you confirm 100% that these projects are building correctly for you inside Visual Studio? When creating a solution using the template you've mentioned, I seem to receive the same error completely regardless of whether NCrunch is being used or not. I think there maybe something more seriously wrong with the build logic for these projects that is outside the scope of NCrunch.

If your build seems to work correctly inside Visual Studio, does executing MSBuild.exe against the individual .csproj files work correctly?
abeech
#5 Posted : Thursday, April 17, 2014 3:02:03 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/16/2014(UTC)
Posts: 4
Location: United Kingdom

Yes, see below. A result of Rebuild All:

1>------ Rebuild All started: Project: MPTracker.Core, Configuration: Debug Any CPU ------
1> MPTracker.Core -> C:\Users\alan.beech\Dropbox\WORKINGFOLDER\MPTracker\MPTracker.Core\bin\Debug\MPTracker.Core.dll
2>------ Rebuild All started: Project: MPTracker.Windows, Configuration: Debug Any CPU ------
3>------ Rebuild All started: Project: MPTracker.WindowsPhone, Configuration: Debug Any CPU ------
4>------ Rebuild All started: Project: MPTracker.Specs, Configuration: Debug Any CPU ------
2> MPTracker.Windows -> C:\Users\alan.beech\Dropbox\WORKINGFOLDER\MPTracker\MPTracker\MPTracker.Windows\bin\Debug\MPTracker.Store.exe
4> MPTracker.Specs -> C:\Users\alan.beech\Dropbox\WORKINGFOLDER\MPTracker\MPTracker.Specs\bin\Debug\MPTracker.Specs.dll
3> MPTracker.WindowsPhone -> C:\Users\alan.beech\Dropbox\WORKINGFOLDER\MPTracker\MPTracker\MPTracker.WindowsPhone\bin\Debug\MPTracker.WindowsPhone.exe
========== Rebuild All: 4 succeeded, 0 failed, 0 skipped ==========

..as you will see I have added a .Core and .Spec PCL projects to the solution which have some logic and tests which work nicely in ncrunch. (they sit in project folders within the solution folder as usual)

It's only a basic solution structure.. not started any real code yet so happy to email it to you zipped if that would help.
abeech
#6 Posted : Thursday, April 17, 2014 3:13:35 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/16/2014(UTC)
Posts: 4
Location: United Kingdom

just tried MSBuild C:\Users\alan.beech\Dropbox\WORKINGFOLDER\MPTracker\MPTracker\MPTracker.Windows\MPTracker.Windows.csproj and I get the same errors ad ncrunch. It looks like VS is doing something to take account of the extra level of folders in this solution type.
Remco
#7 Posted : Friday, April 18, 2014 12:04:25 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,135

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
This problem seems to be related to how the template shares the App.xaml file between projects in the solution.

Visual Studio has slightly different build logic compared to MSBuild when processing a solution as a whole, so I can only assume the difference is allowing it to work artificially. This is probably how the issue managed to progress as far as it did (the RC build).

The problem seems to be caused in line 441 of Microsoft.Windows.UI.Xaml.Common.Targets, where the XAML source/destination aren't taking into account the absolute file path being specified for App.xaml:
<GeneratedXamlSrc0 Condition="'%(AllProjectXamlPages.Link)'==''" Include="@(AllProjectXamlPages->'$(XamlGeneratedOutputPath)%(Identity)')" />

App.xaml has its file path specified differently because it is a solution-level item ("$(MSBuildThisFileDirectory)App.xaml").

The easiest way to solve this problem is to specify a link attribute for the App.xaml file inside the HubApp.Shared.projitems build target file, in the HubApp.Shared directory. This will override the faulty logic and specify a relative path that works correctly with the XAML copying build step. Inside the .projitems file you'll find the following code:

<ApplicationDefinition Include="$(MSBuildThisFileDirectory)App.xaml">
<SubType>Designer</SubType>
</ApplicationDefinition>

Replace this with:

<ApplicationDefinition Include="$(MSBuildThisFileDirectory)App.xaml">
<SubType>Designer</SubType>
<Link>App.xaml</Link>
</ApplicationDefinition>

.. Then reset the NCrunch engine. The projects should now build correctly.

I've also raised this issue with MS, as I'm sure they won't want it in the RTM - https://connect.microsoft.com/VisualStudio/feedback/details/856162/build-problem-in-template-hub-app-universal-apps#
1 user thanked Remco for this useful post.
willcowell on 5/19/2015(UTC)
Derek Lakin
#9 Posted : Wednesday, December 3, 2014 12:20:42 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/3/2014(UTC)
Posts: 1
Location: United States of America

is there an alternative solution? I tried the <Link /> solution but not the app throws a XamlParseException at runtime :(
Remco
#10 Posted : Wednesday, December 3, 2014 3:05:03 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,135

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Sorry I know of no other way to work around this problem. I'm afraid that this is an issue that you'll need to take up with MS tech support. The template itself is bugged and the problem sits between it and MSBuild.

Sadly MS seem to have chosen not to fix the problem .. Perhaps with some prodding they may be able to provide you with a different workaround that works for you.
Leonid
#11 Posted : Monday, January 12, 2015 6:50:33 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/2/2013(UTC)
Posts: 7
Location: United States of America

Thanks: 2 times
Derek, are you sure you put <Link /> in the right place? That solution works for me for a blank project, and no exception.

Another straightforward way to workaround is to copy app.xaml* from projitems and paste them into each Windows and WindowPhone projects. You can either physically move the files, in which case you get file duplication, or add them to each project as a link to the Shared folder - basically "roll your own" version of the shared project. If you do that using VS Solution Explorer, make sure you then change the Build Action to "ApplicationDefinition" and not "Page".
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.286 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download