Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Sharepoint Warning with underlined words in visual studio 2008 c#

  Asked By: Lucas    Date: Sep 26    Category: Sharepoint    Views: 1539

Error Message.

Warning 4 Argument type 'Microsoft.SharePoint.Administration.SPWebApplication' is not CLS-compliant C:\Documents and Settings\Administrator\Desktop\Microsoft.SharePoint.Administration\Microsoft.SharePoint.Administration\WebPart1\WebPart1.cs 49 51Microsoft.SharePoint.Administration

Am I missing something?



2 Answers Found

Answer #1    Answered By: Abinav Basu     Answered On: Sep 26

Do you have:

[assembly: System.CLSCompliant(true)]

somewhere in your assembly or directly applied to a property? If so, you'd probably have to remove it or set it to 'false' to get rid of the warning. Many of the SharePoint API classes are not CLS compliant.

Answer #2    Answered By: Teresa Simpson     Answered On: Sep 26

While developing a SharePoint webpart and not a .NET webpart, too many libraries / objects are not CLS compliant. Visual Studio 2008 gives it as a warning  and it will not give you any error in working / functionality wise. But if you want to remove this.

1. Open AssemblyInfo.cs.
2. Add [assembly: CLSCompliant(true)]

I think that this will solve your problem.