Search code examples
c#portable-class-library

The type or namespace name 'Core' does not exist in the namespace 'AuntieDot'


I have 4 PCL's, and they are all targeted at the same Frameworks:

AuntieDot:

AuntieDot

AuntieDot.Authentication:

AuntieDot.Authentication

AuntieDot.Core:

AuntieDot.Core

AuntieDot.Models:

AuntieDot.Models

But for some reason, the usage of 'AuntieDot.Core.Helpers' in the 'AuntieDot.Authentication' namespace (despite 'AuntieDot.Core' being added as a reference into 'AuntieDot.Authentication', it's saying it doesn't exist. I've googled around and the only replies I've gotten is that I need to make sure the other libraries are targeted at the same frameworks, which they are.

The only external code I'm using is JSON.net, which I added via NuGet so I don't think that is the issue.

The code in the 'AuntieDot.Core'; Helpers Exceptions

The code that is throwing the issue is only complaining in the error list and on compile, it doesn't have a Red-Underline, like usual:

Error :(

I just thought that maybe posting the Build Output might help; http://pastebin.com/raw.php?i=wn74UKyc


Solution

  • Found the Issue, it seems there is a bug with VS when targeting the frameworks I'm targeting. I found this by googleing the The currently targeted framework ".NETPortable,Version=v4.5,Profile=Profile78" does not include "System.Net.Requests, Version=4.0.0.0, Culture=neutral error in the Build Output, this brought me to someone having the same issue on Microsoft's Connect Site. Seems they are fixing this bug soon, but until then Microsoft released this Workaround, thanks to Dave on the VS Team,

    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" element:

    <Target Name="_SetFullFrameworkFolderToProfile"
     AfterTargets="GetReferenceAssemblyPaths">
    
    <PropertyGroup>
     <_FullFrameworkReferenceAssemblyPaths>$(TargetFrameworkDirectory)</_FullFrameworkReferenceAssemblyPaths>
    </PropertyGroup>
    </Target>
    

    Andddd boom:

    swag