没有找到spwebonfigmodification类?
-
09-12-2019 - |
题
使用SharePoint 2010,我尝试使用SpWebConfigmodification类来添加Connect Closs The SharePoint的Web.config。
我的问题是Visual Studio不在编译时识别SpWebConfigmodification,因为Microsoft.SharePoint.dll组件包含其命名空间与具有相同名称的另一个程序集碰撞。这两个装配是:
- c:\ program files(x86)\ msbuild \ microsoft \ visualstudio \ v11.0 \ sharepointtools \ referenceassemblies \ 14 \ microsoft.sharepoint.dll(坏的一个)
- c:\ program files \常用文件\ Microsoft Shared \ Web服务器扩展\ 14 \ ISAPI \ Microsoft.SharePoint.dll(我期待与我的项目链接)
我不明白为什么第一个在构建过程中优先于另一个。我甚至试图在我的项目文件夹中放置好的,但问题仍然存在...
你有什么想法吗?
这是我的配置:
- Visual Studio 2012
- .net 3.5
- SharePoint Foundation 2010
- SharePoint 2010 SDK
非常感谢。
解决方案
I found the problem: my solution was in Sandboxed mode! Changed the "Sandboxed solution" project's property to False and now it compiles :)
其他提示
Sounds like the SharePoint tools that got installed with Visual Studio 2012 need to be uninstalled.
I would then follow these steps to get the templates needed which enable both 2010 and 2013 SharePoint development:
http://yalla.itgroove.net/2012/08/sharepoint-2013-project-templates-for-visual-studio-2012/
Note: when downloading the client SDK, make sure it's not the preview version.