Search

Build error with dependent Portable Class Libraries that target Windows Phone 8 by salexander6

Closed
as Fixed Help for as Fixed

9
0
Sign in
to vote
Type: Bug
ID: 770242
Opened: 11/6/2012 8:54:00 AM
Access Restriction: Public
0
Workaround(s)
2
User(s) can reproduce this bug
I have a PCL Utility2 that references another PCL Utility. Both target the same profile (profile 78 - .NET 4.5, Windows Phone 8, and .NET for Windows Store apps). When Utility project uses the WebRequest type the Utility2 project is unable to reference it as Utility fails to build. Note that Utility builds fine on its own, it's just when the project is being referenced by another PCL that the build fails.

2>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3253: The currently targeted framework ".NETPortable,Version=v4.5,Profile=Profile78" does not include "System.Net.Requests, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which the referenced assembly "C:\Temp\Utility\Utility\Utility\bin\Debug\Utility.dll" depends on. This caused the referenced assembly to not resolve. To fix this, either (1) change the targeted framework for this project, or (2) remove the referenced assembly from the project.

Additionally using the Cookie type generates another similar failure

2>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3253: The currently targeted framework ".NETPortable,Version=v4.5,Profile=Profile78" does not include "System.Net.Primitives, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which the referenced assembly "C:\Temp\Utility\Utility\Utility\bin\Debug\Utility.dll" depends on. This caused the referenced assembly to not resolve. To fix this, either (1) change the targeted framework for this project, or (2) remove the referenced assembly from the project.
Details (expand)

Visual Studio/Team Foundation Server/.NET Framework Tooling Version

Visual Studio 2012

Steps to reproduce

Build the attached solution

Product Language

English

Operating System

Windows 8

Operating System Language

English

Actual results

Build fails since dependent project is not copied to bin directory.

Expected results

Build succeeds.
File Attachments
File Name Submitted By Submitted On File Size  
Utility.zip 11/6/2012 14 KB
Sign in to post a comment.
Posted by Microsoft on 1/16/2013 at 9:13 AM
We've fixed this issue, and it will be available in a future Visual Studio update.
Posted by Microsoft on 11/29/2012 at 4:10 PM
Thanks once again for the bug report. We've found another workaround that does not require you to change the frameworks you are targeting.

To workaround this, edit the project in a text editor, and add the following underneath the last <Import Include="..."/> element:

<Target Name="_SetFullFrameworkFolderToProfile"
     AfterTargets="GetReferenceAssemblyPaths">

    <PropertyGroup>
     <_FullFrameworkReferenceAssemblyPaths>$(TargetFrameworkDirectory)</_FullFrameworkReferenceAssemblyPaths>
    </PropertyGroup>
</Target>

Regards

David
Posted by Microsoft on 11/6/2012 at 11:04 AM
Thanks for this bug report. We are aware of the issue and are investigating. The issue will not occur if you target an additional platform in your portable library, such as .NET 4, Silverlight 5, or Windows Phone 7.5. So that is a possible workaround (of course targeting additional platforms will reduce the set of APIs available to you, so this may or may not work for you).
Posted by Microsoft on 11/6/2012 at 9:51 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.