将自定义 Asp.net 应用程序部署到与 Sharepoint 相同的 IIS 站点 [英] Deploying custom Asp.net applications to same IIS site as Sharepoint
问题描述
我正在尝试在与 Sharepoint 相同的站点上设置 Asp.net 应用程序.因此,http://sharepointurl 是 sharepoint 的 url,要访问应用程序,该 url 将是 http://sharepointurl/MyCustomWebApp/.我已经在这个级别设置了一个 IIS 应用程序,但尝试使用 bin 中的自定义 dll 运行该应用程序会导致错误
" 请求类型为Microsoft.SharePoint.Security.SharePointPermission"的权限,Microsoft.SharePoint.Security,版本=12.0.0.0,文化=中性,PublicKeyToken=71e9bce111e9429c'失败."
I am attempting to setup an Asp.net application on the same site as Sharepoint. So where http://sharepointurl is the url for sharepoint, to access the application the url would be http://sharepointurl/MyCustomWebApp/. I have setup an IIS application at this level but attempting to run the application with a custom dll in the bin results in the error
" Request for the permission of type 'Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' failed."
我尝试对 dll 进行签名并将其注册到共享点服务器 GAC,但随后我收到了:
System.Security.SecurityException:该程序集不允许部分受信任的调用者."
如果我从应用程序 bin 目录中删除 DLL,页面将加载,但我失去了其中需要的功能.
仅当 Dll 在 bin 中时才会发生错误,它不依赖于 Dll 中的任何一行代码.
IIS 版本 6分享点:WSS 3.0Windows Server 2003
更新:我运行了caspol -machine -addfulltrust(dll的路径)",它成功了,但我仍然收到同样的错误.
I attempted to sign the dll and register it with the sharepoint servers GAC but then I received:
"System.Security.SecurityException: That assembly does not allow partially trusted callers."
If I remove the DLL from the applications bin directory the page loads but I lose functionality I need within it.
The error happens only if the Dll is in the bin, it does not depend on any one line of code in the Dll.
IIS Version 6
Sharepoint: WSS 3.0
Windows Server 2003
Update: I ran "caspol -machine -addfulltrust (path to dll)" and it succeeded but I still receive the same error.
推荐答案
我终于解决了这个问题.我认为其中一部分是通过尝试人们建议的不同事物的混合解决的,但最终修复它的是添加<trust level="Full" originUrl=""/>"进入 web.config.对于任何不知道它的人都应该在 system.web 部分下.我还需要添加几个 dll.将 dll 添加到 GAC 有帮助,但并没有解决所有问题.
I finally got this resolved. I think part of it was solved by a mix of trying different things people have suggested, but ultimately what fixed it was adding "<trust level="Full" originUrl=""/>" into the web.config. For anyone that doesn't know it should go under the system.web section. I also needed to add several of the dll's. Adding the dll's to the GAC helped but did not solve all of the issues.
这篇关于将自定义 Asp.net 应用程序部署到与 Sharepoint 相同的 IIS 站点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!