Following code shows the code when the feature gets deactivated:

using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration; 

 public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
    string asmDetails = typeof(OnDownload).AssemblyQualifiedName;

    SPWebApplication webApp = properties.Feature.Parent as SPWebApplication;
    if (webApp == null) return;

    List<SPWebConfigModification> configModsFound = new List<SPWebConfigModification>();
    Collection<SPWebConfigModification> modsCollection = webApp.WebConfigModifications;
    for (int i = 0; i < modsCollection.Count; i++)
        if (modsCollection[i].Owner == asmDetails)


I want to know why I am getting red squiggly line under this line of code

Collection<SPWebConfigModification> modsCollection = webApp.WebConfigModifications;
  • What error you are getting while compiling?
    – 404
    Apr 27, 2015 at 10:35
  • @404 The type or namespace 'Collection' could not be found(are you missing a using directive or an assembly reference)
    – A Beginner
    Apr 27, 2015 at 10:37

1 Answer 1


Add the reference using System.Collections.ObjectModel; to the file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.