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 '15 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 '15 at 10:37

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

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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