Home Dashboard Directory Help
Search

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


Status: 

Closed
 as Fixed Help for as Fixed


10
0
Sign in
to vote
Type: Bug
ID: 770242
Opened: 11/6/2012 8:54:00 AM
Access Restriction: Public
0
Workaround(s)
view
2
User(s) can reproduce this bug

Description

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
Sign in to post a comment.
Posted by Adam Ralph on 4/24/2014 at 11:50 AM
@David, I've tried looking for an <Import Include="..."/> element but I'm not sure such a thing exists. Perhaps you mean <Import Project=""/>? Or <Compile Include=""/>?
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.
File Name Submitted By Submitted On File Size  
Utility.zip 11/6/2012 14 KB