Using Sharepoint 2010, I am trying to use the SPWebConfigModification class to add connection strings the the sharepoint's web.config.
My problem is that the class SPWebConfigModification is not recognized at compile time by Visual Studio because the Microsoft.Sharepoint.dll assembly containing its namespace collides with another assembly with the same name. The two assemblies are:
- C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SharePointTools\ReferenceAssemblies\14\Microsoft.SharePoint.dll (the bad one)
- C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\Microsoft.SharePoint.dll (the one i'm expecting to be linked with my project)
I do not understand why the first one is preferred over the other one during build. I even tried to put the good one in my project folder, but the problem remains...
Do you have any idea?
Here is my configuration:
- Visual studio 2012
- .Net 3.5
- Sharepoint foundation 2010
- Sharepoint 2010 SDK
Thanks a lot.