DotNetNuke 4.3.5 StarterKit C#模板無法運行Bug

來源:互聯網
上載者:User

首先會出現這樣的錯誤提示:

Error: TesingModulle is currently unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException:
e:\Development\DotNetNuke_4.3.5_Source\Website\DesktopModules\TestingModule\ViewTestingModule.ascx.cs(136):
error CS0019: Operator '&' cannot be applied to operands of
type
'string' and 'string' ---> System.Web.HttpCompileException:
e:\Development\DotNetNuke_4.3.5_Source\Website\DesktopModules\TestingModule\ViewTestingModule.ascx.cs(136):
error CS0019: Operator '&' cannot be applied to operands of
type
'string' and 'string' (運算子“&”無法應用於“string”和“string”類型的運算元)at
System.Web.Compilation.AssemblyBuilder.Compile() at
System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at
System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath
virtualPath) at
System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath
virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean
allowBuildInPrecompile) at
System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext
context, VirtualPath virtualPath, Boolean noBuild, Boolean
allowCrossApp, Boolean allowBuildInPrecompile) at
System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) at
System.Web.UI.TemplateControl.LoadControl(String virtualPath) at
DotNetNuke.UI.Skins.Skin.InjectModule(Control objPane, ModuleInfo
objModule, PortalSettings PortalSettings) in
E:\Development\DotNetNuke_4.3.5_Source\Library\Components\Skins\Skin.vb:line
446 --- End of inner exception stack trace ---
按照提示,找到出錯的代碼,第136行,很明顯,作者按照VB的文法在連接字串。            foreach (PropertyInfo objPropertyInfo in objProperties)
   
       &
nbsp; {
136行:
              
if (strContent.IndexOf("[" & objPropertyInfo.Name.ToUpper() & "]") != -1)
                {
                    strValue = Server.HtmlDecode(DataBinder.Eval(e.Item.DataItem, objPropertyInfo.Name).ToString());
                    strContent = strContent.Replace("[" + objPropertyInfo.Name.ToUpper() + "]", strValue);
                }
            }

將"&"改為“+"。

之後,會出現這樣的出錯提示:

Error: TesingModulle is currently
unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at YourCompany.Modules.TestingModule.ViewTestingModule.lstContent_ItemDataBound(Object sender, DataListItemEventArgs e) in e:\Development\DotNetNuke_4.3.5_Source\Website\DesktopModules\TestingModule\ViewTestingModule.ascx.cs:line 136 at System.Web.UI.WebControls.DataList.OnItemDataBound(DataListItemEventArgs e) at System.Web.UI.WebControls.DataList.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) at System.Web.UI.WebControls.DataList.CreateControlHierarchy(Boolean useDataSource) at System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e) at System.Web.UI.WebControls.BaseDataList.DataBind() at YourCompany.Modules.TestingModule.ViewTestingModule.Page_Load(Object sender, EventArgs e) in e:\Development\DotNetNuke_4.3.5_Source\Website\DesktopModules\TestingModule\ViewTestingModule.ascx.cs:line 115 --- End of inner exception stack trace --- 對於這個出錯先介紹一個簡單的解決方案:

如果出現這個提示,並不表示現在模組完全不能使用,這時你點左上方的小三角形進入“設定”頁,點擊模組對應的設定節,在“Template"處輸入"[CONTENT]"並更新,模組就可以正常運行,有時間會做個補丁。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.