如何在DNN站点的虚拟目录下安装CS(Community Server)

第一次尝试安装CS(Community Server) ,想把DNN和CS结合起来,所以就在DNN的站点下面建了虚拟目录CSS存放CS的文件,但是,一打开运行,就出现如下错误

Line 37: <!-- HttpModules for Common Functionality -->
Line 38: <httpModules>
Line 39: <add name="UrlRewrite" type="DotNetNuke.HttpModules.UrlRewriteModule, DotNetNuke.HttpModules.UrlRewrite" />
Line 40: <add name="Exception" type="DotNetNuke.HttpModules.ExceptionModule, DotNetNuke.HttpModules.Exception" />
Line 41: <add name="UsersOnline" type="DotNetNuke.HttpModules.UsersOnlineModule
..........................................................................

来看是由于虚拟目录继承了主目录的Web.config中的<httpModules>而导致的,无耐,只能到CNBlogs来求助,但是有位仁兄给我的答案是更本就是答非所问.

只有自己尝试自查MSDN,查到了一个Rmove的方法,在CS的web.config中,添加如下
    <remove name="UrlRewrite" />
   <remove name="Exception" />
   <remove name="UsersOnline" />
   <remove name="ProfilePrototype" />
   <remove name="AnonymousIdentificationPrototype" />
   <remove name="RoleManagerPrototype" />
   <remove name="DNNMembership" />
   <remove name="Personalization" />
一运行,还是同样错误,看来只能把哪几个DLL Copy到CS的bin目录下了,
DNNSQLMembershipProvider.dll
DNNSQLProfileProvider.dll
DNNSQLRoleProvider.dll
DotNetNuke.dll
DotNetNuke.HttpModules.DNNMembership.dll
DotNetNuke.HttpModules.Exception.dll
DotNetNuke.HttpModules.Personlization.dll
DotNetNuke.HttpModules.URLRewrite.dll
DotNetNuke.HttpModules.UsersOnline.dll
再运行,终于,这个问题不再出现了,但是又有了新的问题
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Annoymous_id_module_not_enabled: Country

Source Error:

[No relevant source lines]

Source File: none Line: 0


在google上查找了一下,果然,出现这个问题的人还挺多的, 在外面找到的解决方案
In CS web.config I removed ( commented out ) following lines:

_______________________________________________________________________________
<!--<anonymousIdentification
enabled="true"
cookieName=".ASPXANONYMOUS"
cookieTimeout="100000"
cookiePath="/"
cookieRequireSSL="false"
cookieSlidingExpiration="true"
cookieProtection="None" domain="" />-->
_______________________________________________________________________________

Now CommunityServer takes over DNN's Setting which enables anonymous Identification per default. It should also work if you set this option in both DNN's and CS's web.config in the same way!

还要在CS的web.config中注释掉的有
<add name="timezone" type="System.Double" defaultValue="0" />这一句
OK,CS总算能运行起来了,不知道还有没有别的问题

ps: 补充一点,
由于,DNN的Timezone属性定义是
<add name="TimeZone" type="integer" allowAnonymous="true" />
而CS的是
<add name="timezone" type="System.Double" defaultValue="0" />
所以要把CS的CommunityServerComponents\Componets\Profile.cs文件作相庆的更改,把int转为dobule

        public double Timezone 
        
{
            
get 
            
{
                
object obj;
                
try //CS stores this as an double "timezone" (hours off GMT)
                {
                    obj 
= GetObject("timezone");
                    
return obj == null ? 0 : (double)obj;
                }

                
catch //DNN stores this as an INT "TimeZone" (Minutes off GMT)
                {
                    obj 
= GetObject("TimeZone");
                    
return obj == null ? 0 : (double)(Convert.ToDouble(obj)/60);
                }

                  
            }

            
set 
            
{
                
try //CS stores this as an double "timezone" (hours off GMT)
                {
                    
if ( value < -12 || value > 12)
                        Set(
"timezone",0);
                    
else
                        Set(
"timezone",value );
                }

                
catch //DNN stores this as an INT "TimeZone" (Minutes off GMT)
                {
                    
if ( value < -12 || value > 12)
                        Set(
"TimeZone",0);
                    
else
                        Set(
"TimeZone",Convert.ToInt32( value *60));
                }

            }

        }
 
posted @   无心之柳.NET  阅读(1770)  评论(1编辑  收藏  举报
编辑推荐:
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
点击右上角即可分享
微信分享提示