Search code examples
c#.netvisual-studio-2010c#-4.0tweetinvi

Random "namespace name 'Core' does not exist in namespace ' Tweetinvi"


I'm using the Tweetinvi C# Twitter API. It was working great until about 3 hours ago, when my solution (specifically one project) just stopped building.

The error is a normal Assembly/Reference missing error, but I can see the files listed in the "references" folder. If i refresh the project, the errors go away. Until i build, then they come back.

This is the same as this post, but my project does not target the client profile, its targets .NET 4 (Project>Properties>Application>Target Framework, right?), like it did this morning, like it did yesterday.

I've uninstalled and reinstalled the Tweetinvi package via Nuget. Removed the references and re-added manually. No change.

EDIT: To keep the crazy up, if i go to the Object Browser, and view by Namespace, there is only {}Tweetinvi.Security. If i refresh the project, i get them ALL back. Until I build.

EDIT2: One of the warnings i get on build.

The primary reference "Tweetinvi, Version=0.9.3.3, Culture=neutral, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the framework assembly "System.Threading.Tasks, Version=2.5.19.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "Tweetinvi, Version=0.9.3.3, Culture=neutral, processorArchitecture=MSIL" or retarget your application to a framework version which contains "System.Threading.Tasks, Version=2.5.19.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".


Solution

  • Ok, after some more Goolging on the Error showing in EDIT2, I found this SO post, and specifically the answer by fahadash. This fixed my issue. I had changed these properties in the GUI, but it wasn't until I went and did it manually (With Sublime Text), that it took effect.

    Here is a copy of fahadash's answer

    I found this Blog post from Nansen and I applied the fix and got my issue resolved.

    Summary of the solution: Edit the csproj file in XML editor and find the elements for the references that are troubling you and add the following child element to those.

    <SpecificVersion>True</SpecificVersion>

    Make sure the word True is only first letter uppercase (True, not true or TRUE).

    Save and reload the project in VS and build it.