Swsecurity는 어디에 있습니까?Microsoft.SharePoint.dll 15.900.0.0이 아닙니다
-
10-12-2019 - |
문제
http://msdn.microsoft.com/ko.-US / Library / Microsoft.SharePoint.SPSecurity.aspx 말합니다
Microsoft.SharePoint.SPSecurity is in
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
.
SharePoint 2013
그러나 iLSPY 또는 객체 브라우저가 있거나 Visual Studio에서 참조를 해결하려고 시도 할 때, 거기가 아닙니다!
이 온라인에 대해 아무 것도 찾을 수 없기 때문에, 나는 이것이 주요 감독을하는 것입니다. 그러나 무엇을 알고 있지만, 뭐라구?!?
해결책
If I load a reference to Microsoft.Sharepoint.DLL inside a visual studio project, the added assembly is located at "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.dll".
When inspected with ILSpy this assembly does contain the SPSecurity class.
I'm not quite sure why you don't see it. But the build of the assembly differs from yours.
다른 팁
Here's the answer when you are using sandbox mode to develop, the SPSecurity class can't be accessed. Just use farm solution and you'll find that.
See Inside Microsoft SharePoint 2010
Chapter 4: Sandboxed Solutions (Inside SharePoint 2010)
Understanding Solution Restrictions
Restricting the access of sandboxed solutions to a subset of the Microsoft.SharePoint namespace is intended to prevent solutions from accessing functionality that could destabilize the farm. When sandboxed solutions make calls to the SharePoint object model, the calls are routed through the subset proxy, which in turn makes calls to the full object model. The subset proxy exposes only the following subset of the object model: All of the Microsoft.SharePoint namespace, except
- SPSite constructor
- SPSecurity object
- SPWorkItem and
- SPWorkItemCollection objects
- SPAlertCollection.Add method
- SPAlertTemplateCollection.Add method
- SPUserSolution and
- SPUserSolutionCollection objects
- SPTransformUtilities object
- Microsoft.SharePoint.Navigation namespace