locked
Problem adding a feature RRS feed

  • Question

  • I have 2 xml files in a C# project and I'm getting a "element is not declared" warning in both files where I have the following:

    xmlns="http://schemas.microsoft.com/sharepoint/

    I've taken a look at other features files and see the same line.  The feature I'm trying to incorporate is not showing up in Site Features as it should.  Any ideas why I'm getting the warning.

    Windows Server 2003 R2
    Visual Studio 2005
    MOSS
    Friday, May 8, 2009 9:00 PM

Answers

  • Using Visual Studio, enable intellisense on your XML by copying the XML schema files (XSD files from C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\XML) into the Visual Studio schema cache. (VS 2008 uses the following path, VS 2005 uses something similar: C:\Program Files (x86)\Microsoft Visual Studio 9.0\Xml\Schemas). That will help you. If you're stuck, post your XML. 
    Daniel Larson, SharePoint MVP, MS Press Author, NewsGator Software Developer Check out my books on Amazon: - Inside Microsoft Windows SharePoint Services 3.0 (with Ted Pattson) - Developing Service Oriented AJAX Applications on the Microsoft Platform (.NET 3.5, WCF, Microsoft AJAX)
    • Proposed as answer by daniel.larson Friday, May 8, 2009 10:56 PM
    • Marked as answer by kiloez Friday, May 8, 2009 11:07 PM
    Friday, May 8, 2009 10:56 PM

All replies

  • Can you open your feature.xml in DOS edit mode and make sure that you don't have any junk characters.

    Thanks,
    Suhaib Khan
    Friday, May 8, 2009 9:25 PM
  • Using Visual Studio, enable intellisense on your XML by copying the XML schema files (XSD files from C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\XML) into the Visual Studio schema cache. (VS 2008 uses the following path, VS 2005 uses something similar: C:\Program Files (x86)\Microsoft Visual Studio 9.0\Xml\Schemas). That will help you. If you're stuck, post your XML. 
    Daniel Larson, SharePoint MVP, MS Press Author, NewsGator Software Developer Check out my books on Amazon: - Inside Microsoft Windows SharePoint Services 3.0 (with Ted Pattson) - Developing Service Oriented AJAX Applications on the Microsoft Platform (.NET 3.5, WCF, Microsoft AJAX)
    • Proposed as answer by daniel.larson Friday, May 8, 2009 10:56 PM
    • Marked as answer by kiloez Friday, May 8, 2009 11:07 PM
    Friday, May 8, 2009 10:56 PM
  • Thanks Daniel.  After copying the XSD files I found that I had to also close then restart Visual Studio in order for things to work correctly.  Before your suggestion I did however create schemas within the project, for both files, from the XML menu and that worked.  I now realize the importance of having those schema files present in one form or another.   Thanks again.
    Friday, May 8, 2009 11:07 PM