+1-888-365-2779
Try Now
More in this section

Forums / Sitefinity SDK / The type or namespace name 'Sitefinity' does not exist in the namespace 'Telerik' (are you missing an assembly reference?)

The type or namespace name 'Sitefinity' does not exist in the namespace 'Telerik' (are you missing an assembly reference?)

5 posts, 0 answered
  1. G S S
    G S S avatar
    71 posts
    Registered:
    16 Mar 2008
    13 Mar 2011
    Link to this post
    Hi,

    I've written a basic C# 4.0 console application which uploads files from my local machine to my remote Sitefinity 4.0 site.

    I've added the following references:

    using Telerik.Sitefinity;
    using Telerik.Sitefinity.Libraries.Model;
    using Telerik.Sitefinity.Modules.Libraries;

    These references are on lines 3, 4 and 5 of the class. They are in used (not greyed out).

    However, I get this compilation error:

    Error   2   The type or namespace name 'Sitefinity' does not exist in the namespace 'Telerik' (are you missing an assembly reference?)   C:\SourceControlledProjects\SitefinityUploader\SitefinityUploader\SitefinityUploader\Program.cs   4   15   SitefinityUploader


    That's one for line 4, I get two more of these errors (for lines 3 and 5, too, exactly the same error).

    What am I missing here?

    Thanks
  2. Jerami Tainter
    Jerami Tainter avatar
    27 posts
    Registered:
    29 Oct 2009
    13 Mar 2011
    Link to this post
    I would double check that those references are actually referenced in that Console project. Did you go through the process to add the dlls to your bin and reference them in the project?
  3. G S S
    G S S avatar
    71 posts
    Registered:
    16 Mar 2008
    13 Mar 2011
    Link to this post
    Yep, I did. The .dlls exist in the location I added them from (obviously). And after adding the references, the physical dlls still exist in their respective directory (if not, VS2010 would have the yellow exclamation mark next to the reference name).

    There is one error in the code (GetFiles method has no parameter specified), if I fill in the parameter, this doesn't fix anything (obviously, too).

    I've referenced the assembly through the using statements, after adding them to references. I also did not reference them via the using statements, after adding them to the project, and instead specified a fully qualified path to the classes I need (e.g. Telerik.Sitefinity.Model.... or whatever), but this does not fix anything, either.
  4. Jerami Tainter
    Jerami Tainter avatar
    27 posts
    Registered:
    29 Oct 2009
    14 Mar 2011
    Link to this post
    Right Click on your project and click Properties
    Change your Target Framework to .NET Framework 4, im guessing you have .NET Framework 4 Client Profile selected

    Recompile and you should be good to go.
  5. G S S
    G S S avatar
    71 posts
    Registered:
    16 Mar 2008
    14 Mar 2011
    Link to this post
    Did that, code compiles, thanks!
5 posts, 0 answered