Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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'; HelpersExceptions

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

like image 327
Alexander Forbes-Reed Avatar asked Jan 25 '13 17:01

Alexander Forbes-Reed


2 Answers

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

like image 160
Alexander Forbes-Reed Avatar answered Nov 08 '22 22:11

Alexander Forbes-Reed


I've had this problem before when referencing other projects in the same solution. My problem was simply that I had that ONE project set to build as Release while the rest of the solution was set as Debug. This meant that even though I referenced the project correctly, the compiler wasnt finding the compiled DLL in the debug directory. Any chance that is it?

like image 24
jmrnet Avatar answered Nov 08 '22 22:11

jmrnet