第一次尝试安装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
{
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));
}
}
}